All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: David Airlie <airlied@linux.ie>, James Jones <jajones@nvidia.com>,
	dri-devel@lists.freedesktop.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH 4/9] drm/tegra: dc: Implement hardware cursor on Tegra186 and later
Date: Wed, 24 Mar 2021 16:03:46 +0100	[thread overview]
Message-ID: <YFtU0rw+BaF6dHKy@orome.fritz.box> (raw)
In-Reply-To: <487b94d0-a52b-824b-c29d-f88b4605b117@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1794 bytes --]

On Tue, Mar 23, 2021 at 10:05:23PM +0300, Dmitry Osipenko wrote:
> 23.03.2021 21:24, Thierry Reding пишет:
> > On Tue, Mar 23, 2021 at 08:57:42PM +0300, Dmitry Osipenko wrote:
> >> 23.03.2021 18:54, Thierry Reding пишет:
> >>> @@ -920,15 +934,42 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane,
> >>>  	value = tegra_dc_readl(dc, DC_DISP_BLEND_CURSOR_CONTROL);
> >>>  	value &= ~CURSOR_DST_BLEND_MASK;
> >>>  	value &= ~CURSOR_SRC_BLEND_MASK;
> >>> -	value |= CURSOR_MODE_NORMAL;
> >>> +
> >>> +	if (dc->soc->has_nvdisplay)
> >>> +		value &= ~CURSOR_COMPOSITION_MODE_XOR;
> >>> +	else
> >>> +		value |= CURSOR_MODE_NORMAL;
> >>> +
> >>>  	value |= CURSOR_DST_BLEND_NEG_K1_TIMES_SRC;
> >>>  	value |= CURSOR_SRC_BLEND_K1_TIMES_SRC;
> >>>  	value |= CURSOR_ALPHA;
> >>>  	tegra_dc_writel(dc, value, DC_DISP_BLEND_CURSOR_CONTROL);
> >>>  
> >>> +	/* nvdisplay relies on software for clipping */
> >>> +	if (dc->soc->has_nvdisplay) {
> >>
> >> But coordinates already should be clipped by
> >> drm_atomic_helper_check_plane_state().
> > 
> > Yes, and the driver goes on to use the clipped coordinates later on in
> > this function.
> 
> I see now what it does, looks okay.
> 
> Minor nit: the i/j aren't very expressive names, something like sx/sy
> sw/sh should be a bit more appropriate naming.
> 
> You could also make use of drm_rect_width/height helpers.
> 
> But this doesn't deserve a v2 if there is nothing more important to improve.

As I was browsing through the drm_rect helpers, I also came across
drm_rect_fp_to_int(), which helps simplify this further. As a result I
was able to just get rid of most of these temporary variables in favor
of just the integer version of drm_rect.

Thanks for the hint.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: David Airlie <airlied@linux.ie>,
	linux-tegra@vger.kernel.org, James Jones <jajones@nvidia.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/9] drm/tegra: dc: Implement hardware cursor on Tegra186 and later
Date: Wed, 24 Mar 2021 16:03:46 +0100	[thread overview]
Message-ID: <YFtU0rw+BaF6dHKy@orome.fritz.box> (raw)
In-Reply-To: <487b94d0-a52b-824b-c29d-f88b4605b117@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1794 bytes --]

On Tue, Mar 23, 2021 at 10:05:23PM +0300, Dmitry Osipenko wrote:
> 23.03.2021 21:24, Thierry Reding пишет:
> > On Tue, Mar 23, 2021 at 08:57:42PM +0300, Dmitry Osipenko wrote:
> >> 23.03.2021 18:54, Thierry Reding пишет:
> >>> @@ -920,15 +934,42 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane,
> >>>  	value = tegra_dc_readl(dc, DC_DISP_BLEND_CURSOR_CONTROL);
> >>>  	value &= ~CURSOR_DST_BLEND_MASK;
> >>>  	value &= ~CURSOR_SRC_BLEND_MASK;
> >>> -	value |= CURSOR_MODE_NORMAL;
> >>> +
> >>> +	if (dc->soc->has_nvdisplay)
> >>> +		value &= ~CURSOR_COMPOSITION_MODE_XOR;
> >>> +	else
> >>> +		value |= CURSOR_MODE_NORMAL;
> >>> +
> >>>  	value |= CURSOR_DST_BLEND_NEG_K1_TIMES_SRC;
> >>>  	value |= CURSOR_SRC_BLEND_K1_TIMES_SRC;
> >>>  	value |= CURSOR_ALPHA;
> >>>  	tegra_dc_writel(dc, value, DC_DISP_BLEND_CURSOR_CONTROL);
> >>>  
> >>> +	/* nvdisplay relies on software for clipping */
> >>> +	if (dc->soc->has_nvdisplay) {
> >>
> >> But coordinates already should be clipped by
> >> drm_atomic_helper_check_plane_state().
> > 
> > Yes, and the driver goes on to use the clipped coordinates later on in
> > this function.
> 
> I see now what it does, looks okay.
> 
> Minor nit: the i/j aren't very expressive names, something like sx/sy
> sw/sh should be a bit more appropriate naming.
> 
> You could also make use of drm_rect_width/height helpers.
> 
> But this doesn't deserve a v2 if there is nothing more important to improve.

As I was browsing through the drm_rect helpers, I also came across
drm_rect_fp_to_int(), which helps simplify this further. As a result I
was able to just get rid of most of these temporary variables in favor
of just the integer version of drm_rect.

Thanks for the hint.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-03-24 15:04 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 15:54 [PATCH 0/9] drm/tegra: Various improvements Thierry Reding
2021-03-23 15:54 ` Thierry Reding
2021-03-23 15:54 ` [PATCH 1/9] drm/fourcc: Add macro to check for the modifier vendor Thierry Reding
2021-03-23 15:54   ` Thierry Reding
2021-03-23 16:04   ` Simon Ser
2021-03-23 16:04     ` Simon Ser
2021-03-23 16:49     ` Thierry Reding
2021-03-23 16:49       ` Thierry Reding
2021-03-23 15:54 ` [PATCH 2/9] drm/tegra: dc: Inherit DMA mask Thierry Reding
2021-03-23 15:54   ` Thierry Reding
2021-03-23 15:54 ` [PATCH 3/9] drm/tegra: dc: Parameterize maximum resolution Thierry Reding
2021-03-23 15:54   ` Thierry Reding
2021-03-23 15:54 ` [PATCH 4/9] drm/tegra: dc: Implement hardware cursor on Tegra186 and later Thierry Reding
2021-03-23 15:54   ` Thierry Reding
2021-03-23 17:57   ` Dmitry Osipenko
2021-03-23 17:57     ` Dmitry Osipenko
2021-03-23 18:24     ` Thierry Reding
2021-03-23 18:24       ` Thierry Reding
2021-03-23 19:05       ` Dmitry Osipenko
2021-03-23 19:05         ` Dmitry Osipenko
2021-03-24 15:03         ` Thierry Reding [this message]
2021-03-24 15:03           ` Thierry Reding
2021-03-23 15:54 ` [PATCH 5/9] drm/tegra: fb: Add diagnostics for framebuffer modifiers Thierry Reding
2021-03-23 15:54   ` Thierry Reding
2021-03-23 15:54 ` [PATCH 6/9] drm/tegra: gem: Add a clarifying comment Thierry Reding
2021-03-23 15:54   ` Thierry Reding
2021-03-24 14:41   ` Dmitry Osipenko
2021-03-24 14:41     ` Dmitry Osipenko
2021-03-24 15:02     ` Thierry Reding
2021-03-24 15:02       ` Thierry Reding
2021-03-24 15:45       ` Dmitry Osipenko
2021-03-24 15:45         ` Dmitry Osipenko
2021-03-24 16:42         ` Thierry Reding
2021-03-24 16:42           ` Thierry Reding
2021-03-24 16:50           ` Dmitry Osipenko
2021-03-24 16:50             ` Dmitry Osipenko
2021-03-26 16:37             ` Thierry Reding
2021-03-26 16:37               ` Thierry Reding
2021-03-28 14:29               ` Dmitry Osipenko
2021-03-28 14:29                 ` Dmitry Osipenko
2021-03-23 15:54 ` [PATCH 7/9] gpu: host1x: Add early init and late exit callbacks Thierry Reding
2021-03-23 15:54   ` Thierry Reding
2021-03-23 15:54 ` [PATCH 8/9] drm/tegra: Count number of display controllers at runtime Thierry Reding
2021-03-23 15:54   ` Thierry Reding
2021-03-23 15:54 ` [PATCH 9/9] drm/tegra: Support sector layout on Tegra194 Thierry Reding
2021-03-23 15:54   ` Thierry Reding

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=YFtU0rw+BaF6dHKy@orome.fritz.box \
    --to=thierry.reding@gmail.com \
    --cc=airlied@linux.ie \
    --cc=digetx@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jajones@nvidia.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.