[PATCH 10/12] drm: Don't allow multiple buffers fb with stereo modes

Damien Lespiau
2013-09-16T17:48:53Z

There are a few things to be flushed out if we want to allow multiple
buffers stereo framebuffers:
- What with drm_planes? what semantics do they follow, what is the
hardware able to do with them?
- How do we define which buffer if the right/left one
- Do we allow flips between 1 buffer fbs and 2 buffers fbs (No.)

So for now, and until I get access to hardware that can do that, let's
just disallow 2 buffers stereo framebuffers to not introduce ABI we
wouldn't be able to change afterwards.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
drivers/gpu/drm/drm_crtc.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 39f60ec..91d1c4b 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2131,6 +2131,17 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
goto out;
}

+ /*
+ * Do not allow the use of framebuffers consisting of multiple
+ * buffers with stereo modes until all the details API details
+ * are fleshed out (eg. interaction with drm_planes, switch
+ * between a 1 buffers and a 2 buffers fb, ...)
+ */
+ if (fb->num_buffers > 1 && drm_mode_is_stereo(mode)) {
+ ret = -EINVAL;
+ goto out;
+ }
+
drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);

hdisplay = mode->hdisplay;
--
1.8.3.1