* [PATCH] drm/arm: hdlcd: Use CMA helper for plane buffer address calculation
@ 2017-06-16 11:31 Liviu Dudau
0 siblings, 0 replies; only message in thread
From: Liviu Dudau @ 2017-06-16 11:31 UTC (permalink / raw)
To: Liviu Dudau
Cc: Brian Starkey, David Airlie, DRI devel, LKML,
Russell King - ARM Linux, Liviu Dudau
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>
---
drivers/gpu/drm/arm/hdlcd_crtc.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
index 1a3359c0f6cd..0128ebd318f5 100644
--- 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(struct drm_plane *plane,
{
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]);
--
2.13.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-16 11:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 11:31 [PATCH] drm/arm: hdlcd: Use CMA helper for plane buffer address calculation Liviu Dudau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).