From: Sidong Yang <realwakka@gmail.com>
To: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kernel-usp@googlegroups.com
Subject: Re: [PATCH] drm/vkms: Use alpha value to blend values.
Date: Tue, 25 Aug 2020 12:35:51 +0000 [thread overview]
Message-ID: <20200825123551.GA25810@realwakka> (raw)
In-Reply-To: <20200825031501.y3knhdwph5a6knld@smtp.gmail.com>
On Mon, Aug 24, 2020 at 11:15:01PM -0400, Rodrigo Siqueira wrote:
> Hi Sidong,
>
> Thanks a lot for your patch and effort to improve VKMS.
>
> On 08/18, Sidong Yang wrote:
> > I wrote this patch for TODO list in vkms documentation.
> >
> > Use alpha value to blend source value and destination value Instead of
> > just overwrite with source value.
> >
> > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> >
> > Signed-off-by: Sidong Yang <realwakka@gmail.com>
> > ---
> > drivers/gpu/drm/vkms/vkms_composer.c | 14 ++++++++++++--
> > 1 file changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c
> > index 4f3b07a32b60..e3230e2a99af 100644
> > --- a/drivers/gpu/drm/vkms/vkms_composer.c
> > +++ b/drivers/gpu/drm/vkms/vkms_composer.c
> > @@ -77,6 +77,9 @@ static void blend(void *vaddr_dst, void *vaddr_src,
> >
> > for (i = y_src, i_dst = y_dst; i < y_limit; ++i) {
> > for (j = x_src, j_dst = x_dst; j < x_limit; ++j) {
> > + u8 *src, *dst;
> > + u32 alpha, inv_alpha;
> > +
> > offset_dst = dest_composer->offset
> > + (i_dst * dest_composer->pitch)
> > + (j_dst++ * dest_composer->cpp);
> > @@ -84,8 +87,15 @@ 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;
>
Hi, Rodrigo!
> Did you test your change with IGT? Maybe I missed something but looks
> like that you're applying the alpha value but the value that we get is
> already pre-multiplied.
>
> Btw, It looks like that you and Melissa are working in the same feature,
> maybe you two could try to sync for avoiding overlapping.
Thanks for review.
Yes, this patch should be dropped and I should watch Melissa's patch.
>
> Finally, do you have plans to send your fix for
> vkms_get_vblank_timestamp() function? That patch was really good and
> removes a lot of warning generated during the IGT test.
Okay, I'll work for improve vkms_get_vblank_timestamp().
Thank you so much.
Sincerely,
-Sidong
>
> Best Regards
>
> > + dst[3] = 0xff;
> > +
> > }
> > i_dst++;
> > }
> > --
> > 2.17.1
> >
>
> --
> Rodrigo Siqueira
> https://siqueira.tech
next prev parent reply other threads:[~2020-08-25 12:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 16:02 [PATCH] drm/vkms: Use alpha value to blend values Sidong Yang
2020-08-25 3:15 ` Rodrigo Siqueira
2020-08-25 12:35 ` Sidong Yang [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-09-01 8:56 Sidong Yang
2019-08-31 17:25 Sidong Yang
2019-09-02 12:28 ` Ville Syrjälä
2019-09-04 7:27 ` Sidong Yang
2019-09-04 15:48 ` Ville Syrjälä
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200825123551.GA25810@realwakka \
--to=realwakka@gmail.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=kernel-usp@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigosiqueiramelo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox