Commit df0219b4 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-fixes-2019-01-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

drm-misc-fixes for v5.0-rc3:
- Add missing calls to of_node_put to sun4i, meson, and rockchip.
- Drop unimplemented prime callbacks in virtio and qxl, so support
  for prime is not advertised on those drivers.
- Fix mode switching regression in meson.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9af07312-f435-2fda-65a2-9fe92cdf5da4@linux.intel.com
parents 4ac4cb70 4bb0e6d7
...@@ -46,7 +46,6 @@ struct meson_crtc { ...@@ -46,7 +46,6 @@ struct meson_crtc {
struct drm_crtc base; struct drm_crtc base;
struct drm_pending_vblank_event *event; struct drm_pending_vblank_event *event;
struct meson_drm *priv; struct meson_drm *priv;
bool enabled;
}; };
#define to_meson_crtc(x) container_of(x, struct meson_crtc, base) #define to_meson_crtc(x) container_of(x, struct meson_crtc, base)
...@@ -82,7 +81,8 @@ static const struct drm_crtc_funcs meson_crtc_funcs = { ...@@ -82,7 +81,8 @@ static const struct drm_crtc_funcs meson_crtc_funcs = {
}; };
static void meson_crtc_enable(struct drm_crtc *crtc) static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
struct drm_crtc_state *old_state)
{ {
struct meson_crtc *meson_crtc = to_meson_crtc(crtc); struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
struct drm_crtc_state *crtc_state = crtc->state; struct drm_crtc_state *crtc_state = crtc->state;
...@@ -108,20 +108,6 @@ static void meson_crtc_enable(struct drm_crtc *crtc) ...@@ -108,20 +108,6 @@ static void meson_crtc_enable(struct drm_crtc *crtc)
drm_crtc_vblank_on(crtc); drm_crtc_vblank_on(crtc);
meson_crtc->enabled = true;
}
static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
struct drm_crtc_state *old_state)
{
struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
struct meson_drm *priv = meson_crtc->priv;
DRM_DEBUG_DRIVER("\n");
if (!meson_crtc->enabled)
meson_crtc_enable(crtc);
priv->viu.osd1_enabled = true; priv->viu.osd1_enabled = true;
} }
...@@ -153,8 +139,6 @@ static void meson_crtc_atomic_disable(struct drm_crtc *crtc, ...@@ -153,8 +139,6 @@ static void meson_crtc_atomic_disable(struct drm_crtc *crtc,
crtc->state->event = NULL; crtc->state->event = NULL;
} }
meson_crtc->enabled = false;
} }
static void meson_crtc_atomic_begin(struct drm_crtc *crtc, static void meson_crtc_atomic_begin(struct drm_crtc *crtc,
...@@ -163,9 +147,6 @@ static void meson_crtc_atomic_begin(struct drm_crtc *crtc, ...@@ -163,9 +147,6 @@ static void meson_crtc_atomic_begin(struct drm_crtc *crtc,
struct meson_crtc *meson_crtc = to_meson_crtc(crtc); struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
unsigned long flags; unsigned long flags;
if (crtc->state->enable && !meson_crtc->enabled)
meson_crtc_enable(crtc);
if (crtc->state->event) { if (crtc->state->event) {
WARN_ON(drm_crtc_vblank_get(crtc) != 0); WARN_ON(drm_crtc_vblank_get(crtc) != 0);
......
...@@ -75,6 +75,10 @@ static const struct drm_mode_config_funcs meson_mode_config_funcs = { ...@@ -75,6 +75,10 @@ static const struct drm_mode_config_funcs meson_mode_config_funcs = {
.fb_create = drm_gem_fb_create, .fb_create = drm_gem_fb_create,
}; };
static const struct drm_mode_config_helper_funcs meson_mode_config_helpers = {
.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
};
static irqreturn_t meson_irq(int irq, void *arg) static irqreturn_t meson_irq(int irq, void *arg)
{ {
struct drm_device *dev = arg; struct drm_device *dev = arg;
...@@ -266,6 +270,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) ...@@ -266,6 +270,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
drm->mode_config.max_width = 3840; drm->mode_config.max_width = 3840;
drm->mode_config.max_height = 2160; drm->mode_config.max_height = 2160;
drm->mode_config.funcs = &meson_mode_config_funcs; drm->mode_config.funcs = &meson_mode_config_funcs;
drm->mode_config.helper_private = &meson_mode_config_helpers;
/* Hardware Initialization */ /* Hardware Initialization */
...@@ -388,8 +393,10 @@ static int meson_probe_remote(struct platform_device *pdev, ...@@ -388,8 +393,10 @@ static int meson_probe_remote(struct platform_device *pdev,
remote_node = of_graph_get_remote_port_parent(ep); remote_node = of_graph_get_remote_port_parent(ep);
if (!remote_node || if (!remote_node ||
remote_node == parent || /* Ignore parent endpoint */ remote_node == parent || /* Ignore parent endpoint */
!of_device_is_available(remote_node)) !of_device_is_available(remote_node)) {
of_node_put(remote_node);
continue; continue;
}
count += meson_probe_remote(pdev, match, remote, remote_node); count += meson_probe_remote(pdev, match, remote, remote_node);
...@@ -408,10 +415,13 @@ static int meson_drv_probe(struct platform_device *pdev) ...@@ -408,10 +415,13 @@ static int meson_drv_probe(struct platform_device *pdev)
for_each_endpoint_of_node(np, ep) { for_each_endpoint_of_node(np, ep) {
remote = of_graph_get_remote_port_parent(ep); remote = of_graph_get_remote_port_parent(ep);
if (!remote || !of_device_is_available(remote)) if (!remote || !of_device_is_available(remote)) {
of_node_put(remote);
continue; continue;
}
count += meson_probe_remote(pdev, &match, np, remote); count += meson_probe_remote(pdev, &match, np, remote);
of_node_put(remote);
} }
if (count && !match) if (count && !match)
......
...@@ -250,14 +250,10 @@ static struct drm_driver qxl_driver = { ...@@ -250,14 +250,10 @@ static struct drm_driver qxl_driver = {
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
.debugfs_init = qxl_debugfs_init, .debugfs_init = qxl_debugfs_init,
#endif #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export = drm_gem_prime_export, .gem_prime_export = drm_gem_prime_export,
.gem_prime_import = drm_gem_prime_import, .gem_prime_import = drm_gem_prime_import,
.gem_prime_pin = qxl_gem_prime_pin, .gem_prime_pin = qxl_gem_prime_pin,
.gem_prime_unpin = qxl_gem_prime_unpin, .gem_prime_unpin = qxl_gem_prime_unpin,
.gem_prime_get_sg_table = qxl_gem_prime_get_sg_table,
.gem_prime_import_sg_table = qxl_gem_prime_import_sg_table,
.gem_prime_vmap = qxl_gem_prime_vmap, .gem_prime_vmap = qxl_gem_prime_vmap,
.gem_prime_vunmap = qxl_gem_prime_vunmap, .gem_prime_vunmap = qxl_gem_prime_vunmap,
.gem_prime_mmap = qxl_gem_prime_mmap, .gem_prime_mmap = qxl_gem_prime_mmap,
......
...@@ -38,20 +38,6 @@ void qxl_gem_prime_unpin(struct drm_gem_object *obj) ...@@ -38,20 +38,6 @@ void qxl_gem_prime_unpin(struct drm_gem_object *obj)
WARN_ONCE(1, "not implemented"); WARN_ONCE(1, "not implemented");
} }
struct sg_table *qxl_gem_prime_get_sg_table(struct drm_gem_object *obj)
{
WARN_ONCE(1, "not implemented");
return ERR_PTR(-ENOSYS);
}
struct drm_gem_object *qxl_gem_prime_import_sg_table(
struct drm_device *dev, struct dma_buf_attachment *attach,
struct sg_table *table)
{
WARN_ONCE(1, "not implemented");
return ERR_PTR(-ENOSYS);
}
void *qxl_gem_prime_vmap(struct drm_gem_object *obj) void *qxl_gem_prime_vmap(struct drm_gem_object *obj)
{ {
WARN_ONCE(1, "not implemented"); WARN_ONCE(1, "not implemented");
......
...@@ -113,9 +113,11 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, ...@@ -113,9 +113,11 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
child_count++; child_count++;
ret = drm_of_find_panel_or_bridge(dev->of_node, 0, endpoint_id, ret = drm_of_find_panel_or_bridge(dev->of_node, 0, endpoint_id,
&panel, &bridge); &panel, &bridge);
if (!ret) if (!ret) {
of_node_put(endpoint);
break; break;
} }
}
of_node_put(port); of_node_put(port);
......
...@@ -786,17 +786,18 @@ static struct sun4i_frontend *sun4i_backend_find_frontend(struct sun4i_drv *drv, ...@@ -786,17 +786,18 @@ static struct sun4i_frontend *sun4i_backend_find_frontend(struct sun4i_drv *drv,
remote = of_graph_get_remote_port_parent(ep); remote = of_graph_get_remote_port_parent(ep);
if (!remote) if (!remote)
continue; continue;
of_node_put(remote);
/* does this node match any registered engines? */ /* does this node match any registered engines? */
list_for_each_entry(frontend, &drv->frontend_list, list) { list_for_each_entry(frontend, &drv->frontend_list, list) {
if (remote == frontend->node) { if (remote == frontend->node) {
of_node_put(remote);
of_node_put(port); of_node_put(port);
of_node_put(ep);
return frontend; return frontend;
} }
} }
} }
of_node_put(port);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
......
...@@ -127,14 +127,10 @@ static struct drm_driver driver = { ...@@ -127,14 +127,10 @@ static struct drm_driver driver = {
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
.debugfs_init = virtio_gpu_debugfs_init, .debugfs_init = virtio_gpu_debugfs_init,
#endif #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export = drm_gem_prime_export, .gem_prime_export = drm_gem_prime_export,
.gem_prime_import = drm_gem_prime_import, .gem_prime_import = drm_gem_prime_import,
.gem_prime_pin = virtgpu_gem_prime_pin, .gem_prime_pin = virtgpu_gem_prime_pin,
.gem_prime_unpin = virtgpu_gem_prime_unpin, .gem_prime_unpin = virtgpu_gem_prime_unpin,
.gem_prime_get_sg_table = virtgpu_gem_prime_get_sg_table,
.gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table,
.gem_prime_vmap = virtgpu_gem_prime_vmap, .gem_prime_vmap = virtgpu_gem_prime_vmap,
.gem_prime_vunmap = virtgpu_gem_prime_vunmap, .gem_prime_vunmap = virtgpu_gem_prime_vunmap,
.gem_prime_mmap = virtgpu_gem_prime_mmap, .gem_prime_mmap = virtgpu_gem_prime_mmap,
......
...@@ -372,10 +372,6 @@ int virtio_gpu_object_wait(struct virtio_gpu_object *bo, bool no_wait); ...@@ -372,10 +372,6 @@ int virtio_gpu_object_wait(struct virtio_gpu_object *bo, bool no_wait);
/* virtgpu_prime.c */ /* virtgpu_prime.c */
int virtgpu_gem_prime_pin(struct drm_gem_object *obj); int virtgpu_gem_prime_pin(struct drm_gem_object *obj);
void virtgpu_gem_prime_unpin(struct drm_gem_object *obj); void virtgpu_gem_prime_unpin(struct drm_gem_object *obj);
struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj);
struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
struct drm_device *dev, struct dma_buf_attachment *attach,
struct sg_table *sgt);
void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj); void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj);
void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr); void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
int virtgpu_gem_prime_mmap(struct drm_gem_object *obj, int virtgpu_gem_prime_mmap(struct drm_gem_object *obj,
......
...@@ -39,20 +39,6 @@ void virtgpu_gem_prime_unpin(struct drm_gem_object *obj) ...@@ -39,20 +39,6 @@ void virtgpu_gem_prime_unpin(struct drm_gem_object *obj)
WARN_ONCE(1, "not implemented"); WARN_ONCE(1, "not implemented");
} }
struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj)
{
WARN_ONCE(1, "not implemented");
return ERR_PTR(-ENODEV);
}
struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
struct drm_device *dev, struct dma_buf_attachment *attach,
struct sg_table *table)
{
WARN_ONCE(1, "not implemented");
return ERR_PTR(-ENODEV);
}
void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj) void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj)
{ {
struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj); struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj);
......
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