aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/display.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2011-09-08 09:12:16 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 09:16:29 -0400
commita3b3cc2b883aac18a3388a405db809a99d66e3cf (patch)
treeca9332ca3160df6005077d2235c655ac6021c3d8 /drivers/video/omap2/dss/display.c
parent569969d6015f846926267cc40ed5fec936717f68 (diff)
OMAP: DSS2: Create an enum for DSI pixel formats
Currently, DSI pixel info is only represented by the pixel size in bits using the pixel_size parameter in omap_dss_device struct's ctrl member. This is not sufficient information for DSI video mode usage, as two of the supported formats(RGB666 loosely packed, and RGB888) have the same pixel container size, but different data_type values for the video mode packet header. Create enum "omap_dss_dsi_pixel_format" which describes the pixel data format the panel is configured for. Create helper function dsi_get_pixel_size() which returns the pixel size of the given pixel format. Modify functions omapdss_default_get_recommended_bpp() and dss_use_replication() to use dsi_get_pixel_size(). Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/display.c')
-rw-r--r--drivers/video/omap2/dss/display.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 2c6e2bc5e20..be331dc5a61 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -299,11 +299,15 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev)
299 return 16; 299 return 16;
300 300
301 case OMAP_DISPLAY_TYPE_DBI: 301 case OMAP_DISPLAY_TYPE_DBI:
302 case OMAP_DISPLAY_TYPE_DSI:
303 if (dssdev->ctrl.pixel_size == 24) 302 if (dssdev->ctrl.pixel_size == 24)
304 return 24; 303 return 24;
305 else 304 else
306 return 16; 305 return 16;
306 case OMAP_DISPLAY_TYPE_DSI:
307 if (dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt) > 16)
308 return 24;
309 else
310 return 16;
307 case OMAP_DISPLAY_TYPE_VENC: 311 case OMAP_DISPLAY_TYPE_VENC:
308 case OMAP_DISPLAY_TYPE_SDI: 312 case OMAP_DISPLAY_TYPE_SDI:
309 case OMAP_DISPLAY_TYPE_HDMI: 313 case OMAP_DISPLAY_TYPE_HDMI:
@@ -339,9 +343,11 @@ bool dss_use_replication(struct omap_dss_device *dssdev,
339 bpp = 24; 343 bpp = 24;
340 break; 344 break;
341 case OMAP_DISPLAY_TYPE_DBI: 345 case OMAP_DISPLAY_TYPE_DBI:
342 case OMAP_DISPLAY_TYPE_DSI:
343 bpp = dssdev->ctrl.pixel_size; 346 bpp = dssdev->ctrl.pixel_size;
344 break; 347 break;
348 case OMAP_DISPLAY_TYPE_DSI:
349 bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt);
350 break;
345 default: 351 default:
346 BUG(); 352 BUG();
347 } 353 }