All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Maxime Ripard <maxime@cerno.tech>, dri-devel@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH v2 5/7] drm/vc4: hvs: Move the dlist setup to its own function
Date: Wed, 6 Apr 2022 12:41:14 +0200	[thread overview]
Message-ID: <4ae0c172-52f1-9e03-b150-7657eef331f7@suse.de> (raw)
In-Reply-To: <20220331143744.777652-6-maxime@cerno.tech>


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

Hi

Am 31.03.22 um 16:37 schrieb Maxime Ripard:
> The vc4_hvs_update_dlist function mostly deals with setting up the
> vblank events and setting up the dlist entry pointer to our current
> active one.
> 
> We'll want to do the former separately from the vblank handling in later
> patches, so let's move it to a function of its own.
> 
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>   drivers/gpu/drm/vc4/vc4_hvs.c | 19 ++++++++++++++-----
>   1 file changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
> index 71aa5081eaa3..2d540fc11357 100644
> --- a/drivers/gpu/drm/vc4/vc4_hvs.c
> +++ b/drivers/gpu/drm/vc4/vc4_hvs.c
> @@ -382,10 +382,19 @@ int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state)
>   	return 0;
>   }
>   
> +static void vc4_hvs_install_dlist(struct drm_crtc *crtc)
> +{
> +	struct drm_device *dev = crtc->dev;
> +	struct vc4_dev *vc4 = to_vc4_dev(dev);
> +	struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
> +
> +	HVS_WRITE(SCALER_DISPLISTX(vc4_state->assigned_channel),
> +		  vc4_state->mm.start);
> +}
> +
>   static void vc4_hvs_update_dlist(struct drm_crtc *crtc)
>   {
>   	struct drm_device *dev = crtc->dev;
> -	struct vc4_dev *vc4 = to_vc4_dev(dev);
>   	struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
>   	struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
>   	unsigned long flags;
> @@ -405,9 +414,6 @@ static void vc4_hvs_update_dlist(struct drm_crtc *crtc)
>   		spin_unlock_irqrestore(&dev->event_lock, flags);
>   	}
>   
> -	HVS_WRITE(SCALER_DISPLISTX(vc4_state->assigned_channel),
> -		  vc4_state->mm.start);
> -
>   	spin_lock_irqsave(&vc4_crtc->irq_lock, flags);
>   	vc4_crtc->current_dlist = vc4_state->mm.start;
>   	spin_unlock_irqrestore(&vc4_crtc->irq_lock, flags);
> @@ -434,6 +440,7 @@ void vc4_hvs_atomic_enable(struct drm_crtc *crtc,
>   	struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
>   	bool oneshot = vc4_crtc->feeds_txp;
>   
> +	vc4_hvs_install_dlist(crtc);
>   	vc4_hvs_update_dlist(crtc);
>   	vc4_hvs_init_channel(vc4, crtc, mode, oneshot);
>   }
> @@ -509,8 +516,10 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc,
>   	 * If the CRTC is being disabled, there's no point in updating this
>   	 * information.
>   	 */
> -	if (crtc->state->active && old_state->active)
> +	if (crtc->state->active && old_state->active) {
> +		vc4_hvs_install_dlist(crtc);
>   		vc4_hvs_update_dlist(crtc);
> +	}

No need for braces here.

Best regards
Thomas

>   
>   	if (crtc->state->color_mgmt_changed) {
>   		u32 dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(channel));

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2022-04-06 10:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 14:37 [PATCH v2 0/7] drm/vc4: hvs: Various improvements Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 1/7] drm/vc4: kms: Take old state core clock rate into account Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 2/7] drm/vc4: hvs: Fix frame count register readout Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 3/7] drm/vc4: hvs: Store channel in variable Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 4/7] drm/vc4: hvs: Remove dlist setup duplication Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 5/7] drm/vc4: hvs: Move the dlist setup to its own function Maxime Ripard
2022-04-06 10:41   ` Thomas Zimmermann [this message]
2022-03-31 14:37 ` [PATCH v2 6/7] drm/vc4: kms: Ignore atomic_flush if we're disabled Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 7/7] drm/vc4: hvs: Use pointer to HVS in HVS_READ and HVS_WRITE macros Maxime Ripard
2022-04-06 10:44 ` [PATCH v2 0/7] drm/vc4: hvs: Various improvements Thomas Zimmermann
2022-04-06 13:26 ` Maxime Ripard

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=4ae0c172-52f1-9e03-b150-7657eef331f7@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maxime@cerno.tech \
    /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.