[PATCH 1/5] drm/imx: disable outputs in lastclose when framebuffer emulation is disabled
Daniel Vetter
daniel at ffwll.ch
Fri Jun 17 12:45:42 UTC 2016
On Fri, Jun 17, 2016 at 12:13:38PM +0200, Lucas Stach wrote:
> If there is no framebuffer mode that can be restored, all outputs should
> be disabled in order to avoid information leaks.
No, this was a short-term regression that's now fixed again. When a client
closes or calls rmfb, we make sure that buffer isn't in use any more. This
shouldn't be needed any more.
Also, a generic fix in driver code. Tsk! ;-)
Cheers, Daniel
>
> Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> ---
> drivers/gpu/drm/imx/imx-drm-core.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
> index 82656654fb21..c63378661e11 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -63,7 +63,19 @@ static void imx_drm_driver_lastclose(struct drm_device *drm)
> {
> struct imx_drm_device *imxdrm = drm->dev_private;
>
> - drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
> + if (imxdrm->fbhelper) {
> + drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
> + } else {
> + struct drm_connector *connector;
> +
> + /* no kernel mode to go back to, disable all outputs */
> + drm_modeset_lock_all(drm);
> + drm_for_each_connector(connector, drm)
> + connector->encoder = NULL;
> + drm_modeset_unlock_all(drm);
> +
> + drm_helper_disable_unused_functions(drm);
> + }
> }
>
> static int imx_drm_driver_unload(struct drm_device *drm)
> --
> 2.8.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dri-devel
mailing list