All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/9] drm/i915: Nuke ironlake_get_initial_plane_config()
Date: Thu, 12 Oct 2017 21:17:40 +0200	[thread overview]
Message-ID: <20171012191740.m2n6vho4zryvvtwc@phenom.ffwll.local> (raw)
In-Reply-To: <20171011160455.1874-7-ville.syrjala@linux.intel.com>

On Wed, Oct 11, 2017 at 07:04:52PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The only relevant difference between i9xx_get_initial_plane_config() and
> ironlake_get_initial_plane_config() is the HSW/BDW TILEOFF handling.
> Add that to i9xx_get_initial_plane_config() and nuke
> ironlake_get_initial_plane_config().
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

I'm still kinda wanting some way to test this here with every modeset, but
still can't come up with something simple&neat.

> ---
>  drivers/gpu/drm/i915/intel_display.c | 79 +++---------------------------------
>  1 file changed, 6 insertions(+), 73 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 21160a06ab36..82be2342d1c6 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7490,7 +7490,10 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
>  	fourcc = i9xx_format_to_fourcc(pixel_format);
>  	fb->format = drm_format_info(fourcc);
>  
> -	if (INTEL_GEN(dev_priv) >= 4) {
> +	if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
> +		offset = I915_READ(DSPOFFSET(plane_id));
> +		base = I915_READ(DSPSURF(plane_id)) & 0xfffff000;
> +	} else if (INTEL_GEN(dev_priv) >= 4) {
>  		if (plane_config->tiling)
>  			offset = I915_READ(DSPTILEOFF(plane_id));
>  		else
> @@ -8592,76 +8595,6 @@ static void ironlake_get_pfit_config(struct intel_crtc *crtc,
>  	}
>  }
>  
> -static void
> -ironlake_get_initial_plane_config(struct intel_crtc *crtc,
> -				  struct intel_initial_plane_config *plane_config)
> -{
> -	struct drm_device *dev = crtc->base.dev;
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> -	struct intel_plane *plane = to_intel_plane(crtc->base.primary);
> -	enum old_plane_id plane_id = plane->plane;
> -	enum pipe pipe = crtc->pipe;
> -	u32 val, base, offset;
> -	int fourcc, pixel_format;
> -	unsigned int aligned_height;
> -	struct drm_framebuffer *fb;
> -	struct intel_framebuffer *intel_fb;
> -
> -	val = I915_READ(DSPCNTR(plane_id));
> -	if (!(val & DISPLAY_PLANE_ENABLE))

Hm, should we use plane->get_hw_state to take out this check? At least to
partially get close to the hw state readout approach we have for
crtc/encoders/connectors.

Aside form these two notes, patch itself looks good.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> -		return;
> -
> -	intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
> -	if (!intel_fb) {
> -		DRM_DEBUG_KMS("failed to alloc fb\n");
> -		return;
> -	}
> -
> -	fb = &intel_fb->base;
> -
> -	fb->dev = dev;
> -
> -	if (INTEL_GEN(dev_priv) >= 4) {
> -		if (val & DISPPLANE_TILED) {
> -			plane_config->tiling = I915_TILING_X;
> -			fb->modifier = I915_FORMAT_MOD_X_TILED;
> -		}
> -	}
> -
> -	pixel_format = val & DISPPLANE_PIXFORMAT_MASK;
> -	fourcc = i9xx_format_to_fourcc(pixel_format);
> -	fb->format = drm_format_info(fourcc);
> -
> -	base = I915_READ(DSPSURF(plane_id)) & 0xfffff000;
> -	if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
> -		offset = I915_READ(DSPOFFSET(plane_id));
> -	} else {
> -		if (plane_config->tiling)
> -			offset = I915_READ(DSPTILEOFF(plane_id));
> -		else
> -			offset = I915_READ(DSPLINOFF(plane_id));
> -	}
> -	plane_config->base = base;
> -
> -	val = I915_READ(PIPESRC(pipe));
> -	fb->width = ((val >> 16) & 0xfff) + 1;
> -	fb->height = ((val >> 0) & 0xfff) + 1;
> -
> -	val = I915_READ(DSPSTRIDE(plane_id));
> -	fb->pitches[0] = val & 0xffffffc0;
> -
> -	aligned_height = intel_fb_align_height(fb, 0, fb->height);
> -
> -	plane_config->size = fb->pitches[0] * aligned_height;
> -
> -	DRM_DEBUG_KMS("%s/%s with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n",
> -		      crtc->base.name, plane->base.name, fb->width, fb->height,
> -		      fb->format->cpp[0] * 8, base, fb->pitches[0],
> -		      plane_config->size);
> -
> -	plane_config->fb = intel_fb;
> -}
> -
>  static bool ironlake_get_pipe_config(struct intel_crtc *crtc,
>  				     struct intel_crtc_state *pipe_config)
>  {
> @@ -14140,7 +14073,7 @@ void intel_init_display_hooks(struct drm_i915_private *dev_priv)
>  	} else if (HAS_DDI(dev_priv)) {
>  		dev_priv->display.get_pipe_config = haswell_get_pipe_config;
>  		dev_priv->display.get_initial_plane_config =
> -			ironlake_get_initial_plane_config;
> +			i9xx_get_initial_plane_config;
>  		dev_priv->display.crtc_compute_clock =
>  			haswell_crtc_compute_clock;
>  		dev_priv->display.crtc_enable = haswell_crtc_enable;
> @@ -14148,7 +14081,7 @@ void intel_init_display_hooks(struct drm_i915_private *dev_priv)
>  	} else if (HAS_PCH_SPLIT(dev_priv)) {
>  		dev_priv->display.get_pipe_config = ironlake_get_pipe_config;
>  		dev_priv->display.get_initial_plane_config =
> -			ironlake_get_initial_plane_config;
> +			i9xx_get_initial_plane_config;
>  		dev_priv->display.crtc_compute_clock =
>  			ironlake_crtc_compute_clock;
>  		dev_priv->display.crtc_enable = ironlake_crtc_enable;
> -- 
> 2.13.6
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-10-12 19:17 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 16:04 [PATCH 0/9] drm/i915: Plane assert/readout cleanups etc Ville Syrjala
2017-10-11 16:04 ` [PATCH 1/9] drm/i915: Add .get_hw_state() method for planes Ville Syrjala
2017-10-12 18:59   ` Daniel Vetter
2017-10-13 10:31     ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 2/9] drm/i915: Redo plane sanitation during readout Ville Syrjala
2017-10-12 19:03   ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 3/9] drm/i915: s/enum plane/enum old_plane_id/ Ville Syrjala
2017-10-12 19:06   ` Daniel Vetter
2017-10-13 10:35     ` Ville Syrjälä
2017-10-16 15:57       ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 4/9] drm/i915: Use enum old_plane_id for the .get_fifo_size() hooks Ville Syrjala
2017-10-12 19:08   ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 5/9] drm/i915: Cleanup enum pipe/enum plane_id/enum old_plane_id in initial fb readout Ville Syrjala
2017-10-12 19:11   ` Daniel Vetter
2017-10-11 16:04 ` [PATCH 6/9] drm/i915: Nuke ironlake_get_initial_plane_config() Ville Syrjala
2017-10-12 19:17   ` Daniel Vetter [this message]
2017-10-13 10:36     ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 7/9] drm/i915: Switch fbc over to for_each_new_intel_plane_in_state() Ville Syrjala
2017-10-12 19:21   ` Daniel Vetter
2017-10-13 10:38     ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 8/9] drm/i915: Nuke crtc->plane Ville Syrjala
2017-10-12 19:38   ` Daniel Vetter
2017-10-13 10:41     ` Ville Syrjälä
2017-10-11 16:04 ` [PATCH 9/9] drm/i915: Add windowing for primary planes on gen2/3 and chv Ville Syrjala
2017-10-12 19:42   ` Daniel Vetter
2017-10-11 16:21 ` [PATCH 0/9] drm/i915: Plane assert/readout cleanups etc Alex Villacis Lasso
2017-10-11 16:38   ` Ville Syrjälä
2017-10-13 16:28     ` Alex Villacis Lasso
     [not found]     ` <c5c1b3e5-4640-9df7-45a7-4228802142f9@hotmail.com>
2017-10-14  6:45       ` Alex Villacis Lasso
2017-10-16 14:55         ` Jani Nikula
2017-10-16 15:13         ` Alex Villacís Lasso
2017-10-11 17:20 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-11 23:43 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-12 11:35 ` [PATCH 0/9] " Thierry Reding
2017-10-12 12:19   ` Ville Syrjälä
2017-10-12 13:29     ` 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=20171012191740.m2n6vho4zryvvtwc@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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.