diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-10 12:16:09 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-13 17:28:18 -0500 |
commit | 18c5247e1e96d657334dabd8ab611001f16a62b0 (patch) | |
tree | 32ce0fc425262da11abcc7f120a02314b6967295 | |
parent | c1ca506d173bdbadffce95e1f67ac86a08e9db03 (diff) |
drm/i915: Set up fb format modifier for initial plane config
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.
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index da827568671e..85274906f686 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, | |||
2390 | mode_cmd.width = fb->width; | 2390 | mode_cmd.width = fb->width; |
2391 | mode_cmd.height = fb->height; | 2391 | mode_cmd.height = fb->height; |
2392 | mode_cmd.pitches[0] = fb->pitches[0]; | 2392 | mode_cmd.pitches[0] = fb->pitches[0]; |
2393 | mode_cmd.modifier[0] = fb->modifier[0]; | ||
2394 | mode_cmd.flags = DRM_MODE_FB_MODIFIERS; | ||
2393 | 2395 | ||
2394 | mutex_lock(&dev->struct_mutex); | 2396 | mutex_lock(&dev->struct_mutex); |
2395 | 2397 | ||
@@ -6624,9 +6626,12 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, | |||
6624 | 6626 | ||
6625 | fb = &intel_fb->base; | 6627 | fb = &intel_fb->base; |
6626 | 6628 | ||
6627 | if (INTEL_INFO(dev)->gen >= 4) | 6629 | if (INTEL_INFO(dev)->gen >= 4) { |
6628 | if (val & DISPPLANE_TILED) | 6630 | if (val & DISPPLANE_TILED) { |
6629 | plane_config->tiling = I915_TILING_X; | 6631 | plane_config->tiling = I915_TILING_X; |
6632 | fb->modifier[0] = I915_FORMAT_MOD_X_TILED; | ||
6633 | } | ||
6634 | } | ||
6630 | 6635 | ||
6631 | pixel_format = val & DISPPLANE_PIXFORMAT_MASK; | 6636 | pixel_format = val & DISPPLANE_PIXFORMAT_MASK; |
6632 | fourcc = i9xx_format_to_fourcc(pixel_format); | 6637 | fourcc = i9xx_format_to_fourcc(pixel_format); |
@@ -7658,8 +7663,10 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, | |||
7658 | if (!(val & PLANE_CTL_ENABLE)) | 7663 | if (!(val & PLANE_CTL_ENABLE)) |
7659 | goto error; | 7664 | goto error; |
7660 | 7665 | ||
7661 | if (val & PLANE_CTL_TILED_MASK) | 7666 | if (val & PLANE_CTL_TILED_MASK) { |
7662 | plane_config->tiling = I915_TILING_X; | 7667 | plane_config->tiling = I915_TILING_X; |
7668 | fb->modifier[0] = I915_FORMAT_MOD_X_TILED; | ||
7669 | } | ||
7663 | 7670 | ||
7664 | pixel_format = val & PLANE_CTL_FORMAT_MASK; | 7671 | pixel_format = val & PLANE_CTL_FORMAT_MASK; |
7665 | fourcc = skl_format_to_fourcc(pixel_format, | 7672 | fourcc = skl_format_to_fourcc(pixel_format, |
@@ -7757,9 +7764,12 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc, | |||
7757 | 7764 | ||
7758 | fb = &intel_fb->base; | 7765 | fb = &intel_fb->base; |
7759 | 7766 | ||
7760 | if (INTEL_INFO(dev)->gen >= 4) | 7767 | if (INTEL_INFO(dev)->gen >= 4) { |
7761 | if (val & DISPPLANE_TILED) | 7768 | if (val & DISPPLANE_TILED) { |
7762 | plane_config->tiling = I915_TILING_X; | 7769 | plane_config->tiling = I915_TILING_X; |
7770 | fb->modifier[0] = I915_FORMAT_MOD_X_TILED; | ||
7771 | } | ||
7772 | } | ||
7763 | 7773 | ||
7764 | pixel_format = val & DISPPLANE_PIXFORMAT_MASK; | 7774 | pixel_format = val & DISPPLANE_PIXFORMAT_MASK; |
7765 | fourcc = i9xx_format_to_fourcc(pixel_format); | 7775 | fourcc = i9xx_format_to_fourcc(pixel_format); |