Skip to content

Commit 49a58f2

Browse files
committed
drm/arm: hdlcd: Use CMA helper for plane buffer address calculation
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>
1 parent de5cc81 commit 49a58f2

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

‎drivers/gpu/drm/arm/hdlcd_crtc.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,21 +261,14 @@ static void hdlcd_plane_atomic_update(struct drm_plane *plane,
261261
{
262262
struct drm_framebuffer *fb = plane->state->fb;
263263
struct hdlcd_drm_private *hdlcd;
264-
struct drm_gem_cma_object *gem;
265264
u32 src_x, src_y, dest_h;
266265
dma_addr_t scanout_start;
267266

268267
if (!fb)
269268
return;
270269

271-
src_x = plane->state->src.x1 >> 16;
272-
src_y = plane->state->src.y1 >> 16;
273270
dest_h = drm_rect_height(&plane->state->dst);
274-
gem = drm_fb_cma_get_gem_obj(fb, 0);
275-
276-
scanout_start = gem->paddr + fb->offsets[0] +
277-
src_y * fb->pitches[0] +
278-
src_x * fb->format->cpp[0];
271+
scanout_start = drm_fb_cma_get_gem_addr(fb, plane->state, 0);
279272

280273
hdlcd = plane->dev->dev_private;
281274
hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);

0 commit comments

Comments
 (0)