Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 338ffbf7 authored by Dave Airlie's avatar Dave Airlie
Browse files

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.
parents 047b8e21 fee4964f
Loading
Loading
Loading
Loading
+2 −9
Original line number Original line Diff line number Diff line
@@ -261,21 +261,14 @@ static void hdlcd_plane_atomic_update(struct drm_plane *plane,
{
{
	struct drm_framebuffer *fb = plane->state->fb;
	struct drm_framebuffer *fb = plane->state->fb;
	struct hdlcd_drm_private *hdlcd;
	struct hdlcd_drm_private *hdlcd;
	struct drm_gem_cma_object *gem;
	u32 dest_h;
	u32 src_x, src_y, dest_h;
	dma_addr_t scanout_start;
	dma_addr_t scanout_start;


	if (!fb)
	if (!fb)
		return;
		return;


	src_x = plane->state->src.x1 >> 16;
	src_y = plane->state->src.y1 >> 16;
	dest_h = drm_rect_height(&plane->state->dst);
	dest_h = drm_rect_height(&plane->state->dst);
	gem = drm_fb_cma_get_gem_obj(fb, 0);
	scanout_start = drm_fb_cma_get_gem_addr(fb, plane->state, 0);

	scanout_start = gem->paddr + fb->offsets[0] +
			src_y * fb->pitches[0] +
			src_x *	fb->format->cpp[0];


	hdlcd = plane->dev->dev_private;
	hdlcd = plane->dev->dev_private;
	hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);
	hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);
+9 −0
Original line number Original line Diff line number Diff line
@@ -297,6 +297,9 @@ static int hdlcd_drm_bind(struct device *dev)
	if (ret)
	if (ret)
		goto err_free;
		goto err_free;


	/* Set the CRTC's port so that the encoder component can find it */
	hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0);

	ret = component_bind_all(dev, drm);
	ret = component_bind_all(dev, drm);
	if (ret) {
	if (ret) {
		DRM_ERROR("Failed to bind all components\n");
		DRM_ERROR("Failed to bind all components\n");
@@ -340,11 +343,14 @@ static int hdlcd_drm_bind(struct device *dev)
	}
	}
err_fbdev:
err_fbdev:
	drm_kms_helper_poll_fini(drm);
	drm_kms_helper_poll_fini(drm);
	drm_vblank_cleanup(drm);
err_vblank:
err_vblank:
	pm_runtime_disable(drm->dev);
	pm_runtime_disable(drm->dev);
err_pm_active:
err_pm_active:
	component_unbind_all(dev, drm);
	component_unbind_all(dev, drm);
err_unload:
err_unload:
	of_node_put(hdlcd->crtc.port);
	hdlcd->crtc.port = NULL;
	drm_irq_uninstall(drm);
	drm_irq_uninstall(drm);
	of_reserved_mem_device_release(drm->dev);
	of_reserved_mem_device_release(drm->dev);
err_free:
err_free:
@@ -367,6 +373,9 @@ static void hdlcd_drm_unbind(struct device *dev)
	}
	}
	drm_kms_helper_poll_fini(drm);
	drm_kms_helper_poll_fini(drm);
	component_unbind_all(dev, drm);
	component_unbind_all(dev, drm);
	of_node_put(hdlcd->crtc.port);
	hdlcd->crtc.port = NULL;
	drm_vblank_cleanup(drm);
	pm_runtime_get_sync(drm->dev);
	pm_runtime_get_sync(drm->dev);
	drm_irq_uninstall(drm);
	drm_irq_uninstall(drm);
	pm_runtime_put_sync(drm->dev);
	pm_runtime_put_sync(drm->dev);