All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Nabendu Maiti <nabendu.bikash.maiti@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Move number of scalers initialization to runtime init
Date: Fri, 25 Nov 2016 09:44:30 +0000	[thread overview]
Message-ID: <20161125094430.GE26057@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <1480067218-5505-1-git-send-email-nabendu.bikash.maiti@intel.com>

On Fri, Nov 25, 2016 at 03:16:58PM +0530, Nabendu Maiti wrote:
> In future patches, we require greater flexibility in describing
> the number of scalers available on each CRTC. To ease that transition
> we move the current assignment to intel_device_info.
> 
> Scaler structure initialisation is done if scaler is available on the CRTC.
> Gen9 check is not required as on depending upon numbers of scalers we
> initialize scalers or return without doing anything in skl_init_scalers.
> 
> v2: Added Chris's commenents.
comments :)

> Signed-off-by: Nabendu Maiti <nabendu.bikash.maiti@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

> ---
>  drivers/gpu/drm/i915/i915_drv.h          |  1 +
>  drivers/gpu/drm/i915/intel_device_info.c |  3 +++
>  drivers/gpu/drm/i915/intel_display.c     | 18 ++++++++----------
>  3 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 1ec9619..bb8c5f0 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -758,6 +758,7 @@ struct intel_device_info {
>  	u16 device_id;
>  	u8 num_pipes;
>  	u8 num_sprites[I915_MAX_PIPES];
> +	u8 num_scalers[I915_MAX_PIPES];
>  	u8 gen;
>  	u16 gen_mask;
>  	u8 ring_mask; /* Rings supported by the HW */
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 185e3bb..ef26fa8 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -282,6 +282,9 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
>  		info->num_sprites[PIPE_A] = 2;
>  		info->num_sprites[PIPE_B] = 2;
>  		info->num_sprites[PIPE_C] = 1;
> +		info->num_scalers[PIPE_A] = 2;
> +		info->num_scalers[PIPE_B] = 2;
> +		info->num_scalers[PIPE_C] = 1;
>  	} else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
>  		for_each_pipe(dev_priv, pipe)
>  			info->num_sprites[pipe] = 2;
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 5d11002..2062170 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -15266,6 +15266,11 @@ static void skl_init_scalers(struct drm_i915_private *dev_priv,
>  		&crtc_state->scaler_state;
>  	int i;
>  
> +	crtc->num_scalers = dev_priv->info.num_scalers[crtc->pipe];
> +

Blank here is overkill

> +	if (!crtc->num_scalers)
> +		return;
> +

crtc->num_scalers = <info>;
if (!ctrc->num_scalers)
	return;

is quite clean.

>  	for (i = 0; i < crtc->num_scalers; i++) {
>  		struct intel_scaler *scaler = &scaler_state->scalers[i];
>  
> @@ -15297,16 +15302,6 @@ static int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
>  	intel_crtc->base.state = &crtc_state->base;
>  	crtc_state->base.crtc = &intel_crtc->base;
>  
> -	/* initialize shared scalers */
> -	if (INTEL_GEN(dev_priv) >= 9) {
> -		if (pipe == PIPE_C)
> -			intel_crtc->num_scalers = 1;
> -		else
> -			intel_crtc->num_scalers = SKL_NUM_SCALERS;
> -
> -		skl_init_scalers(dev_priv, intel_crtc, crtc_state);
> -	}
> -
>  	primary = intel_primary_plane_create(dev_priv, pipe);
>  	if (IS_ERR(primary)) {
>  		ret = PTR_ERR(primary);
> @@ -15348,6 +15343,9 @@ static int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
>  
>  	intel_crtc->wm.cxsr_allowed = true;
>  
> +	/* initialize shared scalers */
> +	skl_init_scalers(dev_priv, intel_crtc, crtc_state);

As this is now called by all, it really should be
intel_crtc_init_scalers() and we only need to pass intel_crtc at this
point.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-11-25  9:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 10:56 [PATCH] drm/i915: Moving scaler numbers to runtime init Nabendu Maiti
2016-11-22 10:52 ` Chris Wilson
2016-11-22 11:15 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-11-22 12:01 ` [PATCH] drm/i915: Moving no of scalers initialization " Nabendu Maiti
2016-11-22 15:35   ` Chris Wilson
2016-11-23 12:42     ` Maiti, Nabendu Bikash
2016-11-23 13:57       ` [PATCH] drm/i915: Move number " Nabendu Maiti
2016-11-25  9:46   ` Nabendu Maiti
2016-11-25  9:44     ` Chris Wilson [this message]
2016-11-25 10:32       ` Maiti, Nabendu Bikash
2016-11-29  5:53     ` [PATCH v3] " Nabendu Maiti
2016-12-26 11:00       ` Maiti, Nabendu Bikash
2017-01-02 13:00       ` Ander Conselvan De Oliveira
2017-01-02 13:04         ` Ander Conselvan De Oliveira
2017-01-02 13:21           ` Maiti, Nabendu Bikash
2017-01-02 13:45       ` Ander Conselvan De Oliveira
2016-11-22 12:15 ` ✓ Fi.CI.BAT: success for drm/i915: Moving scaler numbers to runtime init (rev2) Patchwork
2016-11-23 14:16 ` ✓ Fi.CI.BAT: success for drm/i915: Moving scaler numbers to runtime init (rev3) Patchwork
2016-11-25 10:45 ` ✓ Fi.CI.BAT: success for drm/i915: Moving scaler numbers to runtime init (rev4) Patchwork
2016-11-29  6:15 ` ✓ Fi.CI.BAT: success for drm/i915: Moving scaler numbers to runtime init (rev5) Patchwork
2016-11-29  9:14 ` ✗ Fi.CI.BAT: warning " Patchwork
2016-11-29  9:26   ` Saarinen, Jani
2016-11-29 10:10     ` Maiti, Nabendu Bikash
2016-11-29 10:14       ` Saarinen, Jani

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=20161125094430.GE26057@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=nabendu.bikash.maiti@intel.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 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.