All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] i915 fb modifier support, respun
@ 2015-02-09 18:03 Daniel Vetter
  2015-02-09 18:03 ` [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers Daniel Vetter
                   ` (5 more replies)
  0 siblings, 6 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-09 18:03 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, DRI Development

Hi all,

So this is the very quickly spun together version for my take on fb modifiers.
Aim is to reduce the churn a bit with:
- Only validate fb modifiers and old tiling_mode behaviour in framebuffer_init
  to ensure they are consistent. Don't convert over all the code for old
  platforms.
- Guarantee that X-tiling always implies that the underlying bo is fenced with
  X-tiling mode, too. Otherwise the implications into existing code (e.g.
  adjusting fbc) are a bit too much.
- One draft patch to show how I think we should us fb modifiers: Directly switch
  on them like we do with obj->tiling_mode, no need to have remap/masking
  functions around. At least for now.

This isn't complete since some of the shared code, specifically the fb_align
stuff used by framebuffer_init and the fbdev emulation code still uses
obj->tiling_mode. That needs to be converted into a function which takes u64 fb
modifers (for shared code) and the old code retained in an i9xx_ variant (for
the plane_config readout code for old platforms). Then we can add the skl+ stuff
in another version, together with a if/else.

And then framebuffer_init obvsiouly needs to be extended.

Commments highly welcome.

Cheers, Daniel

Daniel Vetter (3):
  drm/i915: Add fb format modifier support
  drm/i915: Use fb format modifiers in skylake_update_primary_plane
  drm: Also check unused fields for addfb2

Tvrtko Ursulin (2):
  drm/i915: Add tiled framebuffer modifiers
  drm/i915: Announce support for framebuffer modifiers

 drivers/gpu/drm/drm_crtc.c           | 17 +++++++++++++++++
 drivers/gpu/drm/i915/i915_drv.h      |  1 +
 drivers/gpu/drm/i915/intel_display.c | 32 ++++++++++++++++++++++++--------
 include/uapi/drm/drm_fourcc.h        | 31 +++++++++++++++++++++++++++++++
 4 files changed, 73 insertions(+), 8 deletions(-)

-- 
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] 42+ messages in thread

* [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers
  2015-02-09 18:03 [PATCH 0/5] i915 fb modifier support, respun Daniel Vetter
@ 2015-02-09 18:03 ` Daniel Vetter
  2015-02-10 11:05   ` Tvrtko Ursulin
                     ` (2 more replies)
  2015-02-09 18:03 ` [PATCH 2/5] " Daniel Vetter
                   ` (4 subsequent siblings)
  5 siblings, 3 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-09 18:03 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, DRI Development, Tvrtko Ursulin

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

To be used from the new addfb2 extension.

v2:
- Drop Intel-specific untiled modfier.
- Move to drm_fourcc.h.
- Document layouts a bit and denote them as platform-specific and not
  useable for cross-driver sharing.
- Add Y-tiling for completeness.
- Drop special docstring markers to avoid confusing kerneldoc.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v2)
---
 drivers/gpu/drm/i915/i915_drv.h |  1 +
 include/uapi/drm/drm_fourcc.h   | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 217845951b7f..a027a983c82b 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -31,6 +31,7 @@
 #define _I915_DRV_H_
 
 #include <uapi/drm/i915_drm.h>
+#include <uapi/drm/drm_fourcc.h>
 
 #include "i915_reg.h"
 #include "intel_bios.h"
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 622109677747..886814c6f9d2 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -164,4 +164,35 @@
  * authoritative source for all of these.
  */
 
+/* Intel framebuffer modifiers */
+
+/*
+ * Intel X-tiling layout
+ *
+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
+ * in row-major layout. Within the tile bytes are laid out row-major, with
+ * a platform-dependent stride. On top of that the memory can apply
+ * platform-depending swizzling of some higher address bits into bit6.
+ *
+ * This format is highly platforms specific and not useful for cross-driver
+ * sharing. It exists since on a given platform it does uniquely identify the
+ * layout in a simple way for i915-specific userspace.
+ */
+#define I915_FORMAT_MOD_X_TILED	fourcc_mod_code(INTEL, 1)
+
+/*
+ * Intel Y-tiling layout
+ *
+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
+ * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes)
+ * chunks column-major, with a platform-dependent height. On top of that the
+ * memory can apply platform-depending swizzling of some higher address bits
+ * into bit6.
+ *
+ * This format is highly platforms specific and not useful for cross-driver
+ * sharing. It exists since on a given platform it does uniquely identify the
+ * layout in a simple way for i915-specific userspace.
+ */
+#define I915_FORMAT_MOD_Y_TILED	fourcc_mod_code(INTEL, 1)
+
 #endif /* DRM_FOURCC_H */
-- 
2.1.4

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

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

* [PATCH 2/5] drm/i915: Add fb format modifier support
  2015-02-09 18:03 [PATCH 0/5] i915 fb modifier support, respun Daniel Vetter
  2015-02-09 18:03 ` [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers Daniel Vetter
@ 2015-02-09 18:03 ` Daniel Vetter
  2015-02-10 11:09   ` Tvrtko Ursulin
  2015-02-10 11:28   ` [PATCH] " Daniel Vetter
  2015-02-09 18:03 ` [PATCH 3/5] drm/i915: Use fb format modifiers in skylake_update_primary_plane Daniel Vetter
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-09 18:03 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter, DRI Development

Currently we don't support anything but X tiled. And for an easier
transition it makes a lot of sense to just keep requiring that X tiled
is properly fenced.

Which means we need to do absolutely nothing in old code to support fb
modifiers, yay!

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3fe95982be93..2d69cce03ab5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12707,7 +12707,20 @@ static int intel_framebuffer_init(struct drm_device *dev,
 
 	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
-	if (obj->tiling_mode == I915_TILING_Y) {
+	if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) {
+		/* Enforce that fb modifier and tiling mode match, but only for
+		 * X-tiled. */
+		if (!!(obj->tiling_mode == I915_TILING_X) !=
+		    !!(mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)) {
+			DRM_DEBUG("tiling_mode doesn't match fb modifier\n");
+			return -EINVAL;
+		}
+	} else {
+		if (obj->tiling_mode == I915_TILING_X)
+			mode_cmd->modifier[0] = I915_FORMAT_MOD_X_TILED;
+	}
+
+	if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED) {
 		DRM_DEBUG("hardware does not support tiling Y\n");
 		return -EINVAL;
 	}
@@ -12721,12 +12734,12 @@ static int intel_framebuffer_init(struct drm_device *dev,
 	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev)) {
 		pitch_limit = 32*1024;
 	} else if (INTEL_INFO(dev)->gen >= 4) {
-		if (obj->tiling_mode)
+		if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)
 			pitch_limit = 16*1024;
 		else
 			pitch_limit = 32*1024;
 	} else if (INTEL_INFO(dev)->gen >= 3) {
-		if (obj->tiling_mode)
+		if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)
 			pitch_limit = 8*1024;
 		else
 			pitch_limit = 16*1024;
@@ -12736,12 +12749,13 @@ static int intel_framebuffer_init(struct drm_device *dev,
 
 	if (mode_cmd->pitches[0] > pitch_limit) {
 		DRM_DEBUG("%s pitch (%d) must be at less than %d\n",
-			  obj->tiling_mode ? "tiled" : "linear",
+			  mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED ?
+			  "tiled" : "linear",
 			  mode_cmd->pitches[0], pitch_limit);
 		return -EINVAL;
 	}
 
-	if (obj->tiling_mode != I915_TILING_NONE &&
+	if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED &&
 	    mode_cmd->pitches[0] != obj->stride) {
 		DRM_DEBUG("pitch (%d) must match tiling stride (%d)\n",
 			  mode_cmd->pitches[0], obj->stride);
-- 
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] 42+ messages in thread

* [PATCH 3/5] drm/i915: Use fb format modifiers in skylake_update_primary_plane
  2015-02-09 18:03 [PATCH 0/5] i915 fb modifier support, respun Daniel Vetter
  2015-02-09 18:03 ` [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers Daniel Vetter
  2015-02-09 18:03 ` [PATCH 2/5] " Daniel Vetter
@ 2015-02-09 18:03 ` Daniel Vetter
  2015-02-10 16:25   ` Damien Lespiau
  2015-02-09 18:03 ` [PATCH 4/5] drm/i915: Announce support for framebuffer modifiers Daniel Vetter
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 42+ messages in thread
From: Daniel Vetter @ 2015-02-09 18:03 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: Daniel Vetter, Daniel Vetter, DRI Development, Tvrtko Ursulin

Just a little demo really. We probably need to introduce skl specific
functions for a lot of the format validation stuff, or at least
helpers. Specifically I think intel_framebuffer_init and
intel_fb_align_height must be adjusted to have an i915_ and a skl_
variant. And only shared code should be converted to fb modifiers,
platform code (like the plane config readout can keep on using old
tiling_mode defines to avoid some churn).

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2d69cce03ab5..41b3ddc4068d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2773,11 +2773,11 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,
 	 * The stride is either expressed as a multiple of 64 bytes chunks for
 	 * linear buffers or in number of tiles for tiled buffers.
 	 */
-	switch (obj->tiling_mode) {
-	case I915_TILING_NONE:
+	switch (fb->modifier[0]) {
+	case DRM_FORMAT_MOD_NONE:
 		stride = fb->pitches[0] >> 6;
 		break;
-	case I915_TILING_X:
+	case I915_FORMAT_MOD_X_TILED:
 		plane_ctl |= PLANE_CTL_TILED_X;
 		stride = fb->pitches[0] >> 9;
 		break;
-- 
2.1.4

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

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

* [PATCH 4/5] drm/i915: Announce support for framebuffer modifiers
  2015-02-09 18:03 [PATCH 0/5] i915 fb modifier support, respun Daniel Vetter
                   ` (2 preceding siblings ...)
  2015-02-09 18:03 ` [PATCH 3/5] drm/i915: Use fb format modifiers in skylake_update_primary_plane Daniel Vetter
@ 2015-02-09 18:03 ` Daniel Vetter
  2015-02-09 18:03 ` [PATCH 5/5] drm: Also check unused fields for addfb2 Daniel Vetter
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
  5 siblings, 0 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-09 18:03 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, DRI Development

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Let the DRM core know we can handle it.

v2: Change to boolean true. (Daniel Vetter)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 41b3ddc4068d..e96d0c75f89c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13214,6 +13214,8 @@ void intel_modeset_init(struct drm_device *dev)
 	dev->mode_config.preferred_depth = 24;
 	dev->mode_config.prefer_shadow = 1;
 
+	dev->mode_config.allow_fb_modifiers = true;
+
 	dev->mode_config.funcs = &intel_mode_funcs;
 
 	intel_init_quirks(dev);
-- 
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] 42+ messages in thread

* [PATCH 5/5] drm: Also check unused fields for addfb2
  2015-02-09 18:03 [PATCH 0/5] i915 fb modifier support, respun Daniel Vetter
                   ` (3 preceding siblings ...)
  2015-02-09 18:03 ` [PATCH 4/5] drm/i915: Announce support for framebuffer modifiers Daniel Vetter
@ 2015-02-09 18:03 ` Daniel Vetter
  2015-02-10 10:56   ` [PATCH 1/2] drm/i915: Set up fb format modifier for initial plane config Daniel Vetter
  2015-02-10 11:01   ` [PATCH 5/5] drm: Also check unused fields for addfb2 Chris Wilson
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
  5 siblings, 2 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-09 18:03 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, DRI Development, Daniel Vetter

Just the usual paranoia ...

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_crtc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index b15d720eda4c..a12d7e8a0ca0 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3322,6 +3322,23 @@ static int framebuffer_check(const struct drm_mode_fb_cmd2 *r)
 		}
 	}
 
+	for (; i < 4; i++) {
+		if (r->handles[i]) {
+			DRM_DEBUG_KMS("buffer object handle for unused plane %d\n", i);
+			return -EINVAL;
+		}
+
+		if (r->pitches[i] || r->offsets[i]) {
+			DRM_DEBUG_KMS("buffer pitch/offset for unused plane", i);
+			return -EINVAL;
+		}
+
+		if (r->modifier[i]) {
+			DRM_DEBUG_KMS("fb modifer for unused plane", i);
+			return -EINVAL;
+		}
+	}
+
 	return 0;
 }
 
-- 
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] 42+ messages in thread

* [PATCH 1/2] drm/i915: Set up fb format modifier for initial plane config
  2015-02-09 18:03 ` [PATCH 5/5] drm: Also check unused fields for addfb2 Daniel Vetter
@ 2015-02-10 10:56   ` Daniel Vetter
  2015-02-10 10:56     ` [PATCH 2/2] drm/i915: Switch +intel_fb_align_height to fb format modifiers Daniel Vetter
  2015-02-10 11:01   ` [PATCH 5/5] drm: Also check unused fields for addfb2 Chris Wilson
  1 sibling, 1 reply; 42+ messages in thread
From: Daniel Vetter @ 2015-02-10 10:56 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, DRI Development, Daniel Vetter

No functional changes yet since intel_framebuffer_init would have
fixed this up for us. But this is prep work to be able to handle new
tiling layouts in the initial plane config code.

Follow-up patches will start to make use of this and switch over to fb
modifiers where needed.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e96d0c75f89c..e2c70f24c841 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2390,6 +2390,8 @@ intel_alloc_plane_obj(struct intel_crtc *crtc,
 	mode_cmd.width = fb->width;
 	mode_cmd.height = fb->height;
 	mode_cmd.pitches[0] = fb->pitches[0];
+	mode_cmd.modifier[0] = fb->modifier[0];
+	mode_cmd.flags = DRM_MODE_FB_MODIFIERS;
 
 	mutex_lock(&dev->struct_mutex);
 
@@ -6625,9 +6627,12 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
 
 	fb = &intel_fb->base;
 
-	if (INTEL_INFO(dev)->gen >= 4)
-		if (val & DISPPLANE_TILED)
+	if (INTEL_INFO(dev)->gen >= 4) {
+		if (val & DISPPLANE_TILED) {
 			plane_config->tiling = I915_TILING_X;
+			fb->modifier[0] = I915_FORMAT_MOD_X_TILED;
+		}
+	}
 
 	pixel_format = val & DISPPLANE_PIXFORMAT_MASK;
 	fourcc = i9xx_format_to_fourcc(pixel_format);
@@ -7659,8 +7664,10 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
 	if (!(val & PLANE_CTL_ENABLE))
 		goto error;
 
-	if (val & PLANE_CTL_TILED_MASK)
+	if (val & PLANE_CTL_TILED_MASK) {
 		plane_config->tiling = I915_TILING_X;
+		fb->modifier[0] = I915_FORMAT_MOD_X_TILED;
+	}
 
 	pixel_format = val & PLANE_CTL_FORMAT_MASK;
 	fourcc = skl_format_to_fourcc(pixel_format,
@@ -7758,9 +7765,12 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc,
 
 	fb = &intel_fb->base;
 
-	if (INTEL_INFO(dev)->gen >= 4)
-		if (val & DISPPLANE_TILED)
+	if (INTEL_INFO(dev)->gen >= 4) {
+		if (val & DISPPLANE_TILED) {
 			plane_config->tiling = I915_TILING_X;
+			fb->modifier[0] = I915_FORMAT_MOD_X_TILED;
+		}
+	}
 
 	pixel_format = val & DISPPLANE_PIXFORMAT_MASK;
 	fourcc = i9xx_format_to_fourcc(pixel_format);
-- 
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] 42+ messages in thread

* [PATCH 2/2] drm/i915: Switch +intel_fb_align_height to fb format modifiers
  2015-02-10 10:56   ` [PATCH 1/2] drm/i915: Set up fb format modifier for initial plane config Daniel Vetter
@ 2015-02-10 10:56     ` Daniel Vetter
  0 siblings, 0 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-10 10:56 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, DRI Development, Daniel Vetter

With this we can treat the fb format modifier completely independently
from the fencing mode in obj->tiling_mode in the initial plane code.
Which means new tiling modes without any gtt fence are now fully
support in the core i915 driver code.

v2: Also add pixel_format while at it, we need this to compute the
height for the new tiling formats.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++------
 drivers/gpu/drm/i915/intel_drv.h     |  3 ++-
 drivers/gpu/drm/i915/intel_fbdev.c   |  3 ++-
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e2c70f24c841..56e4a66e0683 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2190,11 +2190,15 @@ static bool need_vtd_wa(struct drm_device *dev)
 }
 
 int
-intel_fb_align_height(struct drm_device *dev, int height, unsigned int tiling)
+intel_fb_align_height(struct drm_device *dev, int height,
+		      uint32_t pixel_format,
+		      uint64_t fb_format_modifier)
 {
 	int tile_height;
 
-	tile_height = tiling ? (IS_GEN2(dev) ? 16 : 8) : 1;
+	tile_height = fb_format_modifier == I915_FORMAT_MOD_X_TILED ?
+		(IS_GEN2(dev) ? 16 : 8) : 1;
+
 	return ALIGN(height, tile_height);
 }
 
@@ -6658,7 +6662,8 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
 	fb->pitches[0] = val & 0xffffffc0;
 
 	aligned_height = intel_fb_align_height(dev, fb->height,
-					       plane_config->tiling);
+					       fb->pixel_format,
+					       fb->modifier[0]);
 
 	plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height);
 
@@ -7700,7 +7705,8 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
 	fb->pitches[0] = (val & 0x3ff) * stride_mult;
 
 	aligned_height = intel_fb_align_height(dev, fb->height,
-					       plane_config->tiling);
+					       fb->pixel_format,
+					       fb->modifier[0]);
 
 	plane_config->size = ALIGN(fb->pitches[0] * aligned_height, PAGE_SIZE);
 
@@ -7796,7 +7802,8 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc,
 	fb->pitches[0] = val & 0xffffffc0;
 
 	aligned_height = intel_fb_align_height(dev, fb->height,
-					       plane_config->tiling);
+					       fb->pixel_format,
+					       fb->modifier[0]);
 
 	plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height);
 
@@ -12820,7 +12827,8 @@ static int intel_framebuffer_init(struct drm_device *dev,
 		return -EINVAL;
 
 	aligned_height = intel_fb_align_height(dev, mode_cmd->height,
-					       obj->tiling_mode);
+					       mode_cmd->pixel_format,
+					       mode_cmd->modifier[0]);
 	/* FIXME drm helper for size checks (especially planar formats)? */
 	if (obj->base.size < aligned_height * mode_cmd->pitches[0])
 		return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 76b3c2043954..b9598ba6901c 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -879,7 +879,8 @@ void intel_frontbuffer_flip(struct drm_device *dev,
 }
 
 int intel_fb_align_height(struct drm_device *dev, int height,
-			  unsigned int tiling);
+			  uint32_t pixel_format,
+			  uint64_t fb_format_modifier);
 void intel_fb_obj_flush(struct drm_i915_gem_object *obj, bool retire);
 
 
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 3001a8674611..234a699b8219 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -594,7 +594,8 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
 
 		cur_size = intel_crtc->config->base.adjusted_mode.crtc_vdisplay;
 		cur_size = intel_fb_align_height(dev, cur_size,
-						 plane_config->tiling);
+						 fb->base.pixel_format,
+						 fb->base.modifier[0]);
 		cur_size *= fb->base.pitches[0];
 		DRM_DEBUG_KMS("pipe %c area: %dx%d, bpp: %d, size: %d\n",
 			      pipe_name(intel_crtc->pipe),
-- 
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] 42+ messages in thread

* Re: [PATCH 5/5] drm: Also check unused fields for addfb2
  2015-02-09 18:03 ` [PATCH 5/5] drm: Also check unused fields for addfb2 Daniel Vetter
  2015-02-10 10:56   ` [PATCH 1/2] drm/i915: Set up fb format modifier for initial plane config Daniel Vetter
@ 2015-02-10 11:01   ` Chris Wilson
  2015-02-10 11:36     ` Daniel Vetter
  1 sibling, 1 reply; 42+ messages in thread
From: Chris Wilson @ 2015-02-10 11:01 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Mon, Feb 09, 2015 at 07:03:28PM +0100, Daniel Vetter wrote:
> Just the usual paranoia ...
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_crtc.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index b15d720eda4c..a12d7e8a0ca0 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -3322,6 +3322,23 @@ static int framebuffer_check(const struct drm_mode_fb_cmd2 *r)
>  		}
>  	}
>  
> +	for (; i < 4; i++) {
> +		if (r->handles[i]) {
> +			DRM_DEBUG_KMS("buffer object handle for unused plane %d\n", i);

Printing the invalid value is also useful. We tended to put user
debugging messages as DRM_DEBUG(); would probably be useful to add
DRM_DEBUG_USER() and clean up all the EINVAL reporting.
-Chris

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

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

* Re: [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers
  2015-02-09 18:03 ` [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers Daniel Vetter
@ 2015-02-10 11:05   ` Tvrtko Ursulin
  2015-02-10 11:28   ` [PATCH] " Daniel Vetter
  2015-02-10 11:50   ` [PATCH] drm/i915: Add fb format modifier support Daniel Vetter
  2 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 11:05 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics Development; +Cc: DRI Development


On 02/09/2015 06:03 PM, Daniel Vetter wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> To be used from the new addfb2 extension.
>
> v2:
> - Drop Intel-specific untiled modfier.
> - Move to drm_fourcc.h.
> - Document layouts a bit and denote them as platform-specific and not
>    useable for cross-driver sharing.
> - Add Y-tiling for completeness.
> - Drop special docstring markers to avoid confusing kerneldoc.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v2)
> ---
>   drivers/gpu/drm/i915/i915_drv.h |  1 +
>   include/uapi/drm/drm_fourcc.h   | 31 +++++++++++++++++++++++++++++++
>   2 files changed, 32 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 217845951b7f..a027a983c82b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -31,6 +31,7 @@
>   #define _I915_DRV_H_
>
>   #include <uapi/drm/i915_drm.h>
> +#include <uapi/drm/drm_fourcc.h>
>
>   #include "i915_reg.h"
>   #include "intel_bios.h"
> diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
> index 622109677747..886814c6f9d2 100644
> --- a/include/uapi/drm/drm_fourcc.h
> +++ b/include/uapi/drm/drm_fourcc.h
> @@ -164,4 +164,35 @@
>    * authoritative source for all of these.
>    */
>
> +/* Intel framebuffer modifiers */
> +
> +/*
> + * Intel X-tiling layout
> + *
> + * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
> + * in row-major layout. Within the tile bytes are laid out row-major, with
> + * a platform-dependent stride. On top of that the memory can apply
> + * platform-depending swizzling of some higher address bits into bit6.
> + *
> + * This format is highly platforms specific and not useful for cross-driver
> + * sharing. It exists since on a given platform it does uniquely identify the
> + * layout in a simple way for i915-specific userspace.
> + */
> +#define I915_FORMAT_MOD_X_TILED	fourcc_mod_code(INTEL, 1)
> +
> +/*
> + * Intel Y-tiling layout
> + *
> + * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
> + * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes)
> + * chunks column-major, with a platform-dependent height. On top of that the
> + * memory can apply platform-depending swizzling of some higher address bits
> + * into bit6.
> + *
> + * This format is highly platforms specific and not useful for cross-driver
> + * sharing. It exists since on a given platform it does uniquely identify the
> + * layout in a simple way for i915-specific userspace.
> + */
> +#define I915_FORMAT_MOD_Y_TILED	fourcc_mod_code(INTEL, 1)

X was one, so this could be two.

Regards,

Tvrtko


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

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

* Re: [PATCH 2/5] drm/i915: Add fb format modifier support
  2015-02-09 18:03 ` [PATCH 2/5] " Daniel Vetter
@ 2015-02-10 11:09   ` Tvrtko Ursulin
  2015-02-10 11:28   ` [PATCH] " Daniel Vetter
  1 sibling, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 11:09 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics Development; +Cc: Daniel Vetter, DRI Development


On 02/09/2015 06:03 PM, Daniel Vetter wrote:
> Currently we don't support anything but X tiled. And for an easier
> transition it makes a lot of sense to just keep requiring that X tiled
> is properly fenced.
>
> Which means we need to do absolutely nothing in old code to support fb
> modifiers, yay!
>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_display.c | 24 +++++++++++++++++++-----
>   1 file changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 3fe95982be93..2d69cce03ab5 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12707,7 +12707,20 @@ static int intel_framebuffer_init(struct drm_device *dev,
>
>   	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
>
> -	if (obj->tiling_mode == I915_TILING_Y) {
> +	if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) {
> +		/* Enforce that fb modifier and tiling mode match, but only for
> +		 * X-tiled. */
> +		if (!!(obj->tiling_mode == I915_TILING_X) !=
> +		    !!(mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)) {
> +			DRM_DEBUG("tiling_mode doesn't match fb modifier\n");
> +			return -EINVAL;
> +		}
> +	} else {
> +		if (obj->tiling_mode == I915_TILING_X)
> +			mode_cmd->modifier[0] = I915_FORMAT_MOD_X_TILED;
> +	}
> +
> +	if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED) {
>   		DRM_DEBUG("hardware does not support tiling Y\n");
>   		return -EINVAL;

== I915_FORMAT_MOD_Y_TILED, although it can't really happen with these 
changes. But don't we still need the check against obj->tiling_mode for Y?

Regards,

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

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

* [PATCH] drm/i915: Add tiled framebuffer modifiers
  2015-02-09 18:03 ` [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers Daniel Vetter
  2015-02-10 11:05   ` Tvrtko Ursulin
@ 2015-02-10 11:28   ` Daniel Vetter
  2015-02-10 16:16     ` shuang.he
  2015-02-10 11:50   ` [PATCH] drm/i915: Add fb format modifier support Daniel Vetter
  2 siblings, 1 reply; 42+ messages in thread
From: Daniel Vetter @ 2015-02-10 11:28 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, DRI Development, Tvrtko Ursulin

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

To be used from the new addfb2 extension.

v2:
- Drop Intel-specific untiled modfier.
- Move to drm_fourcc.h.
- Document layouts a bit and denote them as platform-specific and not
  useable for cross-driver sharing.
- Add Y-tiling for completeness.
- Drop special docstring markers to avoid confusing kerneldoc.

v3: Give Y-tiling a unique idea, noticed by Tvrtko.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v1)
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_drv.h |  1 +
 include/uapi/drm/drm_fourcc.h   | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 3da3dc527315..99b25928df2f 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -31,6 +31,7 @@
 #define _I915_DRV_H_
 
 #include <uapi/drm/i915_drm.h>
+#include <uapi/drm/drm_fourcc.h>
 
 #include "i915_reg.h"
 #include "intel_bios.h"
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 622109677747..4837c3d2319a 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -164,4 +164,35 @@
  * authoritative source for all of these.
  */
 
+/* Intel framebuffer modifiers */
+
+/*
+ * Intel X-tiling layout
+ *
+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
+ * in row-major layout. Within the tile bytes are laid out row-major, with
+ * a platform-dependent stride. On top of that the memory can apply
+ * platform-depending swizzling of some higher address bits into bit6.
+ *
+ * This format is highly platforms specific and not useful for cross-driver
+ * sharing. It exists since on a given platform it does uniquely identify the
+ * layout in a simple way for i915-specific userspace.
+ */
+#define I915_FORMAT_MOD_X_TILED	fourcc_mod_code(INTEL, 1)
+
+/*
+ * Intel Y-tiling layout
+ *
+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
+ * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes)
+ * chunks column-major, with a platform-dependent height. On top of that the
+ * memory can apply platform-depending swizzling of some higher address bits
+ * into bit6.
+ *
+ * This format is highly platforms specific and not useful for cross-driver
+ * sharing. It exists since on a given platform it does uniquely identify the
+ * layout in a simple way for i915-specific userspace.
+ */
+#define I915_FORMAT_MOD_Y_TILED	fourcc_mod_code(INTEL, 2)
+
 #endif /* DRM_FOURCC_H */
-- 
2.1.4

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

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

* [PATCH] drm/i915: Add fb format modifier support
  2015-02-09 18:03 ` [PATCH 2/5] " Daniel Vetter
  2015-02-10 11:09   ` Tvrtko Ursulin
@ 2015-02-10 11:28   ` Daniel Vetter
  1 sibling, 0 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-10 11:28 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter, DRI Development

Currently we don't support anything but X tiled. And for an easier
transition it makes a lot of sense to just keep requiring that X tiled
is properly fenced.

Which means we need to do absolutely nothing in old code to support fb
modifiers, yay!

v2: Fix the Y tiling check, noticed by Tvrtko.

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2655b63d65e9..26fe302b27a4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12706,7 +12706,20 @@ static int intel_framebuffer_init(struct drm_device *dev,
 
 	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
-	if (obj->tiling_mode == I915_TILING_Y) {
+	if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) {
+		/* Enforce that fb modifier and tiling mode match, but only for
+		 * X-tiled. */
+		if (!!(obj->tiling_mode == I915_TILING_X) !=
+		    !!(mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)) {
+			DRM_DEBUG("tiling_mode doesn't match fb modifier\n");
+			return -EINVAL;
+		}
+	} else {
+		if (obj->tiling_mode == I915_TILING_X)
+			mode_cmd->modifier[0] = I915_FORMAT_MOD_X_TILED;
+	}
+
+	if (mode_cmd->modifier[0] == I915_FORMAT_MOD_Y_TILED) {
 		DRM_DEBUG("hardware does not support tiling Y\n");
 		return -EINVAL;
 	}
@@ -12720,12 +12733,12 @@ static int intel_framebuffer_init(struct drm_device *dev,
 	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev)) {
 		pitch_limit = 32*1024;
 	} else if (INTEL_INFO(dev)->gen >= 4) {
-		if (obj->tiling_mode)
+		if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)
 			pitch_limit = 16*1024;
 		else
 			pitch_limit = 32*1024;
 	} else if (INTEL_INFO(dev)->gen >= 3) {
-		if (obj->tiling_mode)
+		if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)
 			pitch_limit = 8*1024;
 		else
 			pitch_limit = 16*1024;
@@ -12735,12 +12748,13 @@ static int intel_framebuffer_init(struct drm_device *dev,
 
 	if (mode_cmd->pitches[0] > pitch_limit) {
 		DRM_DEBUG("%s pitch (%d) must be at less than %d\n",
-			  obj->tiling_mode ? "tiled" : "linear",
+			  mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED ?
+			  "tiled" : "linear",
 			  mode_cmd->pitches[0], pitch_limit);
 		return -EINVAL;
 	}
 
-	if (obj->tiling_mode != I915_TILING_NONE &&
+	if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED &&
 	    mode_cmd->pitches[0] != obj->stride) {
 		DRM_DEBUG("pitch (%d) must match tiling stride (%d)\n",
 			  mode_cmd->pitches[0], obj->stride);
-- 
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] 42+ messages in thread

* Re: [PATCH 5/5] drm: Also check unused fields for addfb2
  2015-02-10 11:01   ` [PATCH 5/5] drm: Also check unused fields for addfb2 Chris Wilson
@ 2015-02-10 11:36     ` Daniel Vetter
  2015-02-10 11:51       ` Chris Wilson
  0 siblings, 1 reply; 42+ messages in thread
From: Daniel Vetter @ 2015-02-10 11:36 UTC (permalink / raw)
  To: Chris Wilson, Daniel Vetter, Intel Graphics Development,
	DRI Development, Daniel Vetter

On Tue, Feb 10, 2015 at 11:01:56AM +0000, Chris Wilson wrote:
> On Mon, Feb 09, 2015 at 07:03:28PM +0100, Daniel Vetter wrote:
> > Just the usual paranoia ...
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  drivers/gpu/drm/drm_crtc.c | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > index b15d720eda4c..a12d7e8a0ca0 100644
> > --- a/drivers/gpu/drm/drm_crtc.c
> > +++ b/drivers/gpu/drm/drm_crtc.c
> > @@ -3322,6 +3322,23 @@ static int framebuffer_check(const struct drm_mode_fb_cmd2 *r)
> >  		}
> >  	}
> >  
> > +	for (; i < 4; i++) {
> > +		if (r->handles[i]) {
> > +			DRM_DEBUG_KMS("buffer object handle for unused plane %d\n", i);
> 
> Printing the invalid value is also useful. We tended to put user
> debugging messages as DRM_DEBUG(); would probably be useful to add
> DRM_DEBUG_USER() and clean up all the EINVAL reporting.

Generally I agree, but here I couldn't come up with a case where it would
be useful:
- Missing memset is just that.
- Memset is there, but userspace filled in too many buffers - the i it
  prints should be enough.

-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH] drm/i915: Add fb format modifier support
  2015-02-09 18:03 ` [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers Daniel Vetter
  2015-02-10 11:05   ` Tvrtko Ursulin
  2015-02-10 11:28   ` [PATCH] " Daniel Vetter
@ 2015-02-10 11:50   ` Daniel Vetter
  2 siblings, 0 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-10 11:50 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: Daniel Vetter, Daniel Vetter, DRI Development, Tvrtko Ursulin

Currently we don't support anything but X tiled. And for an easier
transition it makes a lot of sense to just keep requiring that X tiled
is properly fenced.

Which means we need to do absolutely nothing in old code to support fb
modifiers, yay!

v2: Fix the Y tiling check, noticed by Tvrtko.

v3: Catch Y-tiled fb for legacy addfb again (Tvrtko) and explain why
we want X tiling to match in the comment.

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2655b63d65e9..da827568671e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12706,7 +12706,24 @@ static int intel_framebuffer_init(struct drm_device *dev,
 
 	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
-	if (obj->tiling_mode == I915_TILING_Y) {
+	if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) {
+		/* Enforce that fb modifier and tiling mode match, but only for
+		 * X-tiled. This is needed for FBC. */
+		if (!!(obj->tiling_mode == I915_TILING_X) !=
+		    !!(mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)) {
+			DRM_DEBUG("tiling_mode doesn't match fb modifier\n");
+			return -EINVAL;
+		}
+	} else {
+		if (obj->tiling_mode == I915_TILING_X)
+			mode_cmd->modifier[0] = I915_FORMAT_MOD_X_TILED;
+		else if (obj->tiling_mode == I915_TILING_Y) {
+			DRM_DEBUG("No Y tiling for legacy addfb\n");
+			return -EINVAL;
+		}
+	}
+
+	if (mode_cmd->modifier[0] == I915_FORMAT_MOD_Y_TILED) {
 		DRM_DEBUG("hardware does not support tiling Y\n");
 		return -EINVAL;
 	}
@@ -12720,12 +12737,12 @@ static int intel_framebuffer_init(struct drm_device *dev,
 	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev)) {
 		pitch_limit = 32*1024;
 	} else if (INTEL_INFO(dev)->gen >= 4) {
-		if (obj->tiling_mode)
+		if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)
 			pitch_limit = 16*1024;
 		else
 			pitch_limit = 32*1024;
 	} else if (INTEL_INFO(dev)->gen >= 3) {
-		if (obj->tiling_mode)
+		if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)
 			pitch_limit = 8*1024;
 		else
 			pitch_limit = 16*1024;
@@ -12735,12 +12752,13 @@ static int intel_framebuffer_init(struct drm_device *dev,
 
 	if (mode_cmd->pitches[0] > pitch_limit) {
 		DRM_DEBUG("%s pitch (%d) must be at less than %d\n",
-			  obj->tiling_mode ? "tiled" : "linear",
+			  mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED ?
+			  "tiled" : "linear",
 			  mode_cmd->pitches[0], pitch_limit);
 		return -EINVAL;
 	}
 
-	if (obj->tiling_mode != I915_TILING_NONE &&
+	if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED &&
 	    mode_cmd->pitches[0] != obj->stride) {
 		DRM_DEBUG("pitch (%d) must match tiling stride (%d)\n",
 			  mode_cmd->pitches[0], obj->stride);
-- 
2.1.4

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

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

* Re: [PATCH 5/5] drm: Also check unused fields for addfb2
  2015-02-10 11:36     ` Daniel Vetter
@ 2015-02-10 11:51       ` Chris Wilson
  0 siblings, 0 replies; 42+ messages in thread
From: Chris Wilson @ 2015-02-10 11:51 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Daniel Vetter

On Tue, Feb 10, 2015 at 12:36:51PM +0100, Daniel Vetter wrote:
> On Tue, Feb 10, 2015 at 11:01:56AM +0000, Chris Wilson wrote:
> > On Mon, Feb 09, 2015 at 07:03:28PM +0100, Daniel Vetter wrote:
> > > Just the usual paranoia ...
> > > 
> > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > > ---
> > >  drivers/gpu/drm/drm_crtc.c | 17 +++++++++++++++++
> > >  1 file changed, 17 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > > index b15d720eda4c..a12d7e8a0ca0 100644
> > > --- a/drivers/gpu/drm/drm_crtc.c
> > > +++ b/drivers/gpu/drm/drm_crtc.c
> > > @@ -3322,6 +3322,23 @@ static int framebuffer_check(const struct drm_mode_fb_cmd2 *r)
> > >  		}
> > >  	}
> > >  
> > > +	for (; i < 4; i++) {
> > > +		if (r->handles[i]) {
> > > +			DRM_DEBUG_KMS("buffer object handle for unused plane %d\n", i);
> > 
> > Printing the invalid value is also useful. We tended to put user
> > debugging messages as DRM_DEBUG(); would probably be useful to add
> > DRM_DEBUG_USER() and clean up all the EINVAL reporting.
> 
> Generally I agree, but here I couldn't come up with a case where it would
> be useful:
> - Missing memset is just that.
> - Memset is there, but userspace filled in too many buffers - the i it
>   prints should be enough.

The comment was more towards the future, when I expect the validity
checking to be more stringent. For consistency we should use the same
debug level as for other EINVAL logging, and when we come to cut and
paste the error message, having the value in there should remind us to
be verbose.

Even here I expect the value to be useful diagnostic, e.g. to help
narrow down the circumstances under which the invalid ioctl was called.
Maybe it contains poison, maybe it is valid but stale etc.
-Chris

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

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

* Re: [PATCH] drm/i915: Add tiled framebuffer modifiers
  2015-02-10 11:28   ` [PATCH] " Daniel Vetter
@ 2015-02-10 16:16     ` shuang.he
  0 siblings, 0 replies; 42+ messages in thread
From: shuang.he @ 2015-02-10 16:16 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: 5743
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV              +4                 275/283              279/283
ILK                 -1              310/315              309/315
SNB              +3                 320/346              323/346
IVB                 -1              380/384              379/384
BYT                                  296/296              296/296
HSW              +3                 422/428              425/428
BDW                                  318/333              318/333
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
 PNV  igt_gem_userptr_blits_coherency-sync      CRASH(2, M7)PASS(1, M7)      PASS(1, M7)
 PNV  igt_gem_userptr_blits_coherency-unsync      CRASH(2, M7)PASS(1, M7)      PASS(1, M7)
 PNV  igt_gem_userptr_blits_create-destroy-sync      NRUN(1, M7)PASS(2, M7)      PASS(1, M7)
*PNV  igt_gen3_render_tiledx_blits      TIMEOUT(1, M7)PASS(2, M7)      FAIL(1, M7)
 PNV  igt_gen3_render_tiledy_blits      FAIL(2, M7)PASS(1, M7)      PASS(1, M7)
*ILK  igt_gem_unfence_active_buffers      PASS(2, M26)      DMESG_WARN(1, M26)
*SNB  igt_kms_flip_bo-too-big      BLACKLIST(1, M35)      PASS(1, M35)
*SNB  igt_kms_flip_bo-too-big-interruptible      BLACKLIST(1, M35)      PASS(1, M35)
*SNB  igt_kms_flip_event_leak      NSPT(2, M35)      PASS(1, M35)
*IVB  igt_gem_storedw_batches_loop_normal      PASS(2, M4)      DMESG_WARN(1, M4)
*HSW  igt_kms_flip_bo-too-big      BLACKLIST(1, M40)      PASS(1, M40)
*HSW  igt_kms_flip_bo-too-big-interruptible      BLACKLIST(1, M40)      PASS(1, M40)
 HSW  igt_kms_flip_plain-flip-fb-recreate-interruptible      TIMEOUT(2, M40)PASS(1, M40)      PASS(1, M40)
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] 42+ messages in thread

* Re: [PATCH 3/5] drm/i915: Use fb format modifiers in skylake_update_primary_plane
  2015-02-09 18:03 ` [PATCH 3/5] drm/i915: Use fb format modifiers in skylake_update_primary_plane Daniel Vetter
@ 2015-02-10 16:25   ` Damien Lespiau
  0 siblings, 0 replies; 42+ messages in thread
From: Damien Lespiau @ 2015-02-10 16:25 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Mon, Feb 09, 2015 at 07:03:26PM +0100, Daniel Vetter wrote:
> Just a little demo really. We probably need to introduce skl specific
> functions for a lot of the format validation stuff, or at least
> helpers. Specifically I think intel_framebuffer_init and
> intel_fb_align_height must be adjusted to have an i915_ and a skl_
> variant. And only shared code should be converted to fb modifiers,
> platform code (like the plane config readout can keep on using old
> tiling_mode defines to avoid some churn).
> 
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2d69cce03ab5..41b3ddc4068d 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2773,11 +2773,11 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,
>  	 * The stride is either expressed as a multiple of 64 bytes chunks for
>  	 * linear buffers or in number of tiles for tiled buffers.
>  	 */
> -	switch (obj->tiling_mode) {
> -	case I915_TILING_NONE:
> +	switch (fb->modifier[0]) {
> +	case DRM_FORMAT_MOD_NONE:
>  		stride = fb->pitches[0] >> 6;
>  		break;
> -	case I915_TILING_X:
> +	case I915_FORMAT_MOD_X_TILED:
>  		plane_ctl |= PLANE_CTL_TILED_X;
>  		stride = fb->pitches[0] >> 9;
>  		break;

Just a remark across the board is that this code won't work as we add
new types of modifiers besides tiling. Might as wels reserve tiling bits
today and select on them.

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

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

* [PATCH v2 00/13] i915 fb modifier support, respun
  2015-02-09 18:03 [PATCH 0/5] i915 fb modifier support, respun Daniel Vetter
                   ` (4 preceding siblings ...)
  2015-02-09 18:03 ` [PATCH 5/5] drm: Also check unused fields for addfb2 Daniel Vetter
@ 2015-02-10 17:16 ` Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 01/13] RFC: drm: add support for tiled/compressed/etc modifier in addfb2 Tvrtko Ursulin
                     ` (12 more replies)
  5 siblings, 13 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Aggregated patch series containing Daniel's take on fb modifiers plus
some missing bits, fixes and cleanups.

Also including Rob Clark's RFC so PRTS can attempt to test this.

Needs updated kms_addfb i-g-t which will follow.

Daniel Vetter (5):
  drm/i915: Add fb format modifier support
  drm: Also check unused fields for addfb2
  drm/i915: Set up fb format modifier for initial plane config
  drm/i915: Switch +intel_fb_align_height to fb format modifiers
  drm/i915: Use fb format modifiers in skylake_update_primary_plane

Rob Clark (1):
  RFC: drm: add support for tiled/compressed/etc modifier in addfb2

Tvrtko Ursulin (7):
  drm/i915: Add tiled framebuffer modifiers
  drm/i915: Show frame buffer modifier in debug info
  drm/i915/skl: CS flips are not supported with execlists
  drm/i915/skl: Use fb modifiers for sprites
  drm/i915: Use fb modifiers in intel_check_cursor_plane
  drm/i915: Use fb modifiers in intel_pin_and_fence_fb_obj
  drm/i915: Announce support for framebuffer modifiers

 drivers/gpu/drm/drm_crtc.c           |  31 ++++++-
 drivers/gpu/drm/drm_crtc_helper.c    |   1 +
 drivers/gpu/drm/drm_ioctl.c          |   3 +
 drivers/gpu/drm/i915/i915_debugfs.c  |   6 +-
 drivers/gpu/drm/i915/i915_drv.h      |   1 +
 drivers/gpu/drm/i915/intel_display.c | 164 +++++++++++++++--------------------
 drivers/gpu/drm/i915/intel_drv.h     |   3 +-
 drivers/gpu/drm/i915/intel_fbdev.c   |   3 +-
 drivers/gpu/drm/i915/intel_sprite.c  |  13 ++-
 include/drm/drm_crtc.h               |   4 +
 include/uapi/drm/drm.h               |   1 +
 include/uapi/drm/drm_fourcc.h        |  63 ++++++++++++++
 include/uapi/drm/drm_mode.h          |   9 ++
 13 files changed, 195 insertions(+), 107 deletions(-)

-- 
2.2.2

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

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

* [PATCH 01/13] RFC: drm: add support for tiled/compressed/etc modifier in addfb2
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 02/13] drm/i915: Add tiled framebuffer modifiers Tvrtko Ursulin
                     ` (11 subsequent siblings)
  12 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx
  Cc: Michel Dänzer, Daniel Stone, Laurent Pinchart, Daniel Vetter

From: Rob Clark <robdclark@gmail.com>

In DRM/KMS we are lacking a good way to deal with tiled/compressed
formats.  Especially in the case of dmabuf/prime buffer sharing, where
we cannot always rely on under-the-hood flags passed to driver specific
gem-create ioctl to pass around these extra flags.

The proposal is to add a per-plane format modifier.  This allows to, if
necessary, use different tiling patters for sub-sampled planes, etc.
The format modifiers are added at the end of the ioctl struct, so for
legacy userspace it will be zero padded.

v1: original
v1.5: increase modifier to 64b

v2: Incorporate review comments from the big thread, plus a few more.

- Add a getcap so that userspace doesn't have to jump through hoops.
- Allow modifiers only when a flag is set. That way drivers know when
  they're dealing with old userspace and need to fish out e.g. tiling
  from other information.
- After rolling out checks for ->modifier to all drivers I've decided
  that this is way too fragile and needs an explicit opt-in flag. So
  do that instead.
- Add a define (just for documentation really) for the "NONE"
  modifier. Imo we don't need to add mask #defines since drivers
  really should only do exact matches against values defined with
  fourcc_mod_code.
- Drop the Samsung tiling modifier on Rob's request since he's not yet
  sure whether that one is accurate.

v3:
- Also add a new ->modifier[] array to struct drm_framebuffer and fill
  it in drm_helper_mode_fill_fb_struct. Requested by Tvrkto Uruslin.
- Remove TODO in comment and add code comment that modifiers should be
  properly documented, requested by Rob.

Cc: Rob Clark <robdclark@gmail.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Daniel Stone <daniel@fooishbar.org>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Rob Clark <robdclark@gmail.com> (v1.5)
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_crtc.c        | 14 +++++++++++++-
 drivers/gpu/drm/drm_crtc_helper.c |  1 +
 drivers/gpu/drm/drm_ioctl.c       |  3 +++
 include/drm/drm_crtc.h            |  4 ++++
 include/uapi/drm/drm.h            |  1 +
 include/uapi/drm/drm_fourcc.h     | 32 ++++++++++++++++++++++++++++++++
 include/uapi/drm/drm_mode.h       |  9 +++++++++
 7 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 6b00173..e6e2de3 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3261,6 +3261,12 @@ static int framebuffer_check(const struct drm_mode_fb_cmd2 *r)
 			DRM_DEBUG_KMS("bad pitch %u for plane %d\n", r->pitches[i], i);
 			return -EINVAL;
 		}
+
+		if (r->modifier[i] && !(r->flags & DRM_MODE_FB_MODIFIERS)) {
+			DRM_DEBUG_KMS("bad fb modifier %llu for plane %d\n",
+				      r->modifier[i], i);
+			return -EINVAL;
+		}
 	}
 
 	return 0;
@@ -3274,7 +3280,7 @@ static struct drm_framebuffer *add_framebuffer_internal(struct drm_device *dev,
 	struct drm_framebuffer *fb;
 	int ret;
 
-	if (r->flags & ~DRM_MODE_FB_INTERLACED) {
+	if (r->flags & ~(DRM_MODE_FB_INTERLACED | DRM_MODE_FB_MODIFIERS)) {
 		DRM_DEBUG_KMS("bad framebuffer flags 0x%08x\n", r->flags);
 		return ERR_PTR(-EINVAL);
 	}
@@ -3290,6 +3296,12 @@ static struct drm_framebuffer *add_framebuffer_internal(struct drm_device *dev,
 		return ERR_PTR(-EINVAL);
 	}
 
+	if (r->flags & DRM_MODE_FB_MODIFIERS &&
+	    !dev->mode_config.allow_fb_modifiers) {
+		DRM_DEBUG_KMS("driver does not support fb modifiers\n");
+		return ERR_PTR(-EINVAL);
+	}
+
 	ret = framebuffer_check(r);
 	if (ret)
 		return ERR_PTR(ret);
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index b1979e7..3053aab 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -837,6 +837,7 @@ void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
 	for (i = 0; i < 4; i++) {
 		fb->pitches[i] = mode_cmd->pitches[i];
 		fb->offsets[i] = mode_cmd->offsets[i];
+		fb->modifier[i] = mode_cmd->modifier[i];
 	}
 	drm_fb_get_bpp_depth(mode_cmd->pixel_format, &fb->depth,
 				    &fb->bits_per_pixel);
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 3785d66..a6d773a 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -321,6 +321,9 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
 		else
 			req->value = 64;
 		break;
+	case DRM_CAP_ADDFB2_MODIFIERS:
+		req->value = dev->mode_config.allow_fb_modifiers;
+		break;
 	default:
 		return -EINVAL;
 	}
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 920e21a..b1465d6 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -202,6 +202,7 @@ struct drm_framebuffer {
 	const struct drm_framebuffer_funcs *funcs;
 	unsigned int pitches[4];
 	unsigned int offsets[4];
+	uint64_t modifier[4];
 	unsigned int width;
 	unsigned int height;
 	/* depth can be 15 or 16 */
@@ -1155,6 +1156,9 @@ struct drm_mode_config {
 	/* whether async page flip is supported or not */
 	bool async_page_flip;
 
+	/* whether the driver supports fb modifiers */
+	bool allow_fb_modifiers;
+
 	/* cursor size */
 	uint32_t cursor_width, cursor_height;
 };
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 01b2d6d..ff6ef62 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -630,6 +630,7 @@ struct drm_gem_open {
  */
 #define DRM_CAP_CURSOR_WIDTH		0x8
 #define DRM_CAP_CURSOR_HEIGHT		0x9
+#define DRM_CAP_ADDFB2_MODIFIERS	0x10
 
 /** DRM_IOCTL_GET_CAP ioctl argument type */
 struct drm_get_cap {
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index a284f11..188e61f 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -129,4 +129,36 @@
 #define DRM_FORMAT_YUV444	fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */
 #define DRM_FORMAT_YVU444	fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */
 
+
+/*
+ * Format Modifiers:
+ *
+ * Format modifiers describe, typically, a re-ordering or modification
+ * of the data in a plane of an FB.  This can be used to express tiled/
+ * swizzled formats, or compression, or a combination of the two.
+ *
+ * The upper 8 bits of the format modifier are a vendor-id as assigned
+ * below.  The lower 56 bits are assigned as vendor sees fit.
+ */
+
+/* Vendor Ids: */
+#define DRM_FORMAT_MOD_NONE           0
+#define DRM_FORMAT_MOD_VENDOR_INTEL   0x01
+#define DRM_FORMAT_MOD_VENDOR_AMD     0x02
+#define DRM_FORMAT_MOD_VENDOR_NV      0x03
+#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04
+#define DRM_FORMAT_MOD_VENDOR_QCOM    0x05
+/* add more to the end as needed */
+
+#define fourcc_mod_code(vendor, val) \
+	((((u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | (val & 0x00ffffffffffffffL))
+
+/*
+ * Format Modifier tokens:
+ *
+ * When adding a new token please document the layout with a code comment,
+ * similar to the fourcc codes above. drm_fourcc.h is considered the
+ * authoritative source for all of these.
+ */
+
 #endif /* DRM_FOURCC_H */
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index ca788e0..dbeba94 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -336,6 +336,7 @@ struct drm_mode_fb_cmd {
 };
 
 #define DRM_MODE_FB_INTERLACED	(1<<0) /* for interlaced framebuffers */
+#define DRM_MODE_FB_MODIFIERS	(1<<1) /* enables ->modifer[] */
 
 struct drm_mode_fb_cmd2 {
 	__u32 fb_id;
@@ -356,10 +357,18 @@ struct drm_mode_fb_cmd2 {
 	 * So it would consist of Y as offsets[0] and UV as
 	 * offsets[1].  Note that offsets[0] will generally
 	 * be 0 (but this is not required).
+	 *
+	 * To accommodate tiled, compressed, etc formats, a per-plane
+	 * modifier can be specified.  The default value of zero
+	 * indicates "native" format as specified by the fourcc.
+	 * Vendor specific modifier token.  This allows, for example,
+	 * different tiling/swizzling pattern on different planes.
+	 * See discussion above of DRM_FORMAT_MOD_xxx.
 	 */
 	__u32 handles[4];
 	__u32 pitches[4]; /* pitch for each plane */
 	__u32 offsets[4]; /* offset of each plane */
+	__u64 modifier[4]; /* ie, tiling, compressed (per plane) */
 };
 
 #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
-- 
2.2.2

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

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

* [PATCH 02/13] drm/i915: Add tiled framebuffer modifiers
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 01/13] RFC: drm: add support for tiled/compressed/etc modifier in addfb2 Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 03/13] drm/i915: Add fb format modifier support Tvrtko Ursulin
                     ` (10 subsequent siblings)
  12 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Daniel Vetter

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

To be used from the new addfb2 extension.

v2:
- Drop Intel-specific untiled modfier.
- Move to drm_fourcc.h.
- Document layouts a bit and denote them as platform-specific and not
  useable for cross-driver sharing.
- Add Y-tiling for completeness.
- Drop special docstring markers to avoid confusing kerneldoc.

v3: Give Y-tiling a unique idea, noticed by Tvrtko.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v1)
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h |  1 +
 include/uapi/drm/drm_fourcc.h   | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 26ffe8b..ea4b250 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -31,6 +31,7 @@
 #define _I915_DRV_H_
 
 #include <uapi/drm/i915_drm.h>
+#include <uapi/drm/drm_fourcc.h>
 
 #include "i915_reg.h"
 #include "intel_bios.h"
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 188e61f..1a5a357 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -161,4 +161,35 @@
  * authoritative source for all of these.
  */
 
+/* Intel framebuffer modifiers */
+
+/*
+ * Intel X-tiling layout
+ *
+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
+ * in row-major layout. Within the tile bytes are laid out row-major, with
+ * a platform-dependent stride. On top of that the memory can apply
+ * platform-depending swizzling of some higher address bits into bit6.
+ *
+ * This format is highly platforms specific and not useful for cross-driver
+ * sharing. It exists since on a given platform it does uniquely identify the
+ * layout in a simple way for i915-specific userspace.
+ */
+#define I915_FORMAT_MOD_X_TILED	fourcc_mod_code(INTEL, 1)
+
+/*
+ * Intel Y-tiling layout
+ *
+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
+ * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes)
+ * chunks column-major, with a platform-dependent height. On top of that the
+ * memory can apply platform-depending swizzling of some higher address bits
+ * into bit6.
+ *
+ * This format is highly platforms specific and not useful for cross-driver
+ * sharing. It exists since on a given platform it does uniquely identify the
+ * layout in a simple way for i915-specific userspace.
+ */
+#define I915_FORMAT_MOD_Y_TILED	fourcc_mod_code(INTEL, 2)
+
 #endif /* DRM_FOURCC_H */
-- 
2.2.2

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

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

* [PATCH 03/13] drm/i915: Add fb format modifier support
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 01/13] RFC: drm: add support for tiled/compressed/etc modifier in addfb2 Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 02/13] drm/i915: Add tiled framebuffer modifiers Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 04/13] drm/i915: Show frame buffer modifier in debug info Tvrtko Ursulin
                     ` (9 subsequent siblings)
  12 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Daniel Vetter, Daniel Vetter

From: Daniel Vetter <daniel.vetter@ffwll.ch>

Currently we don't support anything but X tiled. And for an easier
transition it makes a lot of sense to just keep requiring that X tiled
is properly fenced.

Which means we need to do absolutely nothing in old code to support fb
modifiers, yay!

v2: Fix the Y tiling check, noticed by Tvrtko.

v3: Catch Y-tiled fb for legacy addfb again (Tvrtko) and explain why
we want X tiling to match in the comment.

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3fe9598..4886ff8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12707,7 +12707,24 @@ static int intel_framebuffer_init(struct drm_device *dev,
 
 	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
-	if (obj->tiling_mode == I915_TILING_Y) {
+	if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) {
+		/* Enforce that fb modifier and tiling mode match, but only for
+		 * X-tiled. This is needed for FBC. */
+		if (!!(obj->tiling_mode == I915_TILING_X) !=
+		    !!(mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)) {
+			DRM_DEBUG("tiling_mode doesn't match fb modifier\n");
+			return -EINVAL;
+		}
+	} else {
+		if (obj->tiling_mode == I915_TILING_X)
+			mode_cmd->modifier[0] = I915_FORMAT_MOD_X_TILED;
+		else if (obj->tiling_mode == I915_TILING_Y) {
+			DRM_DEBUG("No Y tiling for legacy addfb\n");
+			return -EINVAL;
+		}
+	}
+
+	if (mode_cmd->modifier[0] == I915_FORMAT_MOD_Y_TILED) {
 		DRM_DEBUG("hardware does not support tiling Y\n");
 		return -EINVAL;
 	}
@@ -12721,12 +12738,12 @@ static int intel_framebuffer_init(struct drm_device *dev,
 	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev)) {
 		pitch_limit = 32*1024;
 	} else if (INTEL_INFO(dev)->gen >= 4) {
-		if (obj->tiling_mode)
+		if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)
 			pitch_limit = 16*1024;
 		else
 			pitch_limit = 32*1024;
 	} else if (INTEL_INFO(dev)->gen >= 3) {
-		if (obj->tiling_mode)
+		if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED)
 			pitch_limit = 8*1024;
 		else
 			pitch_limit = 16*1024;
@@ -12736,12 +12753,13 @@ static int intel_framebuffer_init(struct drm_device *dev,
 
 	if (mode_cmd->pitches[0] > pitch_limit) {
 		DRM_DEBUG("%s pitch (%d) must be at less than %d\n",
-			  obj->tiling_mode ? "tiled" : "linear",
+			  mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED ?
+			  "tiled" : "linear",
 			  mode_cmd->pitches[0], pitch_limit);
 		return -EINVAL;
 	}
 
-	if (obj->tiling_mode != I915_TILING_NONE &&
+	if (mode_cmd->modifier[0] == I915_FORMAT_MOD_X_TILED &&
 	    mode_cmd->pitches[0] != obj->stride) {
 		DRM_DEBUG("pitch (%d) must match tiling stride (%d)\n",
 			  mode_cmd->pitches[0], obj->stride);
-- 
2.2.2

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

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

* [PATCH 04/13] drm/i915: Show frame buffer modifier in debug info
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (2 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 03/13] drm/i915: Add fb format modifier support Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-11  7:34     ` Daniel Vetter
  2015-02-10 17:16   ` [PATCH 05/13] drm: Also check unused fields for addfb2 Tvrtko Ursulin
                     ` (8 subsequent siblings)
  12 siblings, 1 reply; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 2e1f723..164fa82 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1778,11 +1778,12 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
 	ifbdev = dev_priv->fbdev;
 	fb = to_intel_framebuffer(ifbdev->helper.fb);
 
-	seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, refcount %d, obj ",
+	seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, modifier 0x%llx, refcount %d, obj ",
 		   fb->base.width,
 		   fb->base.height,
 		   fb->base.depth,
 		   fb->base.bits_per_pixel,
+		   fb->base.modifier[0],
 		   atomic_read(&fb->base.refcount.refcount));
 	describe_obj(m, fb->obj);
 	seq_putc(m, '\n');
@@ -1793,11 +1794,12 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
 		if (ifbdev && &fb->base == ifbdev->helper.fb)
 			continue;
 
-		seq_printf(m, "user size: %d x %d, depth %d, %d bpp, refcount %d, obj ",
+		seq_printf(m, "user size: %d x %d, depth %d, %d bpp, modifier 0x%llx, refcount %d, obj ",
 			   fb->base.width,
 			   fb->base.height,
 			   fb->base.depth,
 			   fb->base.bits_per_pixel,
+			   fb->base.modifier[0],
 			   atomic_read(&fb->base.refcount.refcount));
 		describe_obj(m, fb->obj);
 		seq_putc(m, '\n');
-- 
2.2.2

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

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

* [PATCH 05/13] drm: Also check unused fields for addfb2
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (3 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 04/13] drm/i915: Show frame buffer modifier in debug info Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 06/13] drm/i915: Set up fb format modifier for initial plane config Tvrtko Ursulin
                     ` (7 subsequent siblings)
  12 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Daniel Vetter, Daniel Vetter

From: Daniel Vetter <daniel.vetter@ffwll.ch>

Just the usual paranoia ...

v2: Fixed format strings. (Tvrtko Ursulin)

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/drm_crtc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index e6e2de3..61e7163 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3269,6 +3269,23 @@ static int framebuffer_check(const struct drm_mode_fb_cmd2 *r)
 		}
 	}
 
+	for (; i < 4; i++) {
+		if (r->handles[i]) {
+			DRM_DEBUG_KMS("buffer object handle for unused plane %d\n", i);
+			return -EINVAL;
+		}
+
+		if (r->pitches[i] || r->offsets[i]) {
+			DRM_DEBUG_KMS("buffer pitch/offset for unused plane %d", i);
+			return -EINVAL;
+		}
+
+		if (r->modifier[i]) {
+			DRM_DEBUG_KMS("fb modifer for unused plane %d", i);
+			return -EINVAL;
+		}
+	}
+
 	return 0;
 }
 
-- 
2.2.2

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

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

* [PATCH 06/13] drm/i915: Set up fb format modifier for initial plane config
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (4 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 05/13] drm: Also check unused fields for addfb2 Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 07/13] drm/i915: Switch +intel_fb_align_height to fb format modifiers Tvrtko Ursulin
                     ` (6 subsequent siblings)
  12 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Daniel Vetter, Daniel Vetter

From: Daniel Vetter <daniel.vetter@ffwll.ch>

No functional changes yet since intel_framebuffer_init would have
fixed this up for us. But this is prep work to be able to handle new
tiling layouts in the initial plane config code.

Follow-up patches will start to make use of this and switch over to fb
modifiers where needed.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4886ff8..f2622e3 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2390,6 +2390,8 @@ intel_alloc_plane_obj(struct intel_crtc *crtc,
 	mode_cmd.width = fb->width;
 	mode_cmd.height = fb->height;
 	mode_cmd.pitches[0] = fb->pitches[0];
+	mode_cmd.modifier[0] = fb->modifier[0];
+	mode_cmd.flags = DRM_MODE_FB_MODIFIERS;
 
 	mutex_lock(&dev->struct_mutex);
 
@@ -6625,9 +6627,12 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
 
 	fb = &intel_fb->base;
 
-	if (INTEL_INFO(dev)->gen >= 4)
-		if (val & DISPPLANE_TILED)
+	if (INTEL_INFO(dev)->gen >= 4) {
+		if (val & DISPPLANE_TILED) {
 			plane_config->tiling = I915_TILING_X;
+			fb->modifier[0] = I915_FORMAT_MOD_X_TILED;
+		}
+	}
 
 	pixel_format = val & DISPPLANE_PIXFORMAT_MASK;
 	fourcc = i9xx_format_to_fourcc(pixel_format);
@@ -7659,8 +7664,10 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
 	if (!(val & PLANE_CTL_ENABLE))
 		goto error;
 
-	if (val & PLANE_CTL_TILED_MASK)
+	if (val & PLANE_CTL_TILED_MASK) {
 		plane_config->tiling = I915_TILING_X;
+		fb->modifier[0] = I915_FORMAT_MOD_X_TILED;
+	}
 
 	pixel_format = val & PLANE_CTL_FORMAT_MASK;
 	fourcc = skl_format_to_fourcc(pixel_format,
@@ -7758,9 +7765,12 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc,
 
 	fb = &intel_fb->base;
 
-	if (INTEL_INFO(dev)->gen >= 4)
-		if (val & DISPPLANE_TILED)
+	if (INTEL_INFO(dev)->gen >= 4) {
+		if (val & DISPPLANE_TILED) {
 			plane_config->tiling = I915_TILING_X;
+			fb->modifier[0] = I915_FORMAT_MOD_X_TILED;
+		}
+	}
 
 	pixel_format = val & DISPPLANE_PIXFORMAT_MASK;
 	fourcc = i9xx_format_to_fourcc(pixel_format);
-- 
2.2.2

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

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

* [PATCH 07/13] drm/i915: Switch +intel_fb_align_height to fb format modifiers
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (5 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 06/13] drm/i915: Set up fb format modifier for initial plane config Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 08/13] drm/i915: Use fb format modifiers in skylake_update_primary_plane Tvrtko Ursulin
                     ` (5 subsequent siblings)
  12 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Daniel Vetter, Daniel Vetter

From: Daniel Vetter <daniel.vetter@ffwll.ch>

With this we can treat the fb format modifier completely independently
from the fencing mode in obj->tiling_mode in the initial plane code.
Which means new tiling modes without any gtt fence are now fully
support in the core i915 driver code.

v2: Also add pixel_format while at it, we need this to compute the
height for the new tiling formats.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++------
 drivers/gpu/drm/i915/intel_drv.h     |  3 ++-
 drivers/gpu/drm/i915/intel_fbdev.c   |  3 ++-
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f2622e3..ec172f9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2190,11 +2190,15 @@ static bool need_vtd_wa(struct drm_device *dev)
 }
 
 int
-intel_fb_align_height(struct drm_device *dev, int height, unsigned int tiling)
+intel_fb_align_height(struct drm_device *dev, int height,
+		      uint32_t pixel_format,
+		      uint64_t fb_format_modifier)
 {
 	int tile_height;
 
-	tile_height = tiling ? (IS_GEN2(dev) ? 16 : 8) : 1;
+	tile_height = fb_format_modifier == I915_FORMAT_MOD_X_TILED ?
+		(IS_GEN2(dev) ? 16 : 8) : 1;
+
 	return ALIGN(height, tile_height);
 }
 
@@ -6658,7 +6662,8 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
 	fb->pitches[0] = val & 0xffffffc0;
 
 	aligned_height = intel_fb_align_height(dev, fb->height,
-					       plane_config->tiling);
+					       fb->pixel_format,
+					       fb->modifier[0]);
 
 	plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height);
 
@@ -7700,7 +7705,8 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
 	fb->pitches[0] = (val & 0x3ff) * stride_mult;
 
 	aligned_height = intel_fb_align_height(dev, fb->height,
-					       plane_config->tiling);
+					       fb->pixel_format,
+					       fb->modifier[0]);
 
 	plane_config->size = ALIGN(fb->pitches[0] * aligned_height, PAGE_SIZE);
 
@@ -7796,7 +7802,8 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc,
 	fb->pitches[0] = val & 0xffffffc0;
 
 	aligned_height = intel_fb_align_height(dev, fb->height,
-					       plane_config->tiling);
+					       fb->pixel_format,
+					       fb->modifier[0]);
 
 	plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height);
 
@@ -12824,7 +12831,8 @@ static int intel_framebuffer_init(struct drm_device *dev,
 		return -EINVAL;
 
 	aligned_height = intel_fb_align_height(dev, mode_cmd->height,
-					       obj->tiling_mode);
+					       mode_cmd->pixel_format,
+					       mode_cmd->modifier[0]);
 	/* FIXME drm helper for size checks (especially planar formats)? */
 	if (obj->base.size < aligned_height * mode_cmd->pitches[0])
 		return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 76b3c20..b9598ba 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -879,7 +879,8 @@ void intel_frontbuffer_flip(struct drm_device *dev,
 }
 
 int intel_fb_align_height(struct drm_device *dev, int height,
-			  unsigned int tiling);
+			  uint32_t pixel_format,
+			  uint64_t fb_format_modifier);
 void intel_fb_obj_flush(struct drm_i915_gem_object *obj, bool retire);
 
 
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 3001a867..234a699 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -594,7 +594,8 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
 
 		cur_size = intel_crtc->config->base.adjusted_mode.crtc_vdisplay;
 		cur_size = intel_fb_align_height(dev, cur_size,
-						 plane_config->tiling);
+						 fb->base.pixel_format,
+						 fb->base.modifier[0]);
 		cur_size *= fb->base.pitches[0];
 		DRM_DEBUG_KMS("pipe %c area: %dx%d, bpp: %d, size: %d\n",
 			      pipe_name(intel_crtc->pipe),
-- 
2.2.2

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

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

* [PATCH 08/13] drm/i915: Use fb format modifiers in skylake_update_primary_plane
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (6 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 07/13] drm/i915: Switch +intel_fb_align_height to fb format modifiers Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 09/13] drm/i915/skl: CS flips are not supported with execlists Tvrtko Ursulin
                     ` (4 subsequent siblings)
  12 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Daniel Vetter, Daniel Vetter

From: Daniel Vetter <daniel.vetter@ffwll.ch>

Just a little demo really. We probably need to introduce skl specific
functions for a lot of the format validation stuff, or at least
helpers. Specifically I think intel_framebuffer_init and
intel_fb_align_height must be adjusted to have an i915_ and a skl_
variant. And only shared code should be converted to fb modifiers,
platform code (like the plane config readout can keep on using old
tiling_mode defines to avoid some churn).

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ec172f9..df47031 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2779,11 +2779,11 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,
 	 * The stride is either expressed as a multiple of 64 bytes chunks for
 	 * linear buffers or in number of tiles for tiled buffers.
 	 */
-	switch (obj->tiling_mode) {
-	case I915_TILING_NONE:
+	switch (fb->modifier[0]) {
+	case DRM_FORMAT_MOD_NONE:
 		stride = fb->pitches[0] >> 6;
 		break;
-	case I915_TILING_X:
+	case I915_FORMAT_MOD_X_TILED:
 		plane_ctl |= PLANE_CTL_TILED_X;
 		stride = fb->pitches[0] >> 9;
 		break;
-- 
2.2.2

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

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

* [PATCH 09/13] drm/i915/skl: CS flips are not supported with execlists
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (7 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 08/13] drm/i915: Use fb format modifiers in skylake_update_primary_plane Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-11  7:40     ` Daniel Vetter
  2015-02-10 17:16   ` [PATCH 10/13] drm/i915/skl: Use fb modifiers for sprites Tvrtko Ursulin
                     ` (3 subsequent siblings)
  12 siblings, 1 reply; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Therefore remove dead code.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 72 ++----------------------------------
 1 file changed, 4 insertions(+), 68 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index df47031..38c2909 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9632,69 +9632,6 @@ static int intel_queue_mmio_flip(struct drm_device *dev,
 	return 0;
 }
 
-static int intel_gen9_queue_flip(struct drm_device *dev,
-				 struct drm_crtc *crtc,
-				 struct drm_framebuffer *fb,
-				 struct drm_i915_gem_object *obj,
-				 struct intel_engine_cs *ring,
-				 uint32_t flags)
-{
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-	uint32_t plane = 0, stride;
-	int ret;
-
-	switch(intel_crtc->pipe) {
-	case PIPE_A:
-		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_A;
-		break;
-	case PIPE_B:
-		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_B;
-		break;
-	case PIPE_C:
-		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_C;
-		break;
-	default:
-		WARN_ONCE(1, "unknown plane in flip command\n");
-		return -ENODEV;
-	}
-
-	switch (obj->tiling_mode) {
-	case I915_TILING_NONE:
-		stride = fb->pitches[0] >> 6;
-		break;
-	case I915_TILING_X:
-		stride = fb->pitches[0] >> 9;
-		break;
-	default:
-		WARN_ONCE(1, "unknown tiling in flip command\n");
-		return -ENODEV;
-	}
-
-	ret = intel_ring_begin(ring, 10);
-	if (ret)
-		return ret;
-
-	intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));
-	intel_ring_emit(ring, DERRMR);
-	intel_ring_emit(ring, ~(DERRMR_PIPEA_PRI_FLIP_DONE |
-				DERRMR_PIPEB_PRI_FLIP_DONE |
-				DERRMR_PIPEC_PRI_FLIP_DONE));
-	intel_ring_emit(ring, MI_STORE_REGISTER_MEM_GEN8(1) |
-			      MI_SRM_LRM_GLOBAL_GTT);
-	intel_ring_emit(ring, DERRMR);
-	intel_ring_emit(ring, ring->scratch.gtt_offset + 256);
-	intel_ring_emit(ring, 0);
-
-	intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane);
-	intel_ring_emit(ring, stride << 6 | obj->tiling_mode);
-	intel_ring_emit(ring, intel_crtc->unpin_work->gtt_offset);
-
-	intel_mark_page_flip_active(intel_crtc);
-	__intel_ring_advance(ring);
-
-	return 0;
-}
-
 static int intel_default_queue_flip(struct drm_device *dev,
 				    struct drm_crtc *crtc,
 				    struct drm_framebuffer *fb,
@@ -12994,9 +12931,6 @@ static void intel_init_display(struct drm_device *dev)
 			valleyview_modeset_global_resources;
 	}
 
-	/* Default just returns -ENODEV to indicate unsupported */
-	dev_priv->display.queue_flip = intel_default_queue_flip;
-
 	switch (INTEL_INFO(dev)->gen) {
 	case 2:
 		dev_priv->display.queue_flip = intel_gen2_queue_flip;
@@ -13019,8 +12953,10 @@ static void intel_init_display(struct drm_device *dev)
 		dev_priv->display.queue_flip = intel_gen7_queue_flip;
 		break;
 	case 9:
-		dev_priv->display.queue_flip = intel_gen9_queue_flip;
-		break;
+		/* Drop through - unsupported since execlist only. */
+	default:
+		/* Default just returns -ENODEV to indicate unsupported */
+		dev_priv->display.queue_flip = intel_default_queue_flip;
 	}
 
 	intel_panel_init_backlight_funcs(dev);
-- 
2.2.2

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

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

* [PATCH 10/13] drm/i915/skl: Use fb modifiers for sprites
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (8 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 09/13] drm/i915/skl: CS flips are not supported with execlists Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-11  7:47     ` Daniel Vetter
  2015-02-10 17:16   ` [PATCH 11/13] drm/i915: Use fb modifiers in intel_check_cursor_plane Tvrtko Ursulin
                     ` (2 subsequent siblings)
  12 siblings, 1 reply; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_sprite.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 0a52c44..9e6f0e5 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -245,11 +245,11 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,
 		BUG();
 	}
 
-	switch (obj->tiling_mode) {
-	case I915_TILING_NONE:
+	switch (fb->modifier[0]) {
+	case DRM_FORMAT_MOD_NONE:
 		stride = fb->pitches[0] >> 6;
 		break;
-	case I915_TILING_X:
+	case I915_FORMAT_MOD_X_TILED:
 		plane_ctl |= PLANE_CTL_TILED_X;
 		stride = fb->pitches[0] >> 9;
 		break;
@@ -1076,7 +1076,6 @@ intel_check_sprite_plane(struct drm_plane *plane,
 	struct intel_crtc *intel_crtc = to_intel_crtc(state->base.crtc);
 	struct intel_plane *intel_plane = to_intel_plane(plane);
 	struct drm_framebuffer *fb = state->base.fb;
-	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
 	int crtc_x, crtc_y;
 	unsigned int crtc_w, crtc_h;
 	uint32_t src_x, src_y, src_w, src_h;
@@ -1107,9 +1106,9 @@ intel_check_sprite_plane(struct drm_plane *plane,
 	}
 
 	/* Sprite planes can be linear or x-tiled surfaces */
-	switch (obj->tiling_mode) {
-		case I915_TILING_NONE:
-		case I915_TILING_X:
+	switch (fb->modifier[0]) {
+		case DRM_FORMAT_MOD_NONE:
+		case I915_FORMAT_MOD_X_TILED:
 			break;
 		default:
 			DRM_DEBUG_KMS("Unsupported tiling mode\n");
-- 
2.2.2

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

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

* [PATCH 11/13] drm/i915: Use fb modifiers in intel_check_cursor_plane
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (9 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 10/13] drm/i915/skl: Use fb modifiers for sprites Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-11  7:53     ` Daniel Vetter
  2015-02-10 17:16   ` [PATCH 12/13] drm/i915: Use fb modifiers in intel_pin_and_fence_fb_obj Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers Tvrtko Ursulin
  12 siblings, 1 reply; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Also drop the mutex since with universal planes object tiling mode is
locked down while assigned to a framebuffer.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 38c2909..edd6cfe 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12175,12 +12175,11 @@ intel_check_cursor_plane(struct drm_plane *plane,
 		return 0;
 
 	/* we only need to pin inside GTT if cursor is non-phy */
-	mutex_lock(&dev->struct_mutex);
-	if (!INTEL_INFO(dev)->cursor_needs_physical && obj->tiling_mode) {
+	if (!INTEL_INFO(dev)->cursor_needs_physical &&
+	    fb->modifier[0] != DRM_FORMAT_MOD_NONE) {
 		DRM_DEBUG_KMS("cursor cannot be tiled\n");
 		ret = -EINVAL;
 	}
-	mutex_unlock(&dev->struct_mutex);
 
 finish:
 	if (intel_crtc->active) {
-- 
2.2.2

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

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

* [PATCH 12/13] drm/i915: Use fb modifiers in intel_pin_and_fence_fb_obj
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (10 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 11/13] drm/i915: Use fb modifiers in intel_check_cursor_plane Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-10 17:16   ` [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers Tvrtko Ursulin
  12 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

And at the same time replace BUG() with a warning and handle it gracefuly.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index edd6cfe..e5e9221 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2215,8 +2215,8 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
 
 	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
-	switch (obj->tiling_mode) {
-	case I915_TILING_NONE:
+	switch (fb->modifier[0]) {
+	case DRM_FORMAT_MOD_NONE:
 		if (INTEL_INFO(dev)->gen >= 9)
 			alignment = 256 * 1024;
 		else if (IS_BROADWATER(dev) || IS_CRESTLINE(dev))
@@ -2226,7 +2226,7 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
 		else
 			alignment = 64 * 1024;
 		break;
-	case I915_TILING_X:
+	case I915_FORMAT_MOD_X_TILED:
 		if (INTEL_INFO(dev)->gen >= 9)
 			alignment = 256 * 1024;
 		else {
@@ -2234,11 +2234,12 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
 			alignment = 0;
 		}
 		break;
-	case I915_TILING_Y:
+	case I915_FORMAT_MOD_Y_TILED:
 		WARN(1, "Y tiled bo slipped through, driver bug!\n");
 		return -EINVAL;
 	default:
-		BUG();
+		MISSING_CASE(fb->modifier[0]);
+		return -EINVAL;
 	}
 
 	/* Note that the w/a also requires 64 PTE of padding following the
-- 
2.2.2

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

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

* [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers
  2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
                     ` (11 preceding siblings ...)
  2015-02-10 17:16   ` [PATCH 12/13] drm/i915: Use fb modifiers in intel_pin_and_fence_fb_obj Tvrtko Ursulin
@ 2015-02-10 17:16   ` Tvrtko Ursulin
  2015-02-11  2:46     ` shuang.he
  2015-02-11  7:58     ` Daniel Vetter
  12 siblings, 2 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-10 17:16 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Daniel Vetter

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Let the DRM core know we can handle it.

v2: Change to boolean true. (Daniel Vetter)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e5e9221..0f2a6c7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13172,6 +13172,8 @@ void intel_modeset_init(struct drm_device *dev)
 	dev->mode_config.preferred_depth = 24;
 	dev->mode_config.prefer_shadow = 1;
 
+	dev->mode_config.allow_fb_modifiers = true;
+
 	dev->mode_config.funcs = &intel_mode_funcs;
 
 	intel_init_quirks(dev);
-- 
2.2.2

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

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

* Re: [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers
  2015-02-10 17:16   ` [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers Tvrtko Ursulin
@ 2015-02-11  2:46     ` shuang.he
  2015-02-11  7:56       ` Daniel Vetter
  2015-02-11  7:58     ` Daniel Vetter
  1 sibling, 1 reply; 42+ messages in thread
From: shuang.he @ 2015-02-11  2:46 UTC (permalink / raw)
  To: shuang.he, ethan.gao, intel-gfx, tvrtko.ursulin

Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 5750
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV              +5-4              275/283              276/283
ILK                                  310/315              310/315
SNB              +3-1              320/346              322/346
IVB                 -1              380/384              379/384
BYT                                  296/296              296/296
HSW              +3-1              422/428              424/428
BDW                                  318/333              318/333
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*PNV  igt_gem_fence_thrash_bo-write-verify-none      PASS(3, M7)      FAIL(1, M7)
*PNV  igt_gem_fence_thrash_bo-write-verify-x      PASS(3, M7)      FAIL(1, M7)
*PNV  igt_gem_fence_thrash_bo-write-verify-y      PASS(4, M7)      FAIL(1, M7)
 PNV  igt_gem_userptr_blits_create-destroy-sync      NRUN(1, M7)PASS(6, M7)      PASS(1, M7)
 PNV  igt_gen3_render_linear_blits      FAIL(2, M7)PASS(2, M7)      PASS(1, M7)
 PNV  igt_gen3_render_mixed_blits      FAIL(2, M7)PASS(2, M7)      PASS(1, M7)
 PNV  igt_gen3_render_tiledx_blits      FAIL(2, M7)TIMEOUT(1, M7)PASS(4, M7)      PASS(1, M7)
 PNV  igt_gen3_render_tiledy_blits      FAIL(3, M7)PASS(2, M7)      PASS(1, M7)
*PNV  igt_gem_tiled_pread_pwrite      PASS(4, M7)      FAIL(1, M7)
*SNB  igt_kms_flip_bo-too-big      BLACKLIST(1, M35)      PASS(1, M35)
*SNB  igt_kms_flip_bo-too-big-interruptible      BLACKLIST(1, M35)      PASS(1, M35)
*SNB  igt_kms_flip_event_leak      NSPT(5, M35)      PASS(1, M35)
*SNB  igt_kms_flip_tiling_flip-changes-tiling      PASS(2, M35)      FAIL(1, M35)
 IVB  igt_gem_storedw_batches_loop_normal      DMESG_WARN(1, M4)PASS(4, M4)      DMESG_WARN(1, M4)
*HSW  igt_gem_pwrite_pread_snooped-pwrite-blt-cpu_mmap-performance      PASS(3, M40)      DMESG_WARN(1, M40)
*HSW  igt_kms_flip_bo-too-big      BLACKLIST(1, M40)      PASS(1, M40)
*HSW  igt_kms_flip_bo-too-big-interruptible      BLACKLIST(1, M40)      PASS(1, M40)
 HSW  igt_kms_flip_plain-flip-fb-recreate-interruptible      TIMEOUT(5, M40)PASS(3, M40)      PASS(1, M40)
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] 42+ messages in thread

* Re: [PATCH 04/13] drm/i915: Show frame buffer modifier in debug info
  2015-02-10 17:16   ` [PATCH 04/13] drm/i915: Show frame buffer modifier in debug info Tvrtko Ursulin
@ 2015-02-11  7:34     ` Daniel Vetter
  0 siblings, 0 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-11  7:34 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Intel-gfx

On Tue, Feb 10, 2015 at 05:16:07PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 2e1f723..164fa82 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1778,11 +1778,12 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
>  	ifbdev = dev_priv->fbdev;
>  	fb = to_intel_framebuffer(ifbdev->helper.fb);
>  
> -	seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, refcount %d, obj ",
> +	seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, modifier 0x%llx, refcount %d, obj ",
>  		   fb->base.width,
>  		   fb->base.height,
>  		   fb->base.depth,
>  		   fb->base.bits_per_pixel,
> +		   fb->base.modifier[0],
>  		   atomic_read(&fb->base.refcount.refcount));
>  	describe_obj(m, fb->obj);
>  	seq_putc(m, '\n');
> @@ -1793,11 +1794,12 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
>  		if (ifbdev && &fb->base == ifbdev->helper.fb)
>  			continue;
>  
> -		seq_printf(m, "user size: %d x %d, depth %d, %d bpp, refcount %d, obj ",
> +		seq_printf(m, "user size: %d x %d, depth %d, %d bpp, modifier 0x%llx, refcount %d, obj ",
>  			   fb->base.width,
>  			   fb->base.height,
>  			   fb->base.depth,
>  			   fb->base.bits_per_pixel,
> +			   fb->base.modifier[0],

Just an aside, in case you get around to decoding modifiers: We should
probably switch to printing the fourcc code and decode that while at it.
And perhaps print the stride too, since with the new tiling there will be
no underlying fence any more to guess the stride.

Perhaps we need a describe_fb helper to keep this manageble, too.
-Daniel

>  			   atomic_read(&fb->base.refcount.refcount));
>  		describe_obj(m, fb->obj);
>  		seq_putc(m, '\n');
> -- 
> 2.2.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 09/13] drm/i915/skl: CS flips are not supported with execlists
  2015-02-10 17:16   ` [PATCH 09/13] drm/i915/skl: CS flips are not supported with execlists Tvrtko Ursulin
@ 2015-02-11  7:40     ` Daniel Vetter
  2015-02-11  9:58       ` Tvrtko Ursulin
  0 siblings, 1 reply; 42+ messages in thread
From: Daniel Vetter @ 2015-02-11  7:40 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Intel-gfx

On Tue, Feb 10, 2015 at 05:16:12PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Therefore remove dead code.

Commit message should state that skl requires execlist, otherwise it's not
really clear why this is dead code. I've added that.
-Daniel

> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 72 ++----------------------------------
>  1 file changed, 4 insertions(+), 68 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index df47031..38c2909 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9632,69 +9632,6 @@ static int intel_queue_mmio_flip(struct drm_device *dev,
>  	return 0;
>  }
>  
> -static int intel_gen9_queue_flip(struct drm_device *dev,
> -				 struct drm_crtc *crtc,
> -				 struct drm_framebuffer *fb,
> -				 struct drm_i915_gem_object *obj,
> -				 struct intel_engine_cs *ring,
> -				 uint32_t flags)
> -{
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> -	uint32_t plane = 0, stride;
> -	int ret;
> -
> -	switch(intel_crtc->pipe) {
> -	case PIPE_A:
> -		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_A;
> -		break;
> -	case PIPE_B:
> -		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_B;
> -		break;
> -	case PIPE_C:
> -		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_C;
> -		break;
> -	default:
> -		WARN_ONCE(1, "unknown plane in flip command\n");
> -		return -ENODEV;
> -	}
> -
> -	switch (obj->tiling_mode) {
> -	case I915_TILING_NONE:
> -		stride = fb->pitches[0] >> 6;
> -		break;
> -	case I915_TILING_X:
> -		stride = fb->pitches[0] >> 9;
> -		break;
> -	default:
> -		WARN_ONCE(1, "unknown tiling in flip command\n");
> -		return -ENODEV;
> -	}
> -
> -	ret = intel_ring_begin(ring, 10);
> -	if (ret)
> -		return ret;
> -
> -	intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));
> -	intel_ring_emit(ring, DERRMR);
> -	intel_ring_emit(ring, ~(DERRMR_PIPEA_PRI_FLIP_DONE |
> -				DERRMR_PIPEB_PRI_FLIP_DONE |
> -				DERRMR_PIPEC_PRI_FLIP_DONE));
> -	intel_ring_emit(ring, MI_STORE_REGISTER_MEM_GEN8(1) |
> -			      MI_SRM_LRM_GLOBAL_GTT);
> -	intel_ring_emit(ring, DERRMR);
> -	intel_ring_emit(ring, ring->scratch.gtt_offset + 256);
> -	intel_ring_emit(ring, 0);
> -
> -	intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane);
> -	intel_ring_emit(ring, stride << 6 | obj->tiling_mode);
> -	intel_ring_emit(ring, intel_crtc->unpin_work->gtt_offset);
> -
> -	intel_mark_page_flip_active(intel_crtc);
> -	__intel_ring_advance(ring);
> -
> -	return 0;
> -}
> -
>  static int intel_default_queue_flip(struct drm_device *dev,
>  				    struct drm_crtc *crtc,
>  				    struct drm_framebuffer *fb,
> @@ -12994,9 +12931,6 @@ static void intel_init_display(struct drm_device *dev)
>  			valleyview_modeset_global_resources;
>  	}
>  
> -	/* Default just returns -ENODEV to indicate unsupported */
> -	dev_priv->display.queue_flip = intel_default_queue_flip;
> -
>  	switch (INTEL_INFO(dev)->gen) {
>  	case 2:
>  		dev_priv->display.queue_flip = intel_gen2_queue_flip;
> @@ -13019,8 +12953,10 @@ static void intel_init_display(struct drm_device *dev)
>  		dev_priv->display.queue_flip = intel_gen7_queue_flip;
>  		break;
>  	case 9:
> -		dev_priv->display.queue_flip = intel_gen9_queue_flip;
> -		break;
> +		/* Drop through - unsupported since execlist only. */
> +	default:
> +		/* Default just returns -ENODEV to indicate unsupported */
> +		dev_priv->display.queue_flip = intel_default_queue_flip;
>  	}
>  
>  	intel_panel_init_backlight_funcs(dev);
> -- 
> 2.2.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 10/13] drm/i915/skl: Use fb modifiers for sprites
  2015-02-10 17:16   ` [PATCH 10/13] drm/i915/skl: Use fb modifiers for sprites Tvrtko Ursulin
@ 2015-02-11  7:47     ` Daniel Vetter
  0 siblings, 0 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-11  7:47 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Intel-gfx

On Tue, Feb 10, 2015 at 05:16:13PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_sprite.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 0a52c44..9e6f0e5 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -245,11 +245,11 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,
>  		BUG();
>  	}
>  
> -	switch (obj->tiling_mode) {
> -	case I915_TILING_NONE:
> +	switch (fb->modifier[0]) {
> +	case DRM_FORMAT_MOD_NONE:
>  		stride = fb->pitches[0] >> 6;
>  		break;
> -	case I915_TILING_X:
> +	case I915_FORMAT_MOD_X_TILED:
>  		plane_ctl |= PLANE_CTL_TILED_X;
>  		stride = fb->pitches[0] >> 9;
>  		break;
> @@ -1076,7 +1076,6 @@ intel_check_sprite_plane(struct drm_plane *plane,
>  	struct intel_crtc *intel_crtc = to_intel_crtc(state->base.crtc);
>  	struct intel_plane *intel_plane = to_intel_plane(plane);
>  	struct drm_framebuffer *fb = state->base.fb;
> -	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
>  	int crtc_x, crtc_y;
>  	unsigned int crtc_w, crtc_h;
>  	uint32_t src_x, src_y, src_w, src_h;
> @@ -1107,9 +1106,9 @@ intel_check_sprite_plane(struct drm_plane *plane,
>  	}
>  
>  	/* Sprite planes can be linear or x-tiled surfaces */
> -	switch (obj->tiling_mode) {
> -		case I915_TILING_NONE:
> -		case I915_TILING_X:
> +	switch (fb->modifier[0]) {
> +		case DRM_FORMAT_MOD_NONE:
> +		case I915_FORMAT_MOD_X_TILED:

This check here is redundant (framebuffer_init checks this too), so I've
removed it.
-Daniel

>  			break;
>  		default:
>  			DRM_DEBUG_KMS("Unsupported tiling mode\n");
> -- 
> 2.2.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 11/13] drm/i915: Use fb modifiers in intel_check_cursor_plane
  2015-02-10 17:16   ` [PATCH 11/13] drm/i915: Use fb modifiers in intel_check_cursor_plane Tvrtko Ursulin
@ 2015-02-11  7:53     ` Daniel Vetter
  0 siblings, 0 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-11  7:53 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Intel-gfx

On Tue, Feb 10, 2015 at 05:16:14PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Also drop the mutex since with universal planes object tiling mode is
> locked down while assigned to a framebuffer.

I've clarified this to say that universal implies fb exists, and that
implies the tiling is locked down.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 38c2909..edd6cfe 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12175,12 +12175,11 @@ intel_check_cursor_plane(struct drm_plane *plane,
>  		return 0;
>  
>  	/* we only need to pin inside GTT if cursor is non-phy */
> -	mutex_lock(&dev->struct_mutex);
> -	if (!INTEL_INFO(dev)->cursor_needs_physical && obj->tiling_mode) {
> +	if (!INTEL_INFO(dev)->cursor_needs_physical &&

I've dropped the cursor_needs_physical check here too because it doesn't
make a lot of sense really. Tiled cursors really don't make any sense at
all.
-Daniel

> +	    fb->modifier[0] != DRM_FORMAT_MOD_NONE) {
>  		DRM_DEBUG_KMS("cursor cannot be tiled\n");
>  		ret = -EINVAL;
>  	}
> -	mutex_unlock(&dev->struct_mutex);
>  
>  finish:
>  	if (intel_crtc->active) {
> -- 
> 2.2.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers
  2015-02-11  2:46     ` shuang.he
@ 2015-02-11  7:56       ` Daniel Vetter
  0 siblings, 0 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-11  7:56 UTC (permalink / raw)
  To: shuang.he; +Cc: intel-gfx

On Tue, Feb 10, 2015 at 06:46:39PM -0800, shuang.he@intel.com wrote:
> Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
> Task id: 5750
> -------------------------------------Summary-------------------------------------
> Platform          Delta          drm-intel-nightly          Series Applied
> PNV              +5-4              275/283              276/283
> ILK                                  310/315              310/315
> SNB              +3-1              320/346              322/346
> IVB                 -1              380/384              379/384
> BYT                                  296/296              296/296
> HSW              +3-1              422/428              424/428
> BDW                                  318/333              318/333
> -------------------------------------Detailed-------------------------------------
> Platform  Test                                drm-intel-nightly          Series Applied
> *PNV  igt_gem_fence_thrash_bo-write-verify-none      PASS(3, M7)      FAIL(1, M7)
> *PNV  igt_gem_fence_thrash_bo-write-verify-x      PASS(3, M7)      FAIL(1, M7)
> *PNV  igt_gem_fence_thrash_bo-write-verify-y      PASS(4, M7)      FAIL(1, M7)
>  PNV  igt_gem_userptr_blits_create-destroy-sync      NRUN(1, M7)PASS(6, M7)      PASS(1, M7)
>  PNV  igt_gen3_render_linear_blits      FAIL(2, M7)PASS(2, M7)      PASS(1, M7)
>  PNV  igt_gen3_render_mixed_blits      FAIL(2, M7)PASS(2, M7)      PASS(1, M7)
>  PNV  igt_gen3_render_tiledx_blits      FAIL(2, M7)TIMEOUT(1, M7)PASS(4, M7)      PASS(1, M7)
>  PNV  igt_gen3_render_tiledy_blits      FAIL(3, M7)PASS(2, M7)      PASS(1, M7)
> *PNV  igt_gem_tiled_pread_pwrite      PASS(4, M7)      FAIL(1, M7)
> *SNB  igt_kms_flip_bo-too-big      BLACKLIST(1, M35)      PASS(1, M35)
> *SNB  igt_kms_flip_bo-too-big-interruptible      BLACKLIST(1, M35)      PASS(1, M35)
> *SNB  igt_kms_flip_event_leak      NSPT(5, M35)      PASS(1, M35)
> *SNB  igt_kms_flip_tiling_flip-changes-tiling      PASS(2, M35)      FAIL(1, M35)
>  IVB  igt_gem_storedw_batches_loop_normal      DMESG_WARN(1, M4)PASS(4, M4)      DMESG_WARN(1, M4)
> *HSW  igt_gem_pwrite_pread_snooped-pwrite-blt-cpu_mmap-performance      PASS(3, M40)      DMESG_WARN(1, M40)
> *HSW  igt_kms_flip_bo-too-big      BLACKLIST(1, M40)      PASS(1, M40)
> *HSW  igt_kms_flip_bo-too-big-interruptible      BLACKLIST(1, M40)      PASS(1, M40)

Why does PRTS report BLACKLIST -> PASS changes in the public test results?
Can you please fix that of if it's more involved create a JIRA for it?

Thanks, Daniel

>  HSW  igt_kms_flip_plain-flip-fb-recreate-interruptible      TIMEOUT(5, M40)PASS(3, M40)      PASS(1, M40)
> 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

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers
  2015-02-10 17:16   ` [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers Tvrtko Ursulin
  2015-02-11  2:46     ` shuang.he
@ 2015-02-11  7:58     ` Daniel Vetter
  2015-02-11  9:57       ` Tvrtko Ursulin
  1 sibling, 1 reply; 42+ messages in thread
From: Daniel Vetter @ 2015-02-11  7:58 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Daniel Vetter, Intel-gfx

On Tue, Feb 10, 2015 at 05:16:16PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Let the DRM core know we can handle it.
> 
> v2: Change to boolean true. (Daniel Vetter)
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

All merged except for the drm core patch - I'll do some testcases for that
one first.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index e5e9221..0f2a6c7 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13172,6 +13172,8 @@ void intel_modeset_init(struct drm_device *dev)
>  	dev->mode_config.preferred_depth = 24;
>  	dev->mode_config.prefer_shadow = 1;
>  
> +	dev->mode_config.allow_fb_modifiers = true;
> +
>  	dev->mode_config.funcs = &intel_mode_funcs;
>  
>  	intel_init_quirks(dev);
> -- 
> 2.2.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers
  2015-02-11  7:58     ` Daniel Vetter
@ 2015-02-11  9:57       ` Tvrtko Ursulin
  2015-02-11 10:25         ` Daniel Vetter
  0 siblings, 1 reply; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-11  9:57 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel-gfx


On 02/11/2015 07:58 AM, Daniel Vetter wrote:
> On Tue, Feb 10, 2015 at 05:16:16PM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Let the DRM core know we can handle it.
>>
>> v2: Change to boolean true. (Daniel Vetter)
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> All merged except for the drm core patch - I'll do some testcases for that
> one first.

I wanted to ask how it will compile then but saw it is already in nightly.

Regards,

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

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

* Re: [PATCH 09/13] drm/i915/skl: CS flips are not supported with execlists
  2015-02-11  7:40     ` Daniel Vetter
@ 2015-02-11  9:58       ` Tvrtko Ursulin
  0 siblings, 0 replies; 42+ messages in thread
From: Tvrtko Ursulin @ 2015-02-11  9:58 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel-gfx


On 02/11/2015 07:40 AM, Daniel Vetter wrote:
> On Tue, Feb 10, 2015 at 05:16:12PM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Therefore remove dead code.
>
> Commit message should state that skl requires execlist, otherwise it's not
> really clear why this is dead code. I've added that.

Ah yes, don't know how I forgot to put that in. Sorry and thanks for 
fixing it up.

Regards,

Tvrtko

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

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

* Re: [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers
  2015-02-11  9:57       ` Tvrtko Ursulin
@ 2015-02-11 10:25         ` Daniel Vetter
  0 siblings, 0 replies; 42+ messages in thread
From: Daniel Vetter @ 2015-02-11 10:25 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Daniel Vetter, Intel-gfx

On Wed, Feb 11, 2015 at 09:57:09AM +0000, Tvrtko Ursulin wrote:
> 
> On 02/11/2015 07:58 AM, Daniel Vetter wrote:
> >On Tue, Feb 10, 2015 at 05:16:16PM +0000, Tvrtko Ursulin wrote:
> >>From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >>
> >>Let the DRM core know we can handle it.
> >>
> >>v2: Change to boolean true. (Daniel Vetter)
> >>
> >>Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >
> >All merged except for the drm core patch - I'll do some testcases for that
> >one first.
> 
> I wanted to ask how it will compile then but saw it is already in nightly.

I've meant "drm: Also check unused fields for addfb2" since the basic
modifier patch landed already. I wasn't really clear.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-02-11 10:24 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-09 18:03 [PATCH 0/5] i915 fb modifier support, respun Daniel Vetter
2015-02-09 18:03 ` [PATCH 1/5] drm/i915: Add tiled framebuffer modifiers Daniel Vetter
2015-02-10 11:05   ` Tvrtko Ursulin
2015-02-10 11:28   ` [PATCH] " Daniel Vetter
2015-02-10 16:16     ` shuang.he
2015-02-10 11:50   ` [PATCH] drm/i915: Add fb format modifier support Daniel Vetter
2015-02-09 18:03 ` [PATCH 2/5] " Daniel Vetter
2015-02-10 11:09   ` Tvrtko Ursulin
2015-02-10 11:28   ` [PATCH] " Daniel Vetter
2015-02-09 18:03 ` [PATCH 3/5] drm/i915: Use fb format modifiers in skylake_update_primary_plane Daniel Vetter
2015-02-10 16:25   ` Damien Lespiau
2015-02-09 18:03 ` [PATCH 4/5] drm/i915: Announce support for framebuffer modifiers Daniel Vetter
2015-02-09 18:03 ` [PATCH 5/5] drm: Also check unused fields for addfb2 Daniel Vetter
2015-02-10 10:56   ` [PATCH 1/2] drm/i915: Set up fb format modifier for initial plane config Daniel Vetter
2015-02-10 10:56     ` [PATCH 2/2] drm/i915: Switch +intel_fb_align_height to fb format modifiers Daniel Vetter
2015-02-10 11:01   ` [PATCH 5/5] drm: Also check unused fields for addfb2 Chris Wilson
2015-02-10 11:36     ` Daniel Vetter
2015-02-10 11:51       ` Chris Wilson
2015-02-10 17:16 ` [PATCH v2 00/13] i915 fb modifier support, respun Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 01/13] RFC: drm: add support for tiled/compressed/etc modifier in addfb2 Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 02/13] drm/i915: Add tiled framebuffer modifiers Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 03/13] drm/i915: Add fb format modifier support Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 04/13] drm/i915: Show frame buffer modifier in debug info Tvrtko Ursulin
2015-02-11  7:34     ` Daniel Vetter
2015-02-10 17:16   ` [PATCH 05/13] drm: Also check unused fields for addfb2 Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 06/13] drm/i915: Set up fb format modifier for initial plane config Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 07/13] drm/i915: Switch +intel_fb_align_height to fb format modifiers Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 08/13] drm/i915: Use fb format modifiers in skylake_update_primary_plane Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 09/13] drm/i915/skl: CS flips are not supported with execlists Tvrtko Ursulin
2015-02-11  7:40     ` Daniel Vetter
2015-02-11  9:58       ` Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 10/13] drm/i915/skl: Use fb modifiers for sprites Tvrtko Ursulin
2015-02-11  7:47     ` Daniel Vetter
2015-02-10 17:16   ` [PATCH 11/13] drm/i915: Use fb modifiers in intel_check_cursor_plane Tvrtko Ursulin
2015-02-11  7:53     ` Daniel Vetter
2015-02-10 17:16   ` [PATCH 12/13] drm/i915: Use fb modifiers in intel_pin_and_fence_fb_obj Tvrtko Ursulin
2015-02-10 17:16   ` [PATCH 13/13] drm/i915: Announce support for framebuffer modifiers Tvrtko Ursulin
2015-02-11  2:46     ` shuang.he
2015-02-11  7:56       ` Daniel Vetter
2015-02-11  7:58     ` Daniel Vetter
2015-02-11  9:57       ` Tvrtko Ursulin
2015-02-11 10:25         ` Daniel Vetter

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.