Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp308543ima; Wed, 24 Oct 2018 01:24:33 -0700 (PDT) X-Google-Smtp-Source: AJdET5fjHW67+c//C5GRkw6z1b8QT8ak1y3kw931ql78TThtl3zlOifFZIQSkuASaIRReLjmpWFj X-Received: by 2002:a63:c908:: with SMTP id o8-v6mr1653552pgg.261.1540369472942; Wed, 24 Oct 2018 01:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540369472; cv=none; d=google.com; s=arc-20160816; b=WW1+Ut/U/AgLiKIJrxE1w3/pdTWe73L0/NK5ViIT9+iOwcmwSqL7HTf4g9AxIfMvp2 cmDCnoxUvG1xXtY+MB0fdcj/AhAb0PRZN++UqCu1TYd6qAf/q64VU2ywEhvdkMwb6FlR F+Ejv1KZKw9uqYV/ulfNUcmnw0q2/lMKtPvtAh9Rs7yKOx6voTQCesR4iWV7rg2Mt7Lq 6dKwCr0muUHL859iqM+FUXbJ9KqQgk/QlkmGIdVVXHYco0cCQMk5840NGXBn7GZ2O3AP 9+gz3F2TS5bE+7zGxl1+fvlTPOLzc3PS/LuHDN2TEECKEzBQbYEwt7lzeMRJ4P7kx8lL z6bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=6+7eELi3Dl3fc1kbCQRO2I3iA0eTqxALS+QOKjk6vVA=; b=ZtgXAoXFNgV04vc6pnC64o4Nppjnyo4s1MN4E9fp7wW5tdjhY6WLnRT1zS4bodaJPg y/d7tuZVRMqVmSkgUe+/cJmOor2HfNKxAP1Q2cCUvWSyERt0bysUDbVxKOsVDBvhOZsE tY8h5sA4+BghohNSg2jETe3WdapuY0pSwVhTZE7/xrjOHxyMHMlp4NElBr5nolAl6Nnc sOQf22zFB6I9TaLtRryEtD2FJk8AnsfkmbPwuqmg27a0hAPNqKp8rG3Ds+VmE7NmMj7I s/ilb18d0eZ4iSpuHbp5V1RN+ZzPO4lM7LXJZ0YJTu018ltVyUhZ09xWZVnZGKKhun7J m/RQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13-v6si4063336pgk.21.2018.10.24.01.24.18; Wed, 24 Oct 2018 01:24:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727365AbeJXQuy (ORCPT + 99 others); Wed, 24 Oct 2018 12:50:54 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:60653 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbeJXQux (ORCPT ); Wed, 24 Oct 2018 12:50:53 -0400 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=localhost) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFES7-000830-RK; Wed, 24 Oct 2018 10:23:43 +0200 Message-ID: <896bdd27a559a7c9508524f9b618d480d392bf46.camel@pengutronix.de> Subject: Re: [PATCH v1 1/2] drm: Add missing flags for pixel clock & data enable From: Lucas Stach To: Daniel Vetter , Benjamin Gaignard Cc: sean@poorly.run, Benjamin GAIGNARD , David Airlie , Philippe Cornu , ML dri-devel , Linux Kernel Mailing List , Yannick Fertre , Vincent Abriou Date: Wed, 24 Oct 2018 10:23:40 +0200 In-Reply-To: <20181024081658.GD324@phenom.ffwll.local> References: <1537788981-21479-1-git-send-email-yannick.fertre@st.com> <1537788981-21479-2-git-send-email-yannick.fertre@st.com> <20181024081658.GD324@phenom.ffwll.local> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-1.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, den 24.10.2018, 10:16 +0200 schrieb Daniel Vetter: > On Tue, Oct 23, 2018 at 04:50:19PM +0200, Benjamin Gaignard wrote: > > Le lun. 15 oct. 2018 à 13:15, Benjamin Gaignard > > a écrit : > > > > > > Le lun. 24 sept. 2018 à 13:59, Yannick Fertré a écrit : > > > > > > > > Add missing flags for pixel clock & data enable polarities. > > > > These flags are similar to other synchronization signals (hsync, vsync...). > > > > > > > > Signed-off-by: Yannick Fertré > > > > > > Reviewed-by: Benjamin Gaignard > > > > Dave or Daniel could you give us your PoV on this patch ? > > Does it work? Iirc we had some userspace chocking on new mode flags, and > needed explicit opt-in. If that looks good (check weston, -modesetting and > drm_hwc, that should have you covered I hope) then has my ack. What's the use of exposing those to userspace? There are a number of drivers that already have to deal with this and they are totally fine with keeping this information internal to the driver. For reference see include/video/display_timing.h, specifically the enum display_flags. Regards, Lucas > -Daniel > > > Thanks > > > > > > > > > --- > > > > drivers/gpu/drm/drm_modes.c | 19 ++++++++++++++++++- > > > > include/uapi/drm/drm_mode.h | 6 ++++++ > > > > 2 files changed, 24 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c > > > > index 02db9ac..596f8b3 100644 > > > > --- a/drivers/gpu/drm/drm_modes.c > > > > +++ b/drivers/gpu/drm/drm_modes.c > > > > @@ -130,7 +130,7 @@ EXPORT_SYMBOL(drm_mode_probed_add); > > > > * according to the hdisplay, vdisplay, vrefresh. > > > > * It is based from the VESA(TM) Coordinated Video Timing Generator by > > > > * Graham Loveridge April 9, 2003 available at > > > > - * http://www.elo.utfsm.cl/~elo212/docs/CVTd6r1.xls > > > > + * http://www.elo.utfsm.cl/~elo212/docs/CVTd6r1.xls > > > > * > > > > * And it is copied from xf86CVTmode in xserver/hw/xfree86/modes/xf86cvt.c. > > > > * What I have done is to translate it by using integer calculation. > > > > @@ -611,6 +611,15 @@ void 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_PIXDATA_POSEDGE) > > > > + dmode->flags |= DRM_MODE_FLAG_PPIXCLK; > > > > + else if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) > > > > + dmode->flags |= DRM_MODE_FLAG_NPIXCLK; > > > > + if (vm->flags & DISPLAY_FLAGS_DE_HIGH) > > > > + dmode->flags |= DRM_MODE_FLAG_PDATAEN; > > > > + else if (vm->flags & DISPLAY_FLAGS_DE_LOW) > > > > + dmode->flags |= DRM_MODE_FLAG_NDE; > > > > + > > > > drm_mode_set_name(dmode); > > > > } > > > > EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode); > > > > @@ -652,6 +661,14 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, > > > > vm->flags |= DISPLAY_FLAGS_DOUBLESCAN; > > > > if (dmode->flags & DRM_MODE_FLAG_DBLCLK) > > > > vm->flags |= DISPLAY_FLAGS_DOUBLECLK; > > > > + if (dmode->flags & DRM_MODE_FLAG_PPIXDATA) > > > > + vm->flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE; > > > > + else if (dmode->flags & DRM_MODE_FLAG_NPIXDATA) > > > > + vm->flags |= DISPLAY_FLAGS_PIXDATA_NEGEDGE; > > > > + if (dmode->flags & DRM_MODE_FLAG_PDE) > > > > + vm->flags |= DISPLAY_FLAGS_DE_HIGH; > > > > + else if (dmode->flags & DRM_MODE_FLAG_NDE) > > > > + vm->flags |= DISPLAY_FLAGS_DE_LOW; > > > > } > > > > EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode); > > > > > > > > diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h > > > > index d3e0fe3..b335a17 100644 > > > > --- a/include/uapi/drm/drm_mode.h > > > > +++ b/include/uapi/drm/drm_mode.h > > > > @@ -89,6 +89,12 @@ extern "C" { > > > > #define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) > > > > #define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) > > > > > > > > +/* flags for polarity clock & data enable polarities */ > > > > +#define DRM_MODE_FLAG_PPIXDATA (1 << 19) > > > > +#define DRM_MODE_FLAG_NPIXDATA (1 << 20) > > > > +#define DRM_MODE_FLAG_PDE (1 << 21) > > > > +#define DRM_MODE_FLAG_NDE (1 << 22) > > > > + > > > > /* Picture aspect ratio options */ > > > > #define DRM_MODE_PICTURE_ASPECT_NONE 0 > > > > #define DRM_MODE_PICTURE_ASPECT_4_3 1 > > > > -- > > > > 2.7.4 > > > > > > > > _______________________________________________ > > > > dri-devel mailing list > > > > dri-devel@lists.freedesktop.org > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > > > > -- > > Benjamin Gaignard > > > > Graphic Study Group > > > > Linaro.org │ Open source software for ARM SoCs > > > > Follow Linaro: Facebook | Twitter | Blog > >