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

Commit 2b702e72 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-fixes-2017-09-28-1' of...

Merge tag 'drm-misc-fixes-2017-09-28-1' of git://anongit.freedesktop.org/git/drm-misc into drm-fixes

Driver Changes:
- qxl: fix primary surface and fb unpinning (Gerd)
- sun41: fix CEC_PIN config gate now that media has been merged (Hans)
- tegra: fix TRACE_INCLUDE_PATH (Thierry)

Cc: Thierry Reding <treding@nvidia.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Gerd Hoffmann <kraxel@redhat.com>

* tag 'drm-misc-fixes-2017-09-28-1' of git://anongit.freedesktop.org/git/drm-misc:
  drm/tegra: trace: Fix path to include
  qxl: fix framebuffer unpinning
  drm/sun4i: cec: Enable back CEC-pin framework
  qxl: fix primary surface handling
parents 2726e15e a98c75fc
Loading
Loading
Loading
Loading
+23 −18
Original line number Diff line number Diff line
@@ -509,23 +509,25 @@ static void qxl_primary_atomic_update(struct drm_plane *plane,
	    .y2 = qfb->base.height
	};

	if (!old_state->fb) {
		qxl_io_log(qdev,
			   "create primary fb: %dx%d,%d,%d\n",
			   bo->surf.width, bo->surf.height,
			   bo->surf.stride, bo->surf.format);
	if (old_state->fb) {
		qfb_old = to_qxl_framebuffer(old_state->fb);
		bo_old = gem_to_qxl_bo(qfb_old->obj);
	} else {
		bo_old = NULL;
	}

		qxl_io_create_primary(qdev, 0, bo);
		bo->is_primary = true;
	if (bo == bo_old)
		return;

	} else {
		qfb_old = to_qxl_framebuffer(old_state->fb);
		bo_old = gem_to_qxl_bo(qfb_old->obj);
	if (bo_old && bo_old->is_primary) {
		qxl_io_destroy_primary(qdev);
		bo_old->is_primary = false;
	}

	if (!bo->is_primary) {
		qxl_io_create_primary(qdev, 0, bo);
		bo->is_primary = true;
	}
	qxl_draw_dirty_fb(qdev, qfb, bo, 0, 0, &norect, 1, 1);
}

@@ -534,15 +536,17 @@ static void qxl_primary_atomic_disable(struct drm_plane *plane,
{
	struct qxl_device *qdev = plane->dev->dev_private;

	if (old_state->fb)
	{	struct qxl_framebuffer *qfb =
	if (old_state->fb) {
		struct qxl_framebuffer *qfb =
			to_qxl_framebuffer(old_state->fb);
		struct qxl_bo *bo = gem_to_qxl_bo(qfb->obj);

		if (bo->is_primary) {
			qxl_io_destroy_primary(qdev);
			bo->is_primary = false;
		}
	}
}

static int qxl_plane_atomic_check(struct drm_plane *plane,
				  struct drm_plane_state *state)
@@ -698,14 +702,15 @@ static void qxl_plane_cleanup_fb(struct drm_plane *plane,
	struct drm_gem_object *obj;
	struct qxl_bo *user_bo;

	if (!plane->state->fb) {
		/* we never executed prepare_fb, so there's nothing to
	if (!old_state->fb) {
		/*
		 * we never executed prepare_fb, so there's nothing to
		 * unpin.
		 */
		return;
	}

	obj = to_qxl_framebuffer(plane->state->fb)->obj;
	obj = to_qxl_framebuffer(old_state->fb)->obj;
	user_bo = gem_to_qxl_bo(obj);
	qxl_bo_unpin(user_bo);
}
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ config DRM_SUN4I_HDMI_CEC
       bool "Allwinner A10 HDMI CEC Support"
       depends on DRM_SUN4I_HDMI
       select CEC_CORE
       depends on CEC_PIN
       select CEC_PIN
       help
	  Choose this option if you have an Allwinner SoC with an HDMI
	  controller and want to use CEC.
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#include <drm/drm_connector.h>
#include <drm/drm_encoder.h>

#include <media/cec.h>
#include <media/cec-pin.h>

#define SUN4I_HDMI_CTRL_REG		0x004
#define SUN4I_HDMI_CTRL_ENABLE			BIT(31)
+1 −1
Original line number Diff line number Diff line
@@ -63,6 +63,6 @@ DEFINE_EVENT(register_access, sor_readl,

/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/tegra
#define TRACE_INCLUDE_FILE trace
#include <trace/define_trace.h>