Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp360273ybe; Wed, 4 Sep 2019 00:28:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4WYzB+HwpDzLSIbDMosC/8492l6odGtLg3zbEiUFE9zOskgEnyqL6TQ/pb60MCjVOEOEr X-Received: by 2002:aa7:8510:: with SMTP id v16mr28917013pfn.113.1567582107732; Wed, 04 Sep 2019 00:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567582107; cv=none; d=google.com; s=arc-20160816; b=hxUO6dM6kBkBK7Nk0nUciMeL8bBtSRKJsTUA1vw7QMgMjreOiPCUK/myoETwBOecYO 30yUu4mG+u0aApnOqSJGtWfprEQFBxRvruORDgWcsSYcUzMyRKECeH54s6aiJG1G8N8F G+0l5Nl/kUZbKZvTQOVlIjgfm6HxougLg3dHVxmKX1llN0FirmRQLDywSl+9Yhc0r/9B AQf9vdMG+leI8040YZOj5HjgGUMdaJdE3CM8Fz5ch6F867snlIodb5BU7smw9BEzp0F+ oQGv4tYlK17slNqiMAWd3aMfDZFpE7HERx180WcS3GeBX4UDbyhscr6Or6CIpuoPP0Za 0pqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:content-description :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9Et9BlRt+SMSDP1Q6IJeQ3vF/J+SFCi5Hqn0dALv4Fc=; b=vn4B3ZDEpHwhmwXUN6xZPXkC3YUe7uheJoZXU4wW9cHcehc650q29n0nLcMbNF7+3s Do8Iy4TgRvDav4spq9E2eHTfihsNIOf9SXupcl8aOegO+y0GlQGy5L9aSC6pn+GWTnL9 o4anStI00o06ZvdpsY45j8PDG8b5aa6NwJb5Dd+soINuWOYhy1YsFBMUVcg8xWcapiT1 gfsqz+55YUFAmUKPpG5xxaXOmLlNP9NrPOxg7wYci1O2OywPJMn3FQX6x6ZQOR6Gqfdg qItlwVP4UsbTGbOAes9IHNFXbwWteB/eMFNXOhi12oJceufMftyIDZTwT+rrxr7Tf7V3 zc5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NBpZ6A+8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16si935475pll.206.2019.09.04.00.28.10; Wed, 04 Sep 2019 00:28:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NBpZ6A+8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728848AbfIDH1Q (ORCPT + 99 others); Wed, 4 Sep 2019 03:27:16 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33148 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbfIDH1Q (ORCPT ); Wed, 4 Sep 2019 03:27:16 -0400 Received: by mail-pg1-f194.google.com with SMTP id n190so10758803pgn.0 for ; Wed, 04 Sep 2019 00:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-description:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=9Et9BlRt+SMSDP1Q6IJeQ3vF/J+SFCi5Hqn0dALv4Fc=; b=NBpZ6A+8AN7oxcEXEc9nIbW6FJSXHK3UU5N0RJjm+KHzTpjtuxFTvGUJBa8Eswyp8Q LExWBIQplJX/7J0ailAW0WYmXrfrR0DnRd8OhbGVZa83Bhp85xasVCxvWh3UYGGbufHv /iu0w0YwOMpFeWCLHCoESpzHxsGfbEvzX7hS0roRhT8dt+7q3Xp4oSfWPiODpH+IQWPg +S1SDcNwPeC7phcGvbIg/c9QRgi+sRCfofKlup3tpyDNesNYlqbK6VLrHvapgqpbXsh6 ZLy1IXUKl4OEdg1cqFlFORiMgyHGVkEEJiHXL/1LoFbqVUeHNpR4OFUIBg1DK19zTCK1 yP1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-description:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=9Et9BlRt+SMSDP1Q6IJeQ3vF/J+SFCi5Hqn0dALv4Fc=; b=EqxLPKAFp9JdUrNwKF2q/zy9eUcC5sQgxq08ZZK0E3HSOLaln3oD9p7UHlULgDDz+/ pL5cfnGAC3VtnG3VVnavg82709AMfbW73crf4ab9oatgtWooAq1JDEBK6feGbeI4gDE7 28CeAJUH7nkNYzLadGPfMhcPSROPK9PtlW0L2hRyR5NOKJ1nAY2//X1DEX1lm45IhAoo FDzRimlE7Mwnps5WJTNFySTjWDFtdxjCcH9j4l6oPcbhjg45WQV7RmHagXBzCEiFJvAQ HuLPWeb+9yxsYiujSLlRXQDXDiEEx5WjFdAAD72kAp831Qxpg5Yk5vPN2Yl8KKFBeO6i Km9g== X-Gm-Message-State: APjAAAWa2///vZ5ogLPDjAs8zv88ft/RtQpFZ8HiUd9O+Yd+5hvBaZcb hHwBAvmNdOrsldiPtQJ2gqE= X-Received: by 2002:a63:1310:: with SMTP id i16mr33404702pgl.187.1567582035511; Wed, 04 Sep 2019 00:27:15 -0700 (PDT) Received: from raspberrypi ([61.83.141.141]) by smtp.gmail.com with ESMTPSA id s76sm19416340pgc.92.2019.09.04.00.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 00:27:14 -0700 (PDT) Date: Wed, 4 Sep 2019 08:27:07 +0100 From: Sidong Yang To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: Rodrigo Siqueira , David Airlie , Haneen Mohammed , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/vkms: Use alpha value to blend values. Message-ID: <20190904072707.GA29211@raspberrypi> References: <20190831172546.GA1972@raspberrypi> <20190902122858.GU7482@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Description: ri-devel@lists.freedesktop.org, Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190902122858.GU7482@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 02, 2019 at 03:28:58PM +0300, Ville Syrj?l? wrote: > On Sat, Aug 31, 2019 at 06:25:46PM +0100, Sidong Yang wrote: > > Use alpha value to blend source value and destination value Instead of > > just overwrite with source value. > > > > Signed-off-by: Sidong Yang > > --- > > drivers/gpu/drm/vkms/vkms_composer.c | 13 +++++++++++-- > > 1 file changed, 11 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c > > index d5585695c64d..b776185e5cb5 100644 > > --- a/drivers/gpu/drm/vkms/vkms_composer.c > > +++ b/drivers/gpu/drm/vkms/vkms_composer.c > > @@ -75,6 +75,9 @@ static void blend(void *vaddr_dst, void *vaddr_src, > > int y_limit = y_src + h_dst; > > int x_limit = x_src + w_dst; > > > > + u8 *src, *dst; > > + u32 alpha, inv_alpha; > > These could all live in a tighter scope. Hi, Ville. Thank you for reviewing my patch. I think that's good idea and I'll do that in next version. I found some patch in mailing list that is similar with this patch. So should I drop this patch and find other thing? Sidong. > > Apart from that lgtm > Reviewed-by: Ville Syrj?l? > > > + > > for (i = y_src, i_dst = y_dst; i < y_limit; ++i) { > > for (j = x_src, j_dst = x_dst; j < x_limit; ++j) { > > offset_dst = dest_composer->offset > > @@ -84,8 +87,14 @@ static void blend(void *vaddr_dst, void *vaddr_src, > > + (i * src_composer->pitch) > > + (j * src_composer->cpp); > > > > - memcpy(vaddr_dst + offset_dst, > > - vaddr_src + offset_src, sizeof(u32)); > > + src = vaddr_src + offset_src; > > + dst = vaddr_dst + offset_dst; > > + alpha = src[3] + 1; > > + inv_alpha = 256 - src[3]; > > + dst[0] = (alpha * src[0] + inv_alpha * dst[0]) >> 8; > > + dst[1] = (alpha * src[1] + inv_alpha * dst[1]) >> 8; > > + dst[2] = (alpha * src[2] + inv_alpha * dst[2]) >> 8; > > + dst[3] = 0xff; > > } > > i_dst++; > > } > > -- > > 2.20.1 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Ville Syrj?l? > Intel