public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mxsfb: DATA_FORMAT_24_BIT flag outputs invalid colours
@ 2013-05-23 11:55 Hector Palacios
  2013-05-23 13:00 ` maxime.ripard
  0 siblings, 1 reply; 17+ messages in thread
From: Hector Palacios @ 2013-05-23 11:55 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org
  Cc: fabio.estevam@freescale.com, s.hauer,
	maxime.ripard@free-electrons.com, brian

Hello,

I'm using an i.MX28 based board with lcd connected with 18bits data bus.
My platform uses 32 bits per pixel:

	mxsfb_pdata.default_bpp = 32;
	mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;

With these settings the mxsfb.c driver sets flag DATA_FORMAT_24_BIT at HW_LCDIF_CTRL 
register in function mxsfb_set_par():

	case 32:
		dev_dbg(&host->pdev->dev, "Setting up RGB888/666 mode\n");
		ctrl |= CTRL_SET_WORD_LENGTH(3);
		switch (host->ld_intf_width) {
		case STMLCDIF_8BIT:
			dev_dbg(&host->pdev->dev,
					"Unsupported LCD bus width mapping\n");
			return -EINVAL;
		case STMLCDIF_16BIT:
		case STMLCDIF_18BIT:
			/* 24 bit to 18 bit mapping */
			ctrl |= CTRL_DF24; /* ignore the upper 2 bits in
					    *  each colour component
					    */
			break;
		case STMLCDIF_24BIT:
			/* real 24 bit */
			break;
		}

According to the manual, this flag does:
	0x0: ALL_24_BITS_VALID: Data input to the block is in 24 bpp format, such that all 
RGB 888 data is contained in 24 bits.
	0x1: DROP_UPPER_2_BITS_PER_BYTE — Data input to the block is actually RGB 18 bpp, but 
there is 1 colour per byte, hence the upper 2 bits in each byte do not contain any 
useful data, and should be dropped.

The setting of this flag is producing bad colours with true colour images (i.e. the 
Linux penguin is displayed ok, but QT applications or images displayed with fbv are not).
I believe the setting of this flag is not correct (after all, if my bpp is 32, then 
all 24bit colours are useful and dropping the upper 2 bits is a bad idea).
If I don't set it, then true colour images are displayed correctly. The only problem 
is that the Linux penguin is displayed much darker than usual (correct colours, but 
darker). Perhaps the 224 colour format of this image justifies it?

I noticed the cfa10049 platform also uses the same configuration (18 bits data bus and 
32bpp) and was wondering if true colour images are correctly displayed in this 
platform with this flag set (for example with fbv application [1]).

Regards,
-- 
Héctor Palacios

[1] http://freecode.com/projects/fbv

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-06-18  8:46 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23 11:55 mxsfb: DATA_FORMAT_24_BIT flag outputs invalid colours Hector Palacios
2013-05-23 13:00 ` maxime.ripard
2013-05-23 13:31   ` Juergen Beisert
2013-05-23 15:56     ` Hector Palacios
2013-05-24 10:28       ` Juergen Beisert
2013-05-24 10:43         ` Hector Palacios
2013-05-24 11:00           ` Juergen Beisert
2013-05-24 13:33             ` Juergen Beisert
2013-06-07  7:21               ` maxime.ripard
2013-06-07  7:28                 ` Hector Palacios
2013-06-07  7:34                   ` Juergen Beisert
2013-06-07  7:42                   ` maxime.ripard
2013-06-07  8:10                     ` [PATCH] video: mxsfb: fix color settings for 18bit data bus and 32bpp Hector Palacios
2013-06-07  9:02                       ` maxime.ripard
2013-06-18  8:32                         ` maxime.ripard
2013-06-18  8:45                           ` Hector Palacios
2013-05-24  8:11     ` mxsfb: DATA_FORMAT_24_BIT flag outputs invalid colours maxime.ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox