All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Add initial_ prefix to bios fb takeover code
@ 2015-03-26 11:47 Daniel Vetter
  2015-03-26 11:47 ` [PATCH 2/2] drm/i915: always preserve bios swizzling Daniel Vetter
  2015-03-26 12:28 ` [PATCH 1/2] drm/i915: Add initial_ prefix to bios fb takeover code Damien Lespiau
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Vetter @ 2015-03-26 11:47 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

In spirit with

commit 5724dbd1678e2f573b13f0688277941fad66cb88
Author: Damien Lespiau <damien.lespiau@intel.com>
Date:   Tue Jan 20 12:51:52 2015 +0000

    drm/i915: Rename plane_config to initial_plane_config

to make it clear that this code is all special-purpose for the initial
plane takeover.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3b7c3491ea68..1142ffce66ea 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2508,8 +2508,8 @@ static int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
 }
 
 static bool
-intel_alloc_plane_obj(struct intel_crtc *crtc,
-		      struct intel_initial_plane_config *plane_config)
+intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
+			      struct intel_initial_plane_config *plane_config)
 {
 	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_gem_object *obj = NULL;
@@ -2553,7 +2553,7 @@ intel_alloc_plane_obj(struct intel_crtc *crtc,
 	obj->frontbuffer_bits = INTEL_FRONTBUFFER_PRIMARY(crtc->pipe);
 	mutex_unlock(&dev->struct_mutex);
 
-	DRM_DEBUG_KMS("plane fb obj %p\n", obj);
+	DRM_DEBUG_KMS("initial plane fb obj %p\n", obj);
 	return true;
 
 out_unref_obj:
@@ -2577,8 +2577,8 @@ update_state_fb(struct drm_plane *plane)
 }
 
 static void
-intel_find_plane_obj(struct intel_crtc *intel_crtc,
-		     struct intel_initial_plane_config *plane_config)
+intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
+			     struct intel_initial_plane_config *plane_config)
 {
 	struct drm_device *dev = intel_crtc->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2589,7 +2589,7 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc,
 	if (!plane_config->fb)
 		return;
 
-	if (intel_alloc_plane_obj(intel_crtc, plane_config)) {
+	if (intel_alloc_initial_plane_obj(intel_crtc, plane_config)) {
 		struct drm_plane *primary = intel_crtc->base.primary;
 
 		primary->fb = &plane_config->fb->base;
@@ -13572,7 +13572,7 @@ void intel_modeset_init(struct drm_device *dev)
 			 * If the fb is shared between multiple heads, we'll
 			 * just get the first one.
 			 */
-			intel_find_plane_obj(crtc, &crtc->plane_config);
+			intel_find_initial_plane_obj(crtc, &crtc->plane_config);
 		}
 	}
 }
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] drm/i915: always preserve bios swizzling
  2015-03-26 11:47 [PATCH 1/2] drm/i915: Add initial_ prefix to bios fb takeover code Daniel Vetter
@ 2015-03-26 11:47 ` Daniel Vetter
  2015-03-27  3:35   ` shuang.he
  2015-03-26 12:28 ` [PATCH 1/2] drm/i915: Add initial_ prefix to bios fb takeover code Damien Lespiau
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2015-03-26 11:47 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: Daniel Vetter, Kristian Høgsberg, Daniel Vetter

Currently we only set preserve_bios_swizzling when the initial fb is
shared and totally miss the single-screen case. Fix this by
consolidating all the logic for both cases.

This seems to go back to when swizzle preservation was originally
merged in

commit d9ceb8163339134bd3ffb9fb87a0db4698283e32
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Thu Oct 9 12:57:43 2014 -0700

    drm/i915: preserve swizzle settings if necessary v4

Cc: Kristian Høgsberg <hoegsberg@gmail.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 47 +++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1142ffce66ea..9d314f889613 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2543,14 +2543,11 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
 	mode_cmd.flags = DRM_MODE_FB_MODIFIERS;
 
 	mutex_lock(&dev->struct_mutex);
-
 	if (intel_framebuffer_init(dev, to_intel_framebuffer(fb),
 				   &mode_cmd, obj)) {
 		DRM_DEBUG_KMS("intel fb init failed\n");
 		goto out_unref_obj;
 	}
-
-	obj->frontbuffer_bits = INTEL_FRONTBUFFER_PRIMARY(crtc->pipe);
 	mutex_unlock(&dev->struct_mutex);
 
 	DRM_DEBUG_KMS("initial plane fb obj %p\n", obj);
@@ -2585,19 +2582,15 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 	struct drm_crtc *c;
 	struct intel_crtc *i;
 	struct drm_i915_gem_object *obj;
+	struct drm_plane *primary = intel_crtc->base.primary;
+	struct drm_framebuffer *fb;
 
 	if (!plane_config->fb)
 		return;
 
 	if (intel_alloc_initial_plane_obj(intel_crtc, plane_config)) {
-		struct drm_plane *primary = intel_crtc->base.primary;
-
-		primary->fb = &plane_config->fb->base;
-		primary->state->crtc = &intel_crtc->base;
-		primary->crtc = &intel_crtc->base;
-		update_state_fb(primary);
-
-		return;
+		fb = &plane_config->fb->base;
+		goto valid_fb;
 	}
 
 	kfree(plane_config->fb);
@@ -2615,25 +2608,29 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 		if (!i->active)
 			continue;
 
-		obj = intel_fb_obj(c->primary->fb);
-		if (obj == NULL)
+		fb = c->primary->fb;
+		if (!fb)
 			continue;
 
+		obj = intel_fb_obj(fb);
 		if (i915_gem_obj_ggtt_offset(obj) == plane_config->base) {
-			struct drm_plane *primary = intel_crtc->base.primary;
-
-			if (obj->tiling_mode != I915_TILING_NONE)
-				dev_priv->preserve_bios_swizzle = true;
-
-			drm_framebuffer_reference(c->primary->fb);
-			primary->fb = c->primary->fb;
-			primary->state->crtc = &intel_crtc->base;
-			primary->crtc = &intel_crtc->base;
-			update_state_fb(intel_crtc->base.primary);
-			obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
-			break;
+			drm_framebuffer_reference(fb);
+			goto valid_fb;
 		}
 	}
+
+	return;
+
+valid_fb:
+	obj = intel_fb_obj(fb);
+	if (obj->tiling_mode != I915_TILING_NONE)
+		dev_priv->preserve_bios_swizzle = true;
+
+	primary->fb = fb;
+	primary->state->crtc = &intel_crtc->base;
+	primary->crtc = &intel_crtc->base;
+	update_state_fb(primary);
+	obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 }
 
 static void i9xx_update_primary_plane(struct drm_crtc *crtc,
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] drm/i915: Add initial_ prefix to bios fb takeover code
  2015-03-26 11:47 [PATCH 1/2] drm/i915: Add initial_ prefix to bios fb takeover code Daniel Vetter
  2015-03-26 11:47 ` [PATCH 2/2] drm/i915: always preserve bios swizzling Daniel Vetter
@ 2015-03-26 12:28 ` Damien Lespiau
  1 sibling, 0 replies; 4+ messages in thread
From: Damien Lespiau @ 2015-03-26 12:28 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development

On Thu, Mar 26, 2015 at 12:47:15PM +0100, Daniel Vetter wrote:
> In spirit with
> 
> commit 5724dbd1678e2f573b13f0688277941fad66cb88
> Author: Damien Lespiau <damien.lespiau@intel.com>
> Date:   Tue Jan 20 12:51:52 2015 +0000
> 
>     drm/i915: Rename plane_config to initial_plane_config
> 
> to make it clear that this code is all special-purpose for the initial
> plane takeover.
> 
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 3b7c3491ea68..1142ffce66ea 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2508,8 +2508,8 @@ static int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
>  }
>  
>  static bool
> -intel_alloc_plane_obj(struct intel_crtc *crtc,
> -		      struct intel_initial_plane_config *plane_config)
> +intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
> +			      struct intel_initial_plane_config *plane_config)
>  {
>  	struct drm_device *dev = crtc->base.dev;
>  	struct drm_i915_gem_object *obj = NULL;
> @@ -2553,7 +2553,7 @@ intel_alloc_plane_obj(struct intel_crtc *crtc,
>  	obj->frontbuffer_bits = INTEL_FRONTBUFFER_PRIMARY(crtc->pipe);
>  	mutex_unlock(&dev->struct_mutex);
>  
> -	DRM_DEBUG_KMS("plane fb obj %p\n", obj);
> +	DRM_DEBUG_KMS("initial plane fb obj %p\n", obj);
>  	return true;
>  
>  out_unref_obj:
> @@ -2577,8 +2577,8 @@ update_state_fb(struct drm_plane *plane)
>  }
>  
>  static void
> -intel_find_plane_obj(struct intel_crtc *intel_crtc,
> -		     struct intel_initial_plane_config *plane_config)
> +intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> +			     struct intel_initial_plane_config *plane_config)
>  {
>  	struct drm_device *dev = intel_crtc->base.dev;
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -2589,7 +2589,7 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc,
>  	if (!plane_config->fb)
>  		return;
>  
> -	if (intel_alloc_plane_obj(intel_crtc, plane_config)) {
> +	if (intel_alloc_initial_plane_obj(intel_crtc, plane_config)) {
>  		struct drm_plane *primary = intel_crtc->base.primary;
>  
>  		primary->fb = &plane_config->fb->base;
> @@ -13572,7 +13572,7 @@ void intel_modeset_init(struct drm_device *dev)
>  			 * If the fb is shared between multiple heads, we'll
>  			 * just get the first one.
>  			 */
> -			intel_find_plane_obj(crtc, &crtc->plane_config);
> +			intel_find_initial_plane_obj(crtc, &crtc->plane_config);
>  		}
>  	}
>  }
> -- 
> 2.1.4
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] drm/i915: always preserve bios swizzling
  2015-03-26 11:47 ` [PATCH 2/2] drm/i915: always preserve bios swizzling Daniel Vetter
@ 2015-03-27  3:35   ` shuang.he
  0 siblings, 0 replies; 4+ messages in thread
From: shuang.he @ 2015-03-27  3:35 UTC (permalink / raw)
  To: shuang.he, ethan.gao, intel-gfx, daniel.vetter

Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6060
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                 -2              270/270              268/270
ILK                                  301/301              301/301
SNB                                  304/304              304/304
IVB                                  338/338              338/338
BYT                                  287/287              287/287
HSW                                  361/361              361/361
BDW                                  309/309              309/309
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
 PNV  igt@gen3_render_linear_blits      FAIL(1)PASS(1)      FAIL(2)
*PNV  igt@gem_fd_exhaustion      PASS(2)      NO_RESULT(1)PASS(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-27  3:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-26 11:47 [PATCH 1/2] drm/i915: Add initial_ prefix to bios fb takeover code Daniel Vetter
2015-03-26 11:47 ` [PATCH 2/2] drm/i915: always preserve bios swizzling Daniel Vetter
2015-03-27  3:35   ` shuang.he
2015-03-26 12:28 ` [PATCH 1/2] drm/i915: Add initial_ prefix to bios fb takeover code Damien Lespiau

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.