diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-01-21 04:52:17 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-02-13 18:07:55 -0500 |
commit | 7e53f3a423146745a4e4bb93362d488dfad502a8 (patch) | |
tree | ae842901c15126d09ceade149e8c1c72a6766a46 /drivers/gpu/drm/i915/intel_display.c | |
parent | af5676f1f91585cabe811b8f697e32015e2be826 (diff) |
drm/fb-helper: fixup set_config semantics
While doing the modeset rework for drm/i915 I've noticed that the fb
helper is very liberal with the semantics of the ->set_config
interface:
- It doesn't bother clearing stale modes (e.g. when unplugging a
screen).
- It unconditionally sets the fb, even if no mode will be set on a
given crtc.
- The initial setup is a bit fun since we need to pick crtcs to decide
the desired fb size, but also should set the modeset->fb pointer.
Explain what's going on in the fixup code after the fb is allocated.
The crtc helper didn't really care, but the new i915 modeset
infrastructure did, so I've had to add a bunch of special-cases to
catch this.
Fix this all up and enforce the interface by converting the checks in
drm/i915/intel_display.c to BUG_ONs.
v2: Fix commit message spell fail spotted by Rob Clark.
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 24f2654338d2..ca8d5929063e 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -7978,14 +7978,9 @@ static int intel_crtc_set_config(struct drm_mode_set *set) | |||
7978 | BUG_ON(!set->crtc); | 7978 | BUG_ON(!set->crtc); |
7979 | BUG_ON(!set->crtc->helper_private); | 7979 | BUG_ON(!set->crtc->helper_private); |
7980 | 7980 | ||
7981 | if (!set->mode) | 7981 | /* Enforce sane interface api - has been abused by the fb helper. */ |
7982 | set->fb = NULL; | 7982 | BUG_ON(!set->mode && set->fb); |
7983 | 7983 | BUG_ON(set->fb && set->num_connectors == 0); | |
7984 | /* The fb helper likes to play gross jokes with ->mode_set_config. | ||
7985 | * Unfortunately the crtc helper doesn't do much at all for this case, | ||
7986 | * so we have to cope with this madness until the fb helper is fixed up. */ | ||
7987 | if (set->fb && set->num_connectors == 0) | ||
7988 | return 0; | ||
7989 | 7984 | ||
7990 | if (set->fb) { | 7985 | if (set->fb) { |
7991 | DRM_DEBUG_KMS("[CRTC:%d] [FB:%d] #connectors=%d (x y) (%i %i)\n", | 7986 | DRM_DEBUG_KMS("[CRTC:%d] [FB:%d] #connectors=%d (x y) (%i %i)\n", |