From patchwork Tue Nov 12 16:49:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denis Carikli X-Patchwork-Id: 3173771 Return-Path: X-Original-To: patchwork-linux-arm@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 BBE87C045B for ; Tue, 12 Nov 2013 16:50:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D55C205C5 for ; Tue, 12 Nov 2013 16:50:16 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A303A205CD for ; Tue, 12 Nov 2013 16:50:14 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgHAI-0005K1-Fe; Tue, 12 Nov 2013 16:50:10 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgHAF-0004Rc-RZ; Tue, 12 Nov 2013 16:50:07 +0000 Received: from smtp6-g21.free.fr ([2a01:e0c:1:1599::15]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgHAA-0004Qf-Ox for linux-arm-kernel@lists.infradead.org; Tue, 12 Nov 2013 16:50:05 +0000 Received: from denis-N73SV.local.eukrea.com (unknown [88.170.243.169]) by smtp6-g21.free.fr (Postfix) with ESMTP id A0CB28233F; Tue, 12 Nov 2013 17:49:27 +0100 (CET) From: Denis Carikli To: Shawn Guo Subject: [PATCHv3 1/8] drm: Add the lacking DRM_MODE_FLAG_* for matching the DISPLAY_FLAGS_* Date: Tue, 12 Nov 2013 17:49:18 +0100 Message-Id: <1384274965-30549-1-git-send-email-denis@eukrea.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131112_115003_752670_915641F8 X-CRM114-Status: GOOD ( 12.21 ) X-Spam-Score: -1.2 (-) Cc: Fabio Estevam , Sascha Hauer , =?UTF-8?q?Eric=20B=C3=A9nard?= , David Airlie , Greg Kroah-Hartman , Ville Syrjala , driverdev-devel@linuxdriverproject.org, dri-devel@lists.freedesktop.org, Denis Carikli , Matt Sealey , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 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 Without that fix, drivers using the drm_display_mode_from_videomode function will not be able to get certain information because some DISPLAY_FLAGS_* have no corresponding DRM_MODE_FLAG_*. Cc: Greg Kroah-Hartman Cc: driverdev-devel@linuxdriverproject.org Cc: Matt Sealey Cc: David Airlie Cc: Ville Syrjala Cc: dri-devel@lists.freedesktop.org Cc: Fabio Estevam Cc: Sascha Hauer Cc: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org Cc: Eric Bénard Signed-off-by: Denis Carikli --- ChangeLog v2->v3: - Added some interested people in the Cc list. - Removed a duplicated Cc. - Changed the flags names to match the one in DISPLAY_FLAGS. - Moved the flags out of the userspace headers. - Updated the rest of the code accordingly. --- drivers/gpu/drm/drm_modes.c | 9 +++++++++ include/drm/drm_mode.h | 34 ++++++++++++++++++++++++++++++++++ include/uapi/drm/drm_mode.h | 4 ++-- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 include/drm/drm_mode.h diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index fc2adb6..586c12f 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -537,6 +537,15 @@ int drm_display_mode_from_videomode(const struct videomode *vm, dmode->flags |= DRM_MODE_FLAG_DBLSCAN; if (vm->flags & DISPLAY_FLAGS_DOUBLECLK) dmode->flags |= DRM_MODE_FLAG_DBLCLK; + if (vm->flags & DISPLAY_FLAGS_DE_LOW) + dmode->flags |= DRM_MODE_FLAG_DE_LOW; + if (vm->flags & DISPLAY_FLAGS_DE_HIGH) + dmode->flags |= DRM_MODE_FLAG_DE_HIGH; + if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE) + dmode->flags |= DRM_MODE_FLAG_PIXDATA_POSEDGE; + if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) + dmode->flags |= DRM_MODE_FLAG_PIXDATA_NEGEDGE; + drm_mode_set_name(dmode); return 0; diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h new file mode 100644 index 0000000..07e5259 --- /dev/null +++ b/include/drm/drm_mode.h @@ -0,0 +1,34 @@ +/* + * Copyright 2013 Eukréa Electromatique + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef _DRM_MODE_H +#define _DRM_MODE_H + +#include + +/* DISPLAY_FLAGS DRM counterpart */ +#define DRM_MODE_FLAG_DE_HIGH (1<<22) +#define DRM_MODE_FLAG_DE_LOW (1<<23) +#define DRM_MODE_FLAG_PIXDATA_POSEDGE (1<<24) +#define DRM_MODE_FLAG_PIXDATA_NEGEDGE (1<<25) + +#endif diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 28acbaf..5681897 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -24,8 +24,8 @@ * IN THE SOFTWARE. */ -#ifndef _DRM_MODE_H -#define _DRM_MODE_H +#ifndef _UAPI_DRM_MODE_H +#define _UAPI_DRM_MODE_H #include