aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-03-22 17:50:55 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-03-29 03:55:46 -0400
commitd49473a53aec5bff366c607bd2a0388554b112f5 (patch)
tree822ccf0eecccba095bcfa446ea69879cc6b3c0d9 /drivers/gpu
parent2c77bb29d3985e73f8c780cfd20fdb2f491943ee (diff)
drm: Restrict drm_mode_set_config_internal to non-atomic drivers
This is another case where we really can't reconstruct a acquire ctx in any useful fashion because all the callers are legacy drivers. So like drm_plane_force_disable simply restrict it to non-atomic drivers so that it's clear we're ok with passing a NULL ctx. Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170322215058.8671-17-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_crtc.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 55b3da2e2a82..685bf146a482 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -447,18 +447,7 @@ int drm_mode_getcrtc(struct drm_device *dev,
447 return 0; 447 return 0;
448} 448}
449 449
450/** 450static int __drm_mode_set_config_internal(struct drm_mode_set *set)
451 * drm_mode_set_config_internal - helper to call &drm_mode_config_funcs.set_config
452 * @set: modeset config to set
453 *
454 * This is a little helper to wrap internal calls to the
455 * &drm_mode_config_funcs.set_config driver interface. The only thing it adds is
456 * correct refcounting dance.
457 *
458 * Returns:
459 * Zero on success, negative errno on failure.
460 */
461int drm_mode_set_config_internal(struct drm_mode_set *set)
462{ 451{
463 struct drm_crtc *crtc = set->crtc; 452 struct drm_crtc *crtc = set->crtc;
464 struct drm_framebuffer *fb; 453 struct drm_framebuffer *fb;
@@ -491,6 +480,25 @@ int drm_mode_set_config_internal(struct drm_mode_set *set)
491 480
492 return ret; 481 return ret;
493} 482}
483/**
484 * drm_mode_set_config_internal - helper to call &drm_mode_config_funcs.set_config
485 * @set: modeset config to set
486 *
487 * This is a little helper to wrap internal calls to the
488 * &drm_mode_config_funcs.set_config driver interface. The only thing it adds is
489 * correct refcounting dance.
490 *
491 * This should only be used by non-atomic legacy drivers.
492 *
493 * Returns:
494 * Zero on success, negative errno on failure.
495 */
496int drm_mode_set_config_internal(struct drm_mode_set *set)
497{
498 WARN_ON(drm_drv_uses_atomic_modeset(set->crtc->dev));
499
500 return __drm_mode_set_config_internal(set);
501}
494EXPORT_SYMBOL(drm_mode_set_config_internal); 502EXPORT_SYMBOL(drm_mode_set_config_internal);
495 503
496/** 504/**
@@ -688,7 +696,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
688 set.connectors = connector_set; 696 set.connectors = connector_set;
689 set.num_connectors = crtc_req->count_connectors; 697 set.num_connectors = crtc_req->count_connectors;
690 set.fb = fb; 698 set.fb = fb;
691 ret = drm_mode_set_config_internal(&set); 699 ret = __drm_mode_set_config_internal(&set);
692 700
693out: 701out:
694 if (fb) 702 if (fb)