aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-06-23 00:53:44 -0400
committerDave Airlie <airlied@redhat.com>2017-06-23 00:53:44 -0400
commit338ffbf7cb5eee0ed4600650d03cd2d7cd1cac9d (patch)
tree2ae0e3611ed43c0297a309191b682b3bd8daaaa3
parent047b8e21e3bfa9faa4ed9a0c337fe0c687710251 (diff)
parentfee4964f0a6cd2ce6368d2c69e9ec8e6f44fb0ec (diff)
Merge tag 'hdlcd-for-v4.13-v3' of git://linux-arm.org/linux-ld into drm-next
hdlcd fixes. * tag 'hdlcd-for-v4.13-v3' of git://linux-arm.org/linux-ld: drm/arm: hdlcd: remove unused variables drm/arm: hdlcd: Use CMA helper for plane buffer address calculation drm/arm: hdlcd: Set the CRTC's port before binding the encoder.
-rw-r--r--drivers/gpu/drm/arm/hdlcd_crtc.c11
-rw-r--r--drivers/gpu/drm/arm/hdlcd_drv.c9
2 files changed, 11 insertions, 9 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
index 1a3359c0f6cd..d67b6f15e8b8 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,
261{ 261{
262 struct drm_framebuffer *fb = plane->state->fb; 262 struct drm_framebuffer *fb = plane->state->fb;
263 struct hdlcd_drm_private *hdlcd; 263 struct hdlcd_drm_private *hdlcd;
264 struct drm_gem_cma_object *gem; 264 u32 dest_h;
265 u32 src_x, src_y, dest_h;
266 dma_addr_t scanout_start; 265 dma_addr_t scanout_start;
267 266
268 if (!fb) 267 if (!fb)
269 return; 268 return;
270 269
271 src_x = plane->state->src.x1 >> 16;
272 src_y = plane->state->src.y1 >> 16;
273 dest_h = drm_rect_height(&plane->state->dst); 270 dest_h = drm_rect_height(&plane->state->dst);
274 gem = drm_fb_cma_get_gem_obj(fb, 0); 271 scanout_start = drm_fb_cma_get_gem_addr(fb, plane->state, 0);
275
276 scanout_start = gem->paddr + fb->offsets[0] +
277 src_y * fb->pitches[0] +
278 src_x * fb->format->cpp[0];
279 272
280 hdlcd = plane->dev->dev_private; 273 hdlcd = plane->dev->dev_private;
281 hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]); 274 hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 345c8357b273..d3da87fbd85a 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -297,6 +297,9 @@ static int hdlcd_drm_bind(struct device *dev)
297 if (ret) 297 if (ret)
298 goto err_free; 298 goto err_free;
299 299
300 /* Set the CRTC's port so that the encoder component can find it */
301 hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0);
302
300 ret = component_bind_all(dev, drm); 303 ret = component_bind_all(dev, drm);
301 if (ret) { 304 if (ret) {
302 DRM_ERROR("Failed to bind all components\n"); 305 DRM_ERROR("Failed to bind all components\n");
@@ -340,11 +343,14 @@ err_register:
340 } 343 }
341err_fbdev: 344err_fbdev:
342 drm_kms_helper_poll_fini(drm); 345 drm_kms_helper_poll_fini(drm);
346 drm_vblank_cleanup(drm);
343err_vblank: 347err_vblank:
344 pm_runtime_disable(drm->dev); 348 pm_runtime_disable(drm->dev);
345err_pm_active: 349err_pm_active:
346 component_unbind_all(dev, drm); 350 component_unbind_all(dev, drm);
347err_unload: 351err_unload:
352 of_node_put(hdlcd->crtc.port);
353 hdlcd->crtc.port = NULL;
348 drm_irq_uninstall(drm); 354 drm_irq_uninstall(drm);
349 of_reserved_mem_device_release(drm->dev); 355 of_reserved_mem_device_release(drm->dev);
350err_free: 356err_free:
@@ -367,6 +373,9 @@ static void hdlcd_drm_unbind(struct device *dev)
367 } 373 }
368 drm_kms_helper_poll_fini(drm); 374 drm_kms_helper_poll_fini(drm);
369 component_unbind_all(dev, drm); 375 component_unbind_all(dev, drm);
376 of_node_put(hdlcd->crtc.port);
377 hdlcd->crtc.port = NULL;
378 drm_vblank_cleanup(drm);
370 pm_runtime_get_sync(drm->dev); 379 pm_runtime_get_sync(drm->dev);
371 drm_irq_uninstall(drm); 380 drm_irq_uninstall(drm);
372 pm_runtime_put_sync(drm->dev); 381 pm_runtime_put_sync(drm->dev);