Skip to contentSkip to conversation

drm: Add the lacking DRM_MODE_FLAG_* for matching the DISPLAY_FLAGS_*

PATCH In review Denis Carikli 7 participants 11 messages Nov 12, 2013 – Nov 13, 2013 1 message not in the archive

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/8 drm: Add the lacking DRM_MODE_FLAG_* for matching the DISPLAY_FLAGS_*

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 <[email protected]>
Cc Matt Sealey <[email protected]>
Cc David Airlie <[email protected]>
Cc Ville Syrjala <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Eric Bénard <[email protected]>

---
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
drivers/gpu/drm/drm_modes.c +9 -0
index fc2adb6..586c12f 100644
@@ -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;
include/drm/drm_mode.h new file +34 -0
new file mode 100644
index 0000000..07e5259
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2013 Eukréa Electromatique <[email protected]>
+ *
+ * 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 <uapi/drm/drm_mode.h>
+
+/* 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
include/uapi/drm/drm_mode.h +2 -2
index 28acbaf..5681897 100644
@@ -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 <linux/types.h>
 
Signature · 6 lines
1.7.9.5

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#1 lore raw

PATCH v3 2/8 v4l2: add new V4L2_PIX_FMT_RGB666 pixel format.

That new macro is needed by the imx_drm staging driver
for supporting the QVGA display of the eukrea-cpuimx51 board.

Cc Rob Herring <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc David Airlie <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Eric Bénard <[email protected]>

---
ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Added Mauro Carvalho Chehab's Ack.
- Added documentation.

---
 .../DocBook/media/v4l/pixfmt-packed-rgb.xml        |   78 ++++++++++++++++++++
 include/uapi/linux/videodev2.h                     |    1 +
 2 files changed, 79 insertions(+)
Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml +78 -0
index 166c8d6..f6a3e84 100644
@@ -279,6 +279,45 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para>
 	    <entry></entry>
 	    <entry></entry>
 	  </row>
+	  <row id="V4L2-PIX-FMT-RGB666">
+	    <entry><constant>V4L2_PIX_FMT_RGB666</constant></entry>
+	    <entry>'RGBH'</entry>
+	    <entry></entry>
+	    <entry>r<subscript>5</subscript></entry>
+	    <entry>r<subscript>4</subscript></entry>
+	    <entry>r<subscript>3</subscript></entry>
+	    <entry>r<subscript>2</subscript></entry>
+	    <entry>r<subscript>1</subscript></entry>
+	    <entry>r<subscript>0</subscript></entry>
+	    <entry>g<subscript>5</subscript></entry>
+	    <entry>g<subscript>4</subscript></entry>
+	    <entry></entry>
+	    <entry>g<subscript>3</subscript></entry>
+	    <entry>g<subscript>2</subscript></entry>
+	    <entry>g<subscript>1</subscript></entry>
+	    <entry>g<subscript>0</subscript></entry>
+	    <entry>b<subscript>5</subscript></entry>
+	    <entry>b<subscript>4</subscript></entry>
+	    <entry>b<subscript>3</subscript></entry>
+	    <entry>b<subscript>2</subscript></entry>
+	    <entry></entry>
+	    <entry>b<subscript>1</subscript></entry>
+	    <entry>b<subscript>0</subscript></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	  </row>
 	  <row id="V4L2-PIX-FMT-BGR24">
 	    <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry>
 	    <entry>'BGR3'</entry>
@@ -781,6 +820,45 @@ defined in error. Drivers may interpret them as in <xref
 	    <entry></entry>
 	    <entry></entry>
 	  </row>
+	  <row><!-- id="V4L2-PIX-FMT-RGB666" -->
+	    <entry><constant>V4L2_PIX_FMT_RGB666</constant></entry>
+	    <entry>'RGBH'</entry>
+	    <entry></entry>
+	    <entry>r<subscript>5</subscript></entry>
+	    <entry>r<subscript>4</subscript></entry>
+	    <entry>r<subscript>3</subscript></entry>
+	    <entry>r<subscript>2</subscript></entry>
+	    <entry>r<subscript>1</subscript></entry>
+	    <entry>r<subscript>0</subscript></entry>
+	    <entry>g<subscript>5</subscript></entry>
+	    <entry>g<subscript>4</subscript></entry>
+	    <entry></entry>
+	    <entry>g<subscript>3</subscript></entry>
+	    <entry>g<subscript>2</subscript></entry>
+	    <entry>g<subscript>1</subscript></entry>
+	    <entry>g<subscript>0</subscript></entry>
+	    <entry>b<subscript>5</subscript></entry>
+	    <entry>b<subscript>4</subscript></entry>
+	    <entry>b<subscript>3</subscript></entry>
+	    <entry>b<subscript>2</subscript></entry>
+	    <entry></entry>
+	    <entry>b<subscript>1</subscript></entry>
+	    <entry>b<subscript>0</subscript></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	  </row>
 	  <row><!-- id="V4L2-PIX-FMT-BGR24" -->
 	    <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry>
 	    <entry>'BGR3'</entry>
include/uapi/linux/videodev2.h +1 -0
index 437f1b0..e8ff410 100644
@@ -294,6 +294,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16  RGB-5-5-5 BE  */
 #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16  RGB-5-6-5 BE  */
 #define V4L2_PIX_FMT_BGR666  v4l2_fourcc('B', 'G', 'R', 'H') /* 18  BGR-6-6-6	  */
+#define V4L2_PIX_FMT_RGB666  v4l2_fourcc('R', 'G', 'B', 'H') /* 18  RGB-6-6-6	  */
 #define V4L2_PIX_FMT_BGR24   v4l2_fourcc('B', 'G', 'R', '3') /* 24  BGR-8-8-8     */
 #define V4L2_PIX_FMT_RGB24   v4l2_fourcc('R', 'G', 'B', '3') /* 24  RGB-8-8-8     */
 #define V4L2_PIX_FMT_BGR32   v4l2_fourcc('B', 'G', 'R', '4') /* 32  BGR-8-8-8-8   */
Signature · 6 lines
1.7.9.5

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Acked-by on v3 2/8
#2 lore raw

Re: [PATCHv3 2/8] [media] v4l2: add new V4L2_PIX_FMT_RGB666 pixel format.

Hi Denis,

(Dropping the DT reviewers from the CC list to avoid spamming them)

Thank you for the patch.

Quoted 14 lines · On Tuesday 12 November 2013 17:49:19 Denis Carikli wrote:

That new macro is needed by the imx_drm staging driver
for supporting the QVGA display of the eukrea-cpuimx51 board.

Cc Rob Herring <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc David Airlie <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Quoted 8 lines
Quoted 122 lines

---
ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Added Mauro Carvalho Chehab's Ack.
- Added documentation.

---
 .../DocBook/media/v4l/pixfmt-packed-rgb.xml        |   78
++++++++++++++++++++ include/uapi/linux/videodev2.h                     |  
 1 +
 2 files changed, 79 insertions(+)
(quoted diff) +0 -0

b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml index 166c8d6..f6a3e84 100644

Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml +0 -0
@@ -279,6 +279,45 @@ colorspace

<constant>V4L2_COLORSPACE_SRGB</constant>.</para> <entry></entry>

Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml +39 -0
 	    <entry></entry>
 	  </row>
+	  <row id="V4L2-PIX-FMT-RGB666">
+	    <entry><constant>V4L2_PIX_FMT_RGB666</constant></entry>
+	    <entry>'RGBH'</entry>
+	    <entry></entry>
+	    <entry>r<subscript>5</subscript></entry>
+	    <entry>r<subscript>4</subscript></entry>
+	    <entry>r<subscript>3</subscript></entry>
+	    <entry>r<subscript>2</subscript></entry>
+	    <entry>r<subscript>1</subscript></entry>
+	    <entry>r<subscript>0</subscript></entry>
+	    <entry>g<subscript>5</subscript></entry>
+	    <entry>g<subscript>4</subscript></entry>
+	    <entry></entry>
+	    <entry>g<subscript>3</subscript></entry>
+	    <entry>g<subscript>2</subscript></entry>
+	    <entry>g<subscript>1</subscript></entry>
+	    <entry>g<subscript>0</subscript></entry>
+	    <entry>b<subscript>5</subscript></entry>
+	    <entry>b<subscript>4</subscript></entry>
+	    <entry>b<subscript>3</subscript></entry>
+	    <entry>b<subscript>2</subscript></entry>
+	    <entry></entry>
+	    <entry>b<subscript>1</subscript></entry>
+	    <entry>b<subscript>0</subscript></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	  </row>
 	  <row id="V4L2-PIX-FMT-BGR24">
 	    <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry>
 	    <entry>'BGR3'</entry>
@@ -781,6 +820,45 @@ defined in error. Drivers may interpret them as in

<xref <entry></entry>

Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml +39 -0
 	    <entry></entry>
 	  </row>
+	  <row><!-- id="V4L2-PIX-FMT-RGB666" -->
+	    <entry><constant>V4L2_PIX_FMT_RGB666</constant></entry>
+	    <entry>'RGBH'</entry>
+	    <entry></entry>
+	    <entry>r<subscript>5</subscript></entry>
+	    <entry>r<subscript>4</subscript></entry>
+	    <entry>r<subscript>3</subscript></entry>
+	    <entry>r<subscript>2</subscript></entry>
+	    <entry>r<subscript>1</subscript></entry>
+	    <entry>r<subscript>0</subscript></entry>
+	    <entry>g<subscript>5</subscript></entry>
+	    <entry>g<subscript>4</subscript></entry>
+	    <entry></entry>
+	    <entry>g<subscript>3</subscript></entry>
+	    <entry>g<subscript>2</subscript></entry>
+	    <entry>g<subscript>1</subscript></entry>
+	    <entry>g<subscript>0</subscript></entry>
+	    <entry>b<subscript>5</subscript></entry>
+	    <entry>b<subscript>4</subscript></entry>
+	    <entry>b<subscript>3</subscript></entry>
+	    <entry>b<subscript>2</subscript></entry>
+	    <entry></entry>
+	    <entry>b<subscript>1</subscript></entry>
+	    <entry>b<subscript>0</subscript></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	    <entry></entry>
+	  </row>
 	  <row><!-- id="V4L2-PIX-FMT-BGR24" -->
 	    <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry>
 	    <entry>'BGR3'</entry>
include/uapi/linux/videodev2.h +0 -0
index 437f1b0..e8ff410 100644
@@ -294,6 +294,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 
 RGB-5-5-5 BE  */ #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B',
 'R') /* 16  RGB-5-6-5 BE  */ #define V4L2_PIX_FMT_BGR666  v4l2_fourcc('B',

'G', 'R', 'H') /* 18 BGR-6-6-6 */ +#define V4L2_PIX_FMT_RGB666
v4l2_fourcc('R', 'G', 'B', 'H') /* 18 RGB-6-6-6 */ #define
V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8
*/ #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24
RGB-8-8-8 */ #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R',
'4') /* 32 BGR-8-8-8-8 */

Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw

PATCH v3 3/8 staging: imx-drm: ipuv3-crtc: don't harcode some mode flags.

In reply to Denis Carikli

This change is needed for making the eukrea-cpuimx51
QVGA display work.

Greg Kroah-Hartman <[email protected]>

---
 drivers/staging/imx-drm/ipuv3-crtc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Ajusted the flags to match the changes in "drm: Add the lacking DRM_MODE_FLAG_* for matching the DISPLAY_FLAGS_*"
---

drivers/staging/imx-drm/ipuv3-crtc.c +4 -2
index 670a56a..917818c 100644
@@ -155,9 +155,11 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
 		sig_cfg.Hsync_pol = 1;
 	if (mode->flags & DRM_MODE_FLAG_PVSYNC)
 		sig_cfg.Vsync_pol = 1;
+	if (mode->flags & DRM_MODE_FLAG_DE_HIGH)
+		sig_cfg.enable_pol = 1;
+	if (mode->flags & DRM_MODE_FLAG_PIXDATA_POSEDGE)
+		sig_cfg.clk_pol = 1;
 
-	sig_cfg.enable_pol = 1;
-	sig_cfg.clk_pol = 1;
 	sig_cfg.width = mode->hdisplay;
 	sig_cfg.height = mode->vdisplay;
 	sig_cfg.pixel_fmt = out_pixel_fmt;
Signature · 6 lines
1.7.9.5

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
reviewer
#4 lore raw

Re: [PATCHv3 3/8] staging: imx-drm: ipuv3-crtc: don't harcode some mode flags.

Hi Denis,

Quoted 26 lines · Denis Carikli

This change is needed for making the eukrea-cpuimx51
QVGA display work.

Greg Kroah-Hartman <[email protected]>

Cc driverdev-devel at linuxdriverproject.org
Cc Philipp Zabel <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Shawn Guo <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc David Airlie <[email protected]>
Cc dri-devel at lists.freedesktop.org
Cc Eric B?nard <[email protected]>
---
 drivers/staging/imx-drm/ipuv3-crtc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Ajusted the flags to match the changes in "drm: Add the lacking DRM_MODE_FLAG_* for matching the DISPLAY_FLAGS_*"
---

drivers/staging/imx-drm/ipuv3-crtc.c +0 -0
index 670a56a..917818c 100644

drivers/staging/imx-drm/ipuv3-crtc.c static int ipu_crtc_mode_set(struct drm_crtc *crtc, · line 160

Quoted 10 lines
drivers/staging/imx-drm/ipuv3-crtc.c +4 -2
@@ -155,9 +155,11 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
                sig_cfg.Hsync_pol = 1;
        if (mode->flags & DRM_MODE_FLAG_PVSYNC)
                sig_cfg.Vsync_pol = 1;
+       if (mode->flags & DRM_MODE_FLAG_DE_HIGH)
+               sig_cfg.enable_pol = 1;
+       if (mode->flags & DRM_MODE_FLAG_PIXDATA_POSEDGE)
+               sig_cfg.clk_pol = 1;
 
-       sig_cfg.enable_pol = 1;
-       sig_cfg.clk_pol = 1;

What are the sig_cfg.enable_pol and sig_cfg.clk_pol values you need for your display to operate correctly?

#5 lore raw

Re: [PATCHv3 3/8] staging: imx-drm: ipuv3-crtc: don't harcode some mode flags.

Hi Fabio,

Quoted 6 lines · Fabio Estevam
Quoted 5 lines · Denis Carikli
drivers/staging/imx-drm/ipuv3-crtc.c +4 -0
+       if (mode->flags & DRM_MODE_FLAG_DE_HIGH)
+               sig_cfg.enable_pol = 1;
+       if (mode->flags & DRM_MODE_FLAG_PIXDATA_POSEDGE)
+               sig_cfg.clk_pol = 1;
Quoted 6 lines

drivers/staging/imx-drm/ipuv3-crtc.c static int ipu_crtc_mode_set(struct drm_crtc *crtc, · line 160

Quoted 2 lines
drivers/staging/imx-drm/ipuv3-crtc.c +0 -2
-       sig_cfg.enable_pol = 1;
-       sig_cfg.clk_pol = 1;

What are the sig_cfg.enable_pol and sig_cfg.clk_pol values you need for your display to operate correctly?

in ipuv3-crtc, line 159 :
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/imx-drm/ipuv3-crtc.c#n159

polarity of the enable signal and the pixel clock are hard coded to 1.

These settings are then used in ipu-di.c to configurer the IPU display interface :
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/imx-drm/ipu-v3/ipu-di.c#n631
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/imx-drm/ipu-v3/ipu-di.c#n642

This is a problem as the polarity of these signals can vary from one TFT panel to an other. In our case, we need and active low enable and a negative edge clock but currently there is no way to configure these settings in ipuv3-crtc as they are hardcoded to 1 : that's what Denis is trying to fix.

Eric

A message that is not in the archive (sent off-list or not yet received): 1384274965-30549-1-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org

#7 lore raw

PATCH v3 4/8 staging: imx-drm: Add RGB666 support for parallel display.

Cc Rob Herring <rob.herring-bsGFqQB8/[email protected]>
Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc driverdev-devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X@public.gmane.org
Cc David Airlie <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Shawn Guo <[email protected]>
Cc linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc Eric Bénard <[email protected]>

---
ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Removed the commit message long desciption that was just a copy of the short description.
- Rebased the patch.
- Fixed a copy-paste error in the ipu_dc_map_clear parameter.

---
 .../bindings/staging/imx-drm/fsl-imx-drm.txt       |    2 +-
 drivers/staging/imx-drm/ipu-v3/ipu-dc.c            |    9 +++++++++
 drivers/staging/imx-drm/parallel-display.c         |    2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +1 -1
index b876d49..2d24425 100644
@@ -29,7 +29,7 @@ Required properties:
 - crtc: the crtc this display is connected to, see below
 Optional properties:
 - interface_pix_fmt: How this display is connected to the
-  crtc. Currently supported types: "rgb24", "rgb565", "bgr666"
+  crtc. Currently supported types: "rgb24", "rgb565", "bgr666", "rgb666"
 - edid: verbatim EDID data block describing attached display.
 - ddc: phandle describing the i2c bus handling the display data
   channel
drivers/staging/imx-drm/ipu-v3/ipu-dc.c +9 -0
index d0e3bc3..bcc7680 100644
@@ -92,6 +92,7 @@ enum ipu_dc_map {
 	IPU_DC_MAP_GBR24, /* TVEv2 */
 	IPU_DC_MAP_BGR666,
 	IPU_DC_MAP_BGR24,
+	IPU_DC_MAP_RGB666,
 };
 
 struct ipu_dc {
@@ -155,6 +156,8 @@ static int ipu_pixfmt_to_map(u32 fmt)
 		return IPU_DC_MAP_BGR666;
 	case V4L2_PIX_FMT_BGR24:
 		return IPU_DC_MAP_BGR24;
+	case V4L2_PIX_FMT_RGB666:
+		return IPU_DC_MAP_RGB666;
 	default:
 		return -EINVAL;
 	}
@@ -404,6 +407,12 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,
 	ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 1, 15, 0xff); /* green */
 	ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 0, 23, 0xff); /* blue */
 
+	/* rgb666 */
+	ipu_dc_map_clear(priv, IPU_DC_MAP_RGB666);
+	ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 2, 17, 0xfc); /* red */
+	ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 1, 11, 0xfc); /* green */
+	ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 0, 5, 0xfc); /* blue */
+
 	return 0;
 }
 
drivers/staging/imx-drm/parallel-display.c +2 -0
index 24aa9be..bb71d6d 100644
@@ -222,6 +222,8 @@ static int imx_pd_probe(struct platform_device *pdev)
 			imxpd->interface_pix_fmt = V4L2_PIX_FMT_RGB565;
 		else if (!strcmp(fmt, "bgr666"))
 			imxpd->interface_pix_fmt = V4L2_PIX_FMT_BGR666;
+		else if (!strcmp(fmt, "rgb666"))
+			imxpd->interface_pix_fmt = V4L2_PIX_FMT_RGB666;
 	}
 
 	imxpd->dev = &pdev->dev;
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw
In reply to Denis Carikli
Quoted 7 lines · Denis Carikli
drivers/gpu/drm/drm_modes.c +0 -0
index fc2adb6..586c12f 100644
@@ -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)

drivers/gpu/drm/drm_modes.c int drm_display_mode_from_videomode(const struct videomode *vm, · line 548

Quoted 10 lines
drivers/gpu/drm/drm_modes.c +9 -0
 		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;
+

I'm still not convinced that these should be exposed in *any* way to userspace - I'm with Ville Syrjälä on this point.

Yes, you've moved their definition out of a uapi header file, but they're still leaking out of kernel space via calls (and with Xorg, they'll leak into the DisplayMode structures within the X server.)

Now, here's the thing... The polarity of the display enable signal. That's a property of the connected device right? It doesn't change with respect to the displayed mode unlike the hsync/vsync signals. If that's true, it should not be here.

Same goes for the pixel clock edge. If it's a property of the connected device and doesn't have a dependence on the displayed mode, then it should not be in the DRM mode structure.

#9 lore raw

Hi Russell,

Quoted 26 lines · Russell King - ARM Linux
Quoted 7 lines · Denis Carikli
drivers/gpu/drm/drm_modes.c +0 -0
index fc2adb6..586c12f 100644
@@ -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)

drivers/gpu/drm/drm_modes.c int drm_display_mode_from_videomode(const struct videomode *vm, · line 548

Quoted 10 lines
drivers/gpu/drm/drm_modes.c +9 -0
 		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;
+

I'm still not convinced that these should be exposed in *any* way to userspace - I'm with Ville Syrjälä on this point.

Yes, you've moved their definition out of a uapi header file, but they're still leaking out of kernel space via calls (and with Xorg, they'll leak into the DisplayMode structures within the X server.)

Quoted 8 lines

Now, here's the thing... The polarity of the display enable signal. That's a property of the connected device right? It doesn't change with respect to the displayed mode unlike the hsync/vsync signals. If that's true, it should not be here.

Same goes for the pixel clock edge. If it's a property of the connected device and doesn't have a dependence on the displayed mode, then it should not be in the DRM mode structure.

What would be the right way to configure these settings without exposing them to userspace ?

As explained in my answer to Fabio, these settings are currently hardcoded into ipuv3-crtc and we need to configure them to support more TFT panels using the IPUV3 Parallel Display Interface.

Thanks
Eric

#10 lore raw

Hi Eric,

Am Mittwoch, den 13.11.2013, 08:53 +0100 schrieb Eric B?nard:

Quoted 35 lines

Hi Russell,

Le Tue, 12 Nov 2013 17:04:55 +0000,
Russell King - ARM Linux <[email protected]> a ?crit :

Quoted 31 lines · Denis Carikli
Quoted 7 lines
drivers/gpu/drm/drm_modes.c +0 -0
index fc2adb6..586c12f 100644
@@ -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)

drivers/gpu/drm/drm_modes.c int drm_display_mode_from_videomode(const struct videomode *vm, · line 548

Quoted 10 lines
drivers/gpu/drm/drm_modes.c +9 -0
 		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;
+

I'm still not convinced that these should be exposed in *any* way to userspace - I'm with Ville Syrj?l? on this point.

Yes, you've moved their definition out of a uapi header file, but they're still leaking out of kernel space via calls (and with Xorg, they'll leak into the DisplayMode structures within the X server.)

Now, here's the thing... The polarity of the display enable signal. That's a property of the connected device right? It doesn't change with respect to the displayed mode unlike the hsync/vsync signals. If that's true, it should not be here.

Quoted 6 lines
Quoted 3 lines

Same goes for the pixel clock edge. If it's a property of the connected device and doesn't have a dependence on the displayed mode, then it should not be in the DRM mode structure.

What would be the right way to configure these settings without exposing them to userspace ?

I think as a property of the connected device, this should be obtained from the device tree node of the panel. In the v4l2 style device tree model this could also be made a property of the link (endpoint).

Quoted 3 lines

As explained in my answer to Fabio, these settings are currently hardcoded into ipuv3-crtc and we need to configure them to support more TFT panels using the IPUV3 Parallel Display Interface.

regards
Philipp

#11 lore raw
In reply to Eric Bénard
Quoted 39 lines · Eric Bénard

Hi Russell,

Quoted 26 lines · Russell King - ARM Linux
Quoted 7 lines · Denis Carikli
drivers/gpu/drm/drm_modes.c +0 -0
index fc2adb6..586c12f 100644
@@ -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)

drivers/gpu/drm/drm_modes.c int drm_display_mode_from_videomode(const struct videomode *vm, · line 548

Quoted 10 lines
drivers/gpu/drm/drm_modes.c +9 -0
 		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;
+

I'm still not convinced that these should be exposed in *any* way to userspace - I'm with Ville Syrjälä on this point.

Yes, you've moved their definition out of a uapi header file, but they're still leaking out of kernel space via calls (and with Xorg, they'll leak into the DisplayMode structures within the X server.)

Quoted 8 lines

Now, here's the thing... The polarity of the display enable signal. That's a property of the connected device right? It doesn't change with respect to the displayed mode unlike the hsync/vsync signals. If that's true, it should not be here.

Same goes for the pixel clock edge. If it's a property of the connected device and doesn't have a dependence on the displayed mode, then it should not be in the DRM mode structure.

Quoted 6 lines

What would be the right way to configure these settings without exposing them to userspace ?

As explained in my answer to Fabio, these settings are currently hardcoded into ipuv3-crtc and we need to configure them to support more TFT panels using the IPUV3 Parallel Display Interface.

First, realise that what you're doing is configuring components within the IMX driver "suite" so what you need to do is communicate your requirements _only_ from parallel-display.c to ipuv3-crtc.c.

There's already infrastructure in imx-drm for the display bridges to communicate various information to the CRTC layer - there's already the encoder type, and the "pins" for hsync/vsync being communicated via imx_drm_panel_format*(). This is really no different IMHO.