aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2015-01-20 07:51:44 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-27 03:51:00 -0500
commit49af449b457b721ac5c18f537cf7484903f212f8 (patch)
treef5625a5ee2290d06a617e15b8e9cdc465dc522b1 /drivers/gpu/drm/i915/intel_display.c
parent38c2352716ec6bab1adb8e36428da907c9dfaac3 (diff)
drm/i915: Change plane_config to store a tiling_mode
Rather than having "tiled" meaning "is it X-tiled?" convert the field to explicitely store the tiling mode. The code doesn't have to change much as 1 is conveniently I915_TILING_X. This is to accommodate future changes around tiling modes and scannout buffers. v2: Rebase on top of Ander's "Make intel_crtc->config a pointer" Reviewed-By: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v1) Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8c5dfec98de1..98cd20adac1f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2352,10 +2352,9 @@ static bool intel_alloc_plane_obj(struct intel_crtc *crtc,
2352 if (!obj) 2352 if (!obj)
2353 return false; 2353 return false;
2354 2354
2355 if (plane_config->tiled) { 2355 obj->tiling_mode = plane_config->tiling;
2356 obj->tiling_mode = I915_TILING_X; 2356 if (obj->tiling_mode == I915_TILING_X)
2357 obj->stride = crtc->base.primary->fb->pitches[0]; 2357 obj->stride = crtc->base.primary->fb->pitches[0];
2358 }
2359 2358
2360 mode_cmd.pixel_format = crtc->base.primary->fb->pixel_format; 2359 mode_cmd.pixel_format = crtc->base.primary->fb->pixel_format;
2361 mode_cmd.width = crtc->base.primary->fb->width; 2360 mode_cmd.width = crtc->base.primary->fb->width;
@@ -6565,7 +6564,7 @@ static void i9xx_get_plane_config(struct intel_crtc *crtc,
6565 6564
6566 if (INTEL_INFO(dev)->gen >= 4) 6565 if (INTEL_INFO(dev)->gen >= 4)
6567 if (val & DISPPLANE_TILED) 6566 if (val & DISPPLANE_TILED)
6568 plane_config->tiled = true; 6567 plane_config->tiling = I915_TILING_X;
6569 6568
6570 pixel_format = val & DISPPLANE_PIXFORMAT_MASK; 6569 pixel_format = val & DISPPLANE_PIXFORMAT_MASK;
6571 fourcc = intel_format_to_fourcc(pixel_format); 6570 fourcc = intel_format_to_fourcc(pixel_format);
@@ -6574,7 +6573,7 @@ static void i9xx_get_plane_config(struct intel_crtc *crtc,
6574 drm_format_plane_cpp(fourcc, 0) * 8; 6573 drm_format_plane_cpp(fourcc, 0) * 8;
6575 6574
6576 if (INTEL_INFO(dev)->gen >= 4) { 6575 if (INTEL_INFO(dev)->gen >= 4) {
6577 if (plane_config->tiled) 6576 if (plane_config->tiling)
6578 offset = I915_READ(DSPTILEOFF(plane)); 6577 offset = I915_READ(DSPTILEOFF(plane));
6579 else 6578 else
6580 offset = I915_READ(DSPLINOFF(plane)); 6579 offset = I915_READ(DSPLINOFF(plane));
@@ -6592,7 +6591,7 @@ static void i9xx_get_plane_config(struct intel_crtc *crtc,
6592 crtc->base.primary->fb->pitches[0] = val & 0xffffffc0; 6591 crtc->base.primary->fb->pitches[0] = val & 0xffffffc0;
6593 6592
6594 aligned_height = intel_align_height(dev, crtc->base.primary->fb->height, 6593 aligned_height = intel_align_height(dev, crtc->base.primary->fb->height,
6595 plane_config->tiled); 6594 plane_config->tiling);
6596 6595
6597 plane_config->size = PAGE_ALIGN(crtc->base.primary->fb->pitches[0] * 6596 plane_config->size = PAGE_ALIGN(crtc->base.primary->fb->pitches[0] *
6598 aligned_height); 6597 aligned_height);
@@ -7619,7 +7618,7 @@ static void ironlake_get_plane_config(struct intel_crtc *crtc,
7619 7618
7620 if (INTEL_INFO(dev)->gen >= 4) 7619 if (INTEL_INFO(dev)->gen >= 4)
7621 if (val & DISPPLANE_TILED) 7620 if (val & DISPPLANE_TILED)
7622 plane_config->tiled = true; 7621 plane_config->tiling = I915_TILING_X;
7623 7622
7624 pixel_format = val & DISPPLANE_PIXFORMAT_MASK; 7623 pixel_format = val & DISPPLANE_PIXFORMAT_MASK;
7625 fourcc = intel_format_to_fourcc(pixel_format); 7624 fourcc = intel_format_to_fourcc(pixel_format);
@@ -7631,7 +7630,7 @@ static void ironlake_get_plane_config(struct intel_crtc *crtc,
7631 if (IS_HASWELL(dev) || IS_BROADWELL(dev)) { 7630 if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
7632 offset = I915_READ(DSPOFFSET(plane)); 7631 offset = I915_READ(DSPOFFSET(plane));
7633 } else { 7632 } else {
7634 if (plane_config->tiled) 7633 if (plane_config->tiling)
7635 offset = I915_READ(DSPTILEOFF(plane)); 7634 offset = I915_READ(DSPTILEOFF(plane));
7636 else 7635 else
7637 offset = I915_READ(DSPLINOFF(plane)); 7636 offset = I915_READ(DSPLINOFF(plane));
@@ -7646,7 +7645,7 @@ static void ironlake_get_plane_config(struct intel_crtc *crtc,
7646 crtc->base.primary->fb->pitches[0] = val & 0xffffffc0; 7645 crtc->base.primary->fb->pitches[0] = val & 0xffffffc0;
7647 7646
7648 aligned_height = intel_align_height(dev, crtc->base.primary->fb->height, 7647 aligned_height = intel_align_height(dev, crtc->base.primary->fb->height,
7649 plane_config->tiled); 7648 plane_config->tiling);
7650 7649
7651 plane_config->size = PAGE_ALIGN(crtc->base.primary->fb->pitches[0] * 7650 plane_config->size = PAGE_ALIGN(crtc->base.primary->fb->pitches[0] *
7652 aligned_height); 7651 aligned_height);