From patchwork Wed Sep 12 17:47:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Lespiau X-Patchwork-Id: 1445851 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 0773ADF238 for ; Wed, 12 Sep 2012 17:51:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 099229EEA4 for ; Wed, 12 Sep 2012 10:51:52 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id DFC039E830; Wed, 12 Sep 2012 10:47:43 -0700 (PDT) Received: by mail-we0-f177.google.com with SMTP id r3so1190524wey.36 for ; Wed, 12 Sep 2012 10:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=6Ydpvqrf6t7q1fgX8Vrf2gaVZFFFpkzqar32dyzXcKw=; b=vESki6ItwBUAIfIyq+3EpL+7Ntxrbm0QSy9/Da2r4gASg5zDoSY3bjiJhx64m4w7d9 OZ9R+9uySUiiEmdkqgLDdVUb6+ds8bw/nr/64rCc5pxFIP1PQlIYdVUthhmzdG82gVJO akyAOfv8d4cQyAL35fQ92Ba+Wx/WYVgonqpQIXhdLSyplEjELuq93RI7hN8yNOt/GSSG 2VBJX4DXkMeuOlxtIY3vdxkIRgDH2DXsnISHhJZnDmTWxL+WlOU75f6tkrjl9dmU3AZ4 9Eqj/6RtZq52oJ5BOAMoI67uQyQVhcxL+moE2dIUc2kMwKTMLhNmZlh+JAqOCPYAA0GQ 6uZA== Received: by 10.180.78.40 with SMTP id y8mr34358063wiw.7.1347472063534; Wed, 12 Sep 2012 10:47:43 -0700 (PDT) Received: from localhost.localdomain ([83.217.123.106]) by mx.google.com with ESMTPS id do5sm13660675wib.10.2012.09.12.10.47.42 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Sep 2012 10:47:42 -0700 (PDT) From: Damien Lespiau To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm: Add Stereo 3D properties Date: Wed, 12 Sep 2012 18:47:14 +0100 Message-Id: <1347472035-2816-3-git-send-email-damien.lespiau@gmail.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1347472035-2816-1-git-send-email-damien.lespiau@gmail.com> References: <1347472035-2816-1-git-send-email-damien.lespiau@gmail.com> 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 From: Damien Lespiau The "select 3D mode" property can be connected to connectors to signal user space that 3D framebuffers can be scanned out to the said connector. Signed-off-by: Damien Lespiau --- drivers/gpu/drm/drm_crtc.c | 32 ++++++++++++++++++++++++++++++++ include/drm/drm_crtc.h | 4 ++++ 2 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 6fbfc24..dcd6d81 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -841,6 +841,38 @@ int drm_mode_create_tv_properties(struct drm_device *dev, int num_modes, } EXPORT_SYMBOL(drm_mode_create_tv_properties); +static const struct drm_prop_enum_list s3d_modes_list[] = +{ + { 0, "None" }, + { DRM_MODE_FLAG_3D_TOP_BOTTOM, "Top bottom" }, + { DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF, "Side by side (half)" }, + { DRM_MODE_FLAG_3D_FRAME_PACKING, "Frame packing" } +}; + +/** + * drm_mode_create_3d_property - create stereo 3D properties + * @dev: DRM device + * + * Called by a driver the first time it's needed, must be attached to modes + * that supports stereo 3D formats. + */ +int drm_mode_create_3d_property(struct drm_device *dev) +{ + struct drm_property *s3d_selector; + + if (dev->mode_config.s3d_select_mode_property) + return 0; + + s3d_selector = drm_property_create_enum(dev, 0, + "select 3D mode", + s3d_modes_list, + ARRAY_SIZE(s3d_modes_list)); + dev->mode_config.s3d_select_mode_property = s3d_selector; + + return 0; +} +EXPORT_SYMBOL(drm_mode_create_3d_property); + /** * drm_mode_create_scaling_mode_property - create scaling mode property * @dev: DRM device diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index bfacf0d..5a6e024 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -802,6 +802,9 @@ struct drm_mode_config { struct drm_property *tv_saturation_property; struct drm_property *tv_hue_property; + /* Stereo 3D properties */ + struct drm_property *s3d_select_mode_property; + /* Optional properties */ struct drm_property *scaling_mode_property; struct drm_property *dithering_mode_property; @@ -950,6 +953,7 @@ extern int drm_property_add_enum(struct drm_property *property, int index, extern int drm_mode_create_dvi_i_properties(struct drm_device *dev); extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats, char *formats[]); +extern int drm_mode_create_3d_property(struct drm_device *dev); extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); extern int drm_mode_create_dithering_property(struct drm_device *dev); extern int drm_mode_create_dirty_info_property(struct drm_device *dev);