Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp861644ybe; Wed, 4 Sep 2019 08:49:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhsnFa7fUS3jPlVjPi10GBSbRFUmyU53fhFiPVkG5hqyL7mj5UGcFhB1ihjibEp7RlR8Mk X-Received: by 2002:a17:902:8d8c:: with SMTP id v12mr41978843plo.198.1567612182654; Wed, 04 Sep 2019 08:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567612182; cv=none; d=google.com; s=arc-20160816; b=wxnHvIYrjceSvVB3+1N0vSqSUe7zxDDavWT+/oyaUIfN7n/Z9V1VBTi67ReP4IrxDN LXcQnUqVcPyEelx0f2B9Gmwc/W3jeh8G4Q85OuDVXLvdaJqLowK4mb9mve8x+W4aA4KA dmbS9ZUIMeMatyAauOofNarNc65WJtKVCQM9jFbNLMJAJKTnF2KHbJWJW2zpGOMBHPO4 59uekU97a/3NoCuzUAaaz1Ov0bd+o6yYQyXsoi3PR08ooFqBqkE2hpgowqLYWQpK2AJ1 hQ19YpAHvZvhGdeVLE1GDMUhjFj8M09SABmeyqZZK4pvGf0ol4DyW9F57nOPGtRYa4sn qjtQ== 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:mime-version :references:message-id:subject:cc:to:from:date; bh=WvZzj/f00RnArmNyIh++OE83N4uqTeyqzK7nFEYRy6Y=; b=x50aZqBkeFLYFsjIS9sHfJTutY1sTMLD9rupZRz/zvPP/Ty8A8zSB5jrkhDaKTmF6z sLHuBSQn1egbxahemZ7nCHtWEyJhWVpx1rpc91sP0SDCKv7lEFvEWV3Qjb3wbMmiVlyH BsT/i6v8HqeBYqm4O36upMT0rct+oIa+9ov4MxXNhmJdivqMEu10CHPSqDmlJ3LwGzAw 9TG7fJgtYI1JzFocx1ry8e2Sf/Y6XSnVXDgSWNlOQ1oxq2LmO0FeWM6ZfO3rU6kzPzUE 6kk6Rg+ZLyBo/ZfwYZfFqQA18Z7IziLF7SUl1YDSmDUXq74w5JGicwGQUJUNG7yt5Kw2 DwBQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t13si8422808pfe.247.2019.09.04.08.49.26; Wed, 04 Sep 2019 08:49:42 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731306AbfIDPsF (ORCPT + 99 others); Wed, 4 Sep 2019 11:48:05 -0400 Received: from mga11.intel.com ([192.55.52.93]:21768 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729993AbfIDPsF (ORCPT ); Wed, 4 Sep 2019 11:48:05 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 08:48:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,467,1559545200"; d="scan'208";a="194775097" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga002.jf.intel.com with SMTP; 04 Sep 2019 08:48:01 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 04 Sep 2019 18:48:00 +0300 Date: Wed, 4 Sep 2019 18:48:00 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Sidong Yang 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: <20190904154800.GD7482@intel.com> References: <20190831172546.GA1972@raspberrypi> <20190902122858.GU7482@intel.com> <20190904072707.GA29211@raspberrypi> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190904072707.GA29211@raspberrypi> 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 Wed, Sep 04, 2019 at 08:27:07AM +0100, Sidong Yang wrote: > 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? Probably best if you discuss that with whoever sent that other patch. > > 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 -- Ville Syrj?l? Intel