From patchwork Mon Sep 16 17:48:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 2899091 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9641FBFF05 for ; Mon, 16 Sep 2013 18:11:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF681201F5 for ; Mon, 16 Sep 2013 18:11:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B452B2018B for ; Mon, 16 Sep 2013 18:11:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 841CDE6F1B for ; Mon, 16 Sep 2013 11:11:55 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 3FA96E6B84; Mon, 16 Sep 2013 10:49:09 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 16 Sep 2013 10:49:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,917,1371106800"; d="scan'208";a="396522572" Received: from unknown (HELO strange.amr.corp.intel.com) ([10.255.15.2]) by fmsmga001.fm.intel.com with ESMTP; 16 Sep 2013 10:49:08 -0700 From: Damien Lespiau To: dri-devel@lists.freedesktop.org Subject: [PATCH 10/12] drm: Don't allow multiple buffers fb with stereo modes Date: Mon, 16 Sep 2013 18:48:53 +0100 Message-Id: <1379353735-4472-11-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1379353735-4472-1-git-send-email-damien.lespiau@intel.com> References: <1379353735-4472-1-git-send-email-damien.lespiau@intel.com> Cc: intel-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;