Fixes for v5.9-rc2:
- Take modeset bkl for legacy drivers. - Allow null crtc in dp_mst. - Omap locking state fix. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAl9GEesACgkQ/lWMcqZw E8Pobw//aePo3lYb09/rtzl2LPnvD0CewRrPZ7ksDUpu32vsB1Ahv9q1fua0Kf7k TguLOTx9mRMaKoHErsEKChRMDtJ6OfdBB1kP/EFYIJjvjWTgNNe6aQonytJD8Xsn 8eo5OWOMvR07LbL21rkDgD7e56Abt8G7xQKxY6ruFI40cCRP9PR3WwlDUEM4XNty yNxOcugAECaqit8eQW/740iKqQvggTBzaveHUqykIjWVZsi7Sn7Uxo8w22ZHbokw JaYtKOPU+Z1H5rT2iqzLogzfzP7KfSJHjcfMY2W/aqor87WN9zwgnb8ZK3hB+TWx zmef2s8KlKKoQ3+W54CpxarjPv0doUSdf2KD6clPc7V7YZ2WD6VexxxmPI1ktWuJ gvajacmQEjStVb/0xleWigMSSs/jLH8JXb48SG9i00/qN4vYeqzRYm1i91VktBve EubLUl0tm69aI6TIgX+9MjaRS71GLQaNn/W5ZjnEUc1GgDACCs4SMTXc8OUB5kxp JgWjcwufjsX82Iv0YV6mTGsxy4s4REruCxtGaGL9+h2pIqvNdoQG0Xa84FvIN6gy o7SZPDkyxMUi3sJ+iqDJbJBERpR+uuAH/E25yFiPVL5LuuTZgUb/GX47Xt8nibmB uWf8CeWJA6RZTbvH6Jo8uDFYt5tTHJisX2G9Qt4hMMRgMzHQmV0= =GwvL -----END PGP SIGNATURE----- Merge tag 'drm-misc-fixes-2020-08-26' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Fixes for v5.9-rc2: - Take modeset bkl for legacy drivers. - Allow null crtc in dp_mst. - Omap locking state fix. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/7af1e52a-27de-8edc-d0b2-e23b01e8bc96@linux.intel.com
This commit is contained in:
commit
c2b2f02a02
@ -34,6 +34,7 @@
|
||||
#include <drm/drm_bridge.h>
|
||||
#include <drm/drm_damage_helper.h>
|
||||
#include <drm/drm_device.h>
|
||||
#include <drm/drm_drv.h>
|
||||
#include <drm/drm_plane_helper.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_self_refresh_helper.h>
|
||||
@ -3106,7 +3107,7 @@ void drm_atomic_helper_shutdown(struct drm_device *dev)
|
||||
if (ret)
|
||||
DRM_ERROR("Disabling all crtc's during unload failed with %i\n", ret);
|
||||
|
||||
DRM_MODESET_LOCK_ALL_END(ctx, ret);
|
||||
DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_atomic_helper_shutdown);
|
||||
|
||||
@ -3246,7 +3247,7 @@ struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev)
|
||||
}
|
||||
|
||||
unlock:
|
||||
DRM_MODESET_LOCK_ALL_END(ctx, err);
|
||||
DRM_MODESET_LOCK_ALL_END(dev, ctx, err);
|
||||
if (err)
|
||||
return ERR_PTR(err);
|
||||
|
||||
@ -3327,7 +3328,7 @@ int drm_atomic_helper_resume(struct drm_device *dev,
|
||||
|
||||
err = drm_atomic_helper_commit_duplicated_state(state, &ctx);
|
||||
|
||||
DRM_MODESET_LOCK_ALL_END(ctx, err);
|
||||
DRM_MODESET_LOCK_ALL_END(dev, ctx, err);
|
||||
drm_atomic_state_put(state);
|
||||
|
||||
return err;
|
||||
|
@ -294,7 +294,7 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,
|
||||
crtc->gamma_size, &ctx);
|
||||
|
||||
out:
|
||||
DRM_MODESET_LOCK_ALL_END(ctx, ret);
|
||||
DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
@ -588,7 +588,6 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
|
||||
if (crtc_req->mode_valid && !drm_lease_held(file_priv, plane->base.id))
|
||||
return -EACCES;
|
||||
|
||||
mutex_lock(&crtc->dev->mode_config.mutex);
|
||||
DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx,
|
||||
DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret);
|
||||
|
||||
@ -756,8 +755,7 @@ out:
|
||||
fb = NULL;
|
||||
mode = NULL;
|
||||
|
||||
DRM_MODESET_LOCK_ALL_END(ctx, ret);
|
||||
mutex_unlock(&crtc->dev->mode_config.mutex);
|
||||
DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -5040,8 +5040,8 @@ int drm_dp_mst_add_affected_dsc_crtcs(struct drm_atomic_state *state, struct drm
|
||||
|
||||
crtc = conn_state->crtc;
|
||||
|
||||
if (WARN_ON(!crtc))
|
||||
return -EINVAL;
|
||||
if (!crtc)
|
||||
continue;
|
||||
|
||||
if (!drm_dp_mst_dsc_aux_for_port(pos->port))
|
||||
continue;
|
||||
|
@ -428,7 +428,7 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
|
||||
out_unref:
|
||||
drm_mode_object_put(obj);
|
||||
out:
|
||||
DRM_MODESET_LOCK_ALL_END(ctx, ret);
|
||||
DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -470,7 +470,7 @@ static int set_property_legacy(struct drm_mode_object *obj,
|
||||
break;
|
||||
}
|
||||
drm_property_change_valid_put(prop, ref);
|
||||
DRM_MODESET_LOCK_ALL_END(ctx, ret);
|
||||
DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -792,7 +792,7 @@ static int setplane_internal(struct drm_plane *plane,
|
||||
crtc_x, crtc_y, crtc_w, crtc_h,
|
||||
src_x, src_y, src_w, src_h, &ctx);
|
||||
|
||||
DRM_MODESET_LOCK_ALL_END(ctx, ret);
|
||||
DRM_MODESET_LOCK_ALL_END(plane->dev, ctx, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -451,11 +451,12 @@ static void omap_crtc_atomic_enable(struct drm_crtc *crtc,
|
||||
if (omap_state->manually_updated)
|
||||
return;
|
||||
|
||||
spin_lock_irq(&crtc->dev->event_lock);
|
||||
drm_crtc_vblank_on(crtc);
|
||||
|
||||
ret = drm_crtc_vblank_get(crtc);
|
||||
WARN_ON(ret != 0);
|
||||
|
||||
spin_lock_irq(&crtc->dev->event_lock);
|
||||
omap_crtc_arm_event(crtc);
|
||||
spin_unlock_irq(&crtc->dev->event_lock);
|
||||
}
|
||||
|
@ -164,6 +164,8 @@ int drm_modeset_lock_all_ctx(struct drm_device *dev,
|
||||
* is 0, so no error checking is necessary
|
||||
*/
|
||||
#define DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, flags, ret) \
|
||||
if (!drm_drv_uses_atomic_modeset(dev)) \
|
||||
mutex_lock(&dev->mode_config.mutex); \
|
||||
drm_modeset_acquire_init(&ctx, flags); \
|
||||
modeset_lock_retry: \
|
||||
ret = drm_modeset_lock_all_ctx(dev, &ctx); \
|
||||
@ -172,6 +174,7 @@ modeset_lock_retry: \
|
||||
|
||||
/**
|
||||
* DRM_MODESET_LOCK_ALL_END - Helper to release and cleanup modeset locks
|
||||
* @dev: drm device
|
||||
* @ctx: local modeset acquire context, will be dereferenced
|
||||
* @ret: local ret/err/etc variable to track error status
|
||||
*
|
||||
@ -188,7 +191,7 @@ modeset_lock_retry: \
|
||||
* to that failure. In both of these cases the code between BEGIN/END will not
|
||||
* be run, so the failure will reflect the inability to grab the locks.
|
||||
*/
|
||||
#define DRM_MODESET_LOCK_ALL_END(ctx, ret) \
|
||||
#define DRM_MODESET_LOCK_ALL_END(dev, ctx, ret) \
|
||||
modeset_lock_fail: \
|
||||
if (ret == -EDEADLK) { \
|
||||
ret = drm_modeset_backoff(&ctx); \
|
||||
@ -196,6 +199,8 @@ modeset_lock_fail: \
|
||||
goto modeset_lock_retry; \
|
||||
} \
|
||||
drm_modeset_drop_locks(&ctx); \
|
||||
drm_modeset_acquire_fini(&ctx);
|
||||
drm_modeset_acquire_fini(&ctx); \
|
||||
if (!drm_drv_uses_atomic_modeset(dev)) \
|
||||
mutex_unlock(&dev->mode_config.mutex);
|
||||
|
||||
#endif /* DRM_MODESET_LOCK_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user