Commit de53874a authored by Dave Airlie's avatar Dave Airlie

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

- A bunch of fixes to cleanup path in meson
- Fix the DMT TDMS clock filtering on meson
- Fix an issue with NV12 buffers on rockchip when scaling is active
- Fix a couple of use-after-free
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190325104523.obnfelgvaglyhe5e@flea
parents a5114300 3d565a21
...@@ -337,12 +337,14 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) ...@@ -337,12 +337,14 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
ret = drm_dev_register(drm, 0); ret = drm_dev_register(drm, 0);
if (ret) if (ret)
goto free_drm; goto uninstall_irq;
drm_fbdev_generic_setup(drm, 32); drm_fbdev_generic_setup(drm, 32);
return 0; return 0;
uninstall_irq:
drm_irq_uninstall(drm);
free_drm: free_drm:
drm_dev_put(drm); drm_dev_put(drm);
...@@ -356,8 +358,8 @@ static int meson_drv_bind(struct device *dev) ...@@ -356,8 +358,8 @@ static int meson_drv_bind(struct device *dev)
static void meson_drv_unbind(struct device *dev) static void meson_drv_unbind(struct device *dev)
{ {
struct drm_device *drm = dev_get_drvdata(dev); struct meson_drm *priv = dev_get_drvdata(dev);
struct meson_drm *priv = drm->dev_private; struct drm_device *drm = priv->drm;
if (priv->canvas) { if (priv->canvas) {
meson_canvas_free(priv->canvas, priv->canvas_id_osd1); meson_canvas_free(priv->canvas, priv->canvas_id_osd1);
...@@ -367,6 +369,7 @@ static void meson_drv_unbind(struct device *dev) ...@@ -367,6 +369,7 @@ static void meson_drv_unbind(struct device *dev)
} }
drm_dev_unregister(drm); drm_dev_unregister(drm);
drm_irq_uninstall(drm);
drm_kms_helper_poll_fini(drm); drm_kms_helper_poll_fini(drm);
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
drm_dev_put(drm); drm_dev_put(drm);
......
...@@ -569,7 +569,8 @@ dw_hdmi_mode_valid(struct drm_connector *connector, ...@@ -569,7 +569,8 @@ dw_hdmi_mode_valid(struct drm_connector *connector,
DRM_DEBUG_DRIVER("Modeline " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode)); DRM_DEBUG_DRIVER("Modeline " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode));
/* If sink max TMDS clock, we reject the mode */ /* If sink max TMDS clock, we reject the mode */
if (mode->clock > connector->display_info.max_tmds_clock) if (connector->display_info.max_tmds_clock &&
mode->clock > connector->display_info.max_tmds_clock)
return MODE_BAD; return MODE_BAD;
/* Check against non-VIC supported modes */ /* Check against non-VIC supported modes */
......
...@@ -541,6 +541,18 @@ static void vop_core_clks_disable(struct vop *vop) ...@@ -541,6 +541,18 @@ static void vop_core_clks_disable(struct vop *vop)
clk_disable(vop->hclk); clk_disable(vop->hclk);
} }
static void vop_win_disable(struct vop *vop, const struct vop_win_data *win)
{
if (win->phy->scl && win->phy->scl->ext) {
VOP_SCL_SET_EXT(vop, win, yrgb_hor_scl_mode, SCALE_NONE);
VOP_SCL_SET_EXT(vop, win, yrgb_ver_scl_mode, SCALE_NONE);
VOP_SCL_SET_EXT(vop, win, cbcr_hor_scl_mode, SCALE_NONE);
VOP_SCL_SET_EXT(vop, win, cbcr_ver_scl_mode, SCALE_NONE);
}
VOP_WIN_SET(vop, win, enable, 0);
}
static int vop_enable(struct drm_crtc *crtc) static int vop_enable(struct drm_crtc *crtc)
{ {
struct vop *vop = to_vop(crtc); struct vop *vop = to_vop(crtc);
...@@ -586,7 +598,7 @@ static int vop_enable(struct drm_crtc *crtc) ...@@ -586,7 +598,7 @@ static int vop_enable(struct drm_crtc *crtc)
struct vop_win *vop_win = &vop->win[i]; struct vop_win *vop_win = &vop->win[i];
const struct vop_win_data *win = vop_win->data; const struct vop_win_data *win = vop_win->data;
VOP_WIN_SET(vop, win, enable, 0); vop_win_disable(vop, win);
} }
spin_unlock(&vop->reg_lock); spin_unlock(&vop->reg_lock);
...@@ -735,7 +747,7 @@ static void vop_plane_atomic_disable(struct drm_plane *plane, ...@@ -735,7 +747,7 @@ static void vop_plane_atomic_disable(struct drm_plane *plane,
spin_lock(&vop->reg_lock); spin_lock(&vop->reg_lock);
VOP_WIN_SET(vop, win, enable, 0); vop_win_disable(vop, win);
spin_unlock(&vop->reg_lock); spin_unlock(&vop->reg_lock);
} }
...@@ -1622,7 +1634,7 @@ static int vop_initial(struct vop *vop) ...@@ -1622,7 +1634,7 @@ static int vop_initial(struct vop *vop)
int channel = i * 2 + 1; int channel = i * 2 + 1;
VOP_WIN_SET(vop, win, channel, (channel + 1) << 4 | channel); VOP_WIN_SET(vop, win, channel, (channel + 1) << 4 | channel);
VOP_WIN_SET(vop, win, enable, 0); vop_win_disable(vop, win);
VOP_WIN_SET(vop, win, gate, 1); VOP_WIN_SET(vop, win, gate, 1);
} }
......
...@@ -191,13 +191,9 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev, ...@@ -191,13 +191,9 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev,
ret = drm_gem_handle_create(file, &obj->base, handle); ret = drm_gem_handle_create(file, &obj->base, handle);
drm_gem_object_put_unlocked(&obj->base); drm_gem_object_put_unlocked(&obj->base);
if (ret) if (ret)
goto err; return ERR_PTR(ret);
return &obj->base; return &obj->base;
err:
__vgem_gem_destroy(obj);
return ERR_PTR(ret);
} }
static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev, static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
......
...@@ -111,11 +111,8 @@ struct drm_gem_object *vkms_gem_create(struct drm_device *dev, ...@@ -111,11 +111,8 @@ struct drm_gem_object *vkms_gem_create(struct drm_device *dev,
ret = drm_gem_handle_create(file, &obj->gem, handle); ret = drm_gem_handle_create(file, &obj->gem, handle);
drm_gem_object_put_unlocked(&obj->gem); drm_gem_object_put_unlocked(&obj->gem);
if (ret) { if (ret)
drm_gem_object_release(&obj->gem);
kfree(obj);
return ERR_PTR(ret); return ERR_PTR(ret);
}
return &obj->gem; return &obj->gem;
} }
......
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