From: Liviu Dudau <Liviu.Dudau@arm.com>
Date: Tue, 13 Jun 2017 12:18:03 +0100
Subject: drm/arm: hdlcd: Use CMA helper for plane buffer address calculation
Git-commit: 49a58f26af7b5ee28ea8788fcd2bb7b590c711c5
Patch-mainline: v4.13-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166
CMA has gained a recent helper function for calculating the start
of the plane buffer's physical address. Use that instead of the
hand rolled version.
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
drivers/gpu/drm/arm/hdlcd_crtc.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
--- a/drivers/gpu/drm/arm/hdlcd_crtc.c
+++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
@@ -261,21 +261,14 @@ static void hdlcd_plane_atomic_update(st
{
struct drm_framebuffer *fb = plane->state->fb;
struct hdlcd_drm_private *hdlcd;
- struct drm_gem_cma_object *gem;
u32 src_x, src_y, dest_h;
dma_addr_t scanout_start;
if (!fb)
return;
- src_x = plane->state->src.x1 >> 16;
- src_y = plane->state->src.y1 >> 16;
dest_h = drm_rect_height(&plane->state->dst);
- gem = drm_fb_cma_get_gem_obj(fb, 0);
-
- scanout_start = gem->paddr + fb->offsets[0] +
- src_y * fb->pitches[0] +
- src_x * fb->format->cpp[0];
+ scanout_start = drm_fb_cma_get_gem_addr(fb, plane->state, 0);
hdlcd = plane->dev->dev_private;
hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);