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

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
...@@ -509,23 +509,25 @@ static void qxl_primary_atomic_update(struct drm_plane *plane, ...@@ -509,23 +509,25 @@ static void qxl_primary_atomic_update(struct drm_plane *plane,
.y2 = qfb->base.height .y2 = qfb->base.height
}; };
if (!old_state->fb) { if (old_state->fb) {
qxl_io_log(qdev, qfb_old = to_qxl_framebuffer(old_state->fb);
"create primary fb: %dx%d,%d,%d\n", bo_old = gem_to_qxl_bo(qfb_old->obj);
bo->surf.width, bo->surf.height, } else {
bo->surf.stride, bo->surf.format); bo_old = NULL;
}
qxl_io_create_primary(qdev, 0, bo); if (bo == bo_old)
bo->is_primary = true;
return; return;
} else { if (bo_old && bo_old->is_primary) {
qfb_old = to_qxl_framebuffer(old_state->fb); qxl_io_destroy_primary(qdev);
bo_old = gem_to_qxl_bo(qfb_old->obj);
bo_old->is_primary = false; bo_old->is_primary = false;
} }
if (!bo->is_primary) {
qxl_io_create_primary(qdev, 0, bo);
bo->is_primary = true; bo->is_primary = true;
}
qxl_draw_dirty_fb(qdev, qfb, bo, 0, 0, &norect, 1, 1); qxl_draw_dirty_fb(qdev, qfb, bo, 0, 0, &norect, 1, 1);
} }
...@@ -534,14 +536,16 @@ static void qxl_primary_atomic_disable(struct drm_plane *plane, ...@@ -534,14 +536,16 @@ static void qxl_primary_atomic_disable(struct drm_plane *plane,
{ {
struct qxl_device *qdev = plane->dev->dev_private; struct qxl_device *qdev = plane->dev->dev_private;
if (old_state->fb) if (old_state->fb) {
{ struct qxl_framebuffer *qfb = struct qxl_framebuffer *qfb =
to_qxl_framebuffer(old_state->fb); to_qxl_framebuffer(old_state->fb);
struct qxl_bo *bo = gem_to_qxl_bo(qfb->obj); struct qxl_bo *bo = gem_to_qxl_bo(qfb->obj);
if (bo->is_primary) {
qxl_io_destroy_primary(qdev); qxl_io_destroy_primary(qdev);
bo->is_primary = false; bo->is_primary = false;
} }
}
} }
static int qxl_plane_atomic_check(struct drm_plane *plane, static int qxl_plane_atomic_check(struct drm_plane *plane,
...@@ -698,14 +702,15 @@ static void qxl_plane_cleanup_fb(struct drm_plane *plane, ...@@ -698,14 +702,15 @@ static void qxl_plane_cleanup_fb(struct drm_plane *plane,
struct drm_gem_object *obj; struct drm_gem_object *obj;
struct qxl_bo *user_bo; struct qxl_bo *user_bo;
if (!plane->state->fb) { if (!old_state->fb) {
/* we never executed prepare_fb, so there's nothing to /*
* we never executed prepare_fb, so there's nothing to
* unpin. * unpin.
*/ */
return; return;
} }
obj = to_qxl_framebuffer(plane->state->fb)->obj; obj = to_qxl_framebuffer(old_state->fb)->obj;
user_bo = gem_to_qxl_bo(obj); user_bo = gem_to_qxl_bo(obj);
qxl_bo_unpin(user_bo); qxl_bo_unpin(user_bo);
} }
......
...@@ -26,7 +26,7 @@ config DRM_SUN4I_HDMI_CEC ...@@ -26,7 +26,7 @@ config DRM_SUN4I_HDMI_CEC
bool "Allwinner A10 HDMI CEC Support" bool "Allwinner A10 HDMI CEC Support"
depends on DRM_SUN4I_HDMI depends on DRM_SUN4I_HDMI
select CEC_CORE select CEC_CORE
depends on CEC_PIN select CEC_PIN
help help
Choose this option if you have an Allwinner SoC with an HDMI Choose this option if you have an Allwinner SoC with an HDMI
controller and want to use CEC. controller and want to use CEC.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <drm/drm_connector.h> #include <drm/drm_connector.h>
#include <drm/drm_encoder.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_REG 0x004
#define SUN4I_HDMI_CTRL_ENABLE BIT(31) #define SUN4I_HDMI_CTRL_ENABLE BIT(31)
......
...@@ -63,6 +63,6 @@ DEFINE_EVENT(register_access, sor_readl, ...@@ -63,6 +63,6 @@ DEFINE_EVENT(register_access, sor_readl,
/* This part must be outside protection */ /* This part must be outside protection */
#undef TRACE_INCLUDE_PATH #undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH . #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/tegra
#define TRACE_INCLUDE_FILE trace #define TRACE_INCLUDE_FILE trace
#include <trace/define_trace.h> #include <trace/define_trace.h>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment