]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
drm/armada: add comments about HWC32 cursor colour format
authorRussell King <rmk+kernel@armlinux.org.uk>
Sun, 1 Jul 2018 14:46:54 +0000 (15:46 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Fri, 17 May 2019 11:16:32 +0000 (12:16 +0100)
Add some comments about the format of the HWC32 cursor colour format.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
drivers/gpu/drm/armada/armada_crtc.c

index 5991feb1bcc9f4b69b2ed3575d793adf0fa92684..e81e57823b66d797914012767cfb31d1602f1c28 100644 (file)
@@ -515,6 +515,13 @@ static void armada_load_cursor_argb(void __iomem *base, uint32_t *pix,
                for (x = 0; x < width; x++, p++) {
                        uint32_t val = *p;
 
+                       /*
+                        * In "ARGB888" (HWC32) mode, writing to the SRAM
+                        * requires these bits to contain:
+                        * 31:24 = alpha 23:16 = blue 15:8 = green 7:0 = red
+                        * So, it's actually ABGR8888.  This is independent
+                        * of the SWAPRB bits in DMA control register 0.
+                        */
                        val = (val & 0xff00ff00) |
                              (val & 0x000000ff) << 16 |
                              (val & 0x00ff0000) >> 16;