[PATCH 06/20] drm/i915: Convert primary plane 16.16 values to regular ints

Chandra Konduru
2015-04-02T03:00:32Z

This patch converts intel_plane_state->src rect from 16.16
values into regular ints.

This approach aligns with sprite_plane_state->src rects
which are already in regular ints.

Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ee71bde..dddbe11 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12590,6 +12590,15 @@ intel_check_primary_plane(struct drm_plane *plane,
intel_crtc->atomic.update_wm = true;
}

+ /*
+ * Hardware doesn't handle subpixel coordinates.
+ * Adjust to (macro)pixel boundary.
+ */
+ src->x1 >>= 16;
+ src->x2 >>= 16;
+ src->y1 >>= 16;
+ src->y2 >>= 16;
+
return 0;
}

@@ -12608,8 +12617,8 @@ intel_commit_primary_plane(struct drm_plane *plane,
intel_crtc = to_intel_crtc(crtc);

plane->fb = fb;
- crtc->x = src->x1 >> 16;
- crtc->y = src->y1 >> 16;
+ crtc->x = src->x1;
+ crtc->y = src->y1;

if (intel_crtc->active) {
if (state->visible) {