diff options
Diffstat (limited to 'drivers/video/omap2/dss/dss_features.c')
-rw-r--r-- | drivers/video/omap2/dss/dss_features.c | 181 |
1 files changed, 144 insertions, 37 deletions
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index afcb59301c37..ce14aa6dd672 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c | |||
@@ -41,7 +41,8 @@ struct omap_dss_features { | |||
41 | const struct dss_reg_field *reg_fields; | 41 | const struct dss_reg_field *reg_fields; |
42 | const int num_reg_fields; | 42 | const int num_reg_fields; |
43 | 43 | ||
44 | const u32 has_feature; | 44 | const enum dss_feat_id *features; |
45 | const int num_features; | ||
45 | 46 | ||
46 | const int num_mgrs; | 47 | const int num_mgrs; |
47 | const int num_ovls; | 48 | const int num_ovls; |
@@ -189,7 +190,8 @@ static const enum omap_color_mode omap4_dss_supported_color_modes[] = { | |||
189 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | | 190 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
190 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 | | 191 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 | |
191 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32 | | 192 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32 | |
192 | OMAP_DSS_COLOR_ARGB16_1555, | 193 | OMAP_DSS_COLOR_ARGB16_1555 | OMAP_DSS_COLOR_RGBX16 | |
194 | OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_XRGB16_1555, | ||
193 | 195 | ||
194 | /* OMAP_DSS_VIDEO1 */ | 196 | /* OMAP_DSS_VIDEO1 */ |
195 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U | | 197 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U | |
@@ -337,15 +339,110 @@ static const struct dss_param_range omap4_dss_param_range[] = { | |||
337 | [FEAT_PARAM_LINEWIDTH] = { 1, 2048 }, | 339 | [FEAT_PARAM_LINEWIDTH] = { 1, 2048 }, |
338 | }; | 340 | }; |
339 | 341 | ||
342 | static const enum dss_feat_id omap2_dss_feat_list[] = { | ||
343 | FEAT_LCDENABLEPOL, | ||
344 | FEAT_LCDENABLESIGNAL, | ||
345 | FEAT_PCKFREEENABLE, | ||
346 | FEAT_FUNCGATED, | ||
347 | FEAT_ROWREPEATENABLE, | ||
348 | FEAT_RESIZECONF, | ||
349 | }; | ||
350 | |||
351 | static const enum dss_feat_id omap3430_dss_feat_list[] = { | ||
352 | FEAT_LCDENABLEPOL, | ||
353 | FEAT_LCDENABLESIGNAL, | ||
354 | FEAT_PCKFREEENABLE, | ||
355 | FEAT_FUNCGATED, | ||
356 | FEAT_LINEBUFFERSPLIT, | ||
357 | FEAT_ROWREPEATENABLE, | ||
358 | FEAT_RESIZECONF, | ||
359 | FEAT_DSI_PLL_FREQSEL, | ||
360 | FEAT_DSI_REVERSE_TXCLKESC, | ||
361 | FEAT_VENC_REQUIRES_TV_DAC_CLK, | ||
362 | FEAT_CPR, | ||
363 | FEAT_PRELOAD, | ||
364 | FEAT_FIR_COEF_V, | ||
365 | FEAT_ALPHA_FIXED_ZORDER, | ||
366 | FEAT_FIFO_MERGE, | ||
367 | FEAT_OMAP3_DSI_FIFO_BUG, | ||
368 | }; | ||
369 | |||
370 | static const enum dss_feat_id omap3630_dss_feat_list[] = { | ||
371 | FEAT_LCDENABLEPOL, | ||
372 | FEAT_LCDENABLESIGNAL, | ||
373 | FEAT_PCKFREEENABLE, | ||
374 | FEAT_FUNCGATED, | ||
375 | FEAT_LINEBUFFERSPLIT, | ||
376 | FEAT_ROWREPEATENABLE, | ||
377 | FEAT_RESIZECONF, | ||
378 | FEAT_DSI_PLL_PWR_BUG, | ||
379 | FEAT_DSI_PLL_FREQSEL, | ||
380 | FEAT_CPR, | ||
381 | FEAT_PRELOAD, | ||
382 | FEAT_FIR_COEF_V, | ||
383 | FEAT_ALPHA_FIXED_ZORDER, | ||
384 | FEAT_FIFO_MERGE, | ||
385 | FEAT_OMAP3_DSI_FIFO_BUG, | ||
386 | }; | ||
387 | |||
388 | static const enum dss_feat_id omap4430_es1_0_dss_feat_list[] = { | ||
389 | FEAT_MGR_LCD2, | ||
390 | FEAT_CORE_CLK_DIV, | ||
391 | FEAT_LCD_CLK_SRC, | ||
392 | FEAT_DSI_DCS_CMD_CONFIG_VC, | ||
393 | FEAT_DSI_VC_OCP_WIDTH, | ||
394 | FEAT_DSI_GNQ, | ||
395 | FEAT_HANDLE_UV_SEPARATE, | ||
396 | FEAT_ATTR2, | ||
397 | FEAT_CPR, | ||
398 | FEAT_PRELOAD, | ||
399 | FEAT_FIR_COEF_V, | ||
400 | FEAT_ALPHA_FREE_ZORDER, | ||
401 | FEAT_FIFO_MERGE, | ||
402 | }; | ||
403 | |||
404 | static const enum dss_feat_id omap4430_es2_0_1_2_dss_feat_list[] = { | ||
405 | FEAT_MGR_LCD2, | ||
406 | FEAT_CORE_CLK_DIV, | ||
407 | FEAT_LCD_CLK_SRC, | ||
408 | FEAT_DSI_DCS_CMD_CONFIG_VC, | ||
409 | FEAT_DSI_VC_OCP_WIDTH, | ||
410 | FEAT_DSI_GNQ, | ||
411 | FEAT_HDMI_CTS_SWMODE, | ||
412 | FEAT_HANDLE_UV_SEPARATE, | ||
413 | FEAT_ATTR2, | ||
414 | FEAT_CPR, | ||
415 | FEAT_PRELOAD, | ||
416 | FEAT_FIR_COEF_V, | ||
417 | FEAT_ALPHA_FREE_ZORDER, | ||
418 | FEAT_FIFO_MERGE, | ||
419 | }; | ||
420 | |||
421 | static const enum dss_feat_id omap4_dss_feat_list[] = { | ||
422 | FEAT_MGR_LCD2, | ||
423 | FEAT_CORE_CLK_DIV, | ||
424 | FEAT_LCD_CLK_SRC, | ||
425 | FEAT_DSI_DCS_CMD_CONFIG_VC, | ||
426 | FEAT_DSI_VC_OCP_WIDTH, | ||
427 | FEAT_DSI_GNQ, | ||
428 | FEAT_HDMI_CTS_SWMODE, | ||
429 | FEAT_HDMI_AUDIO_USE_MCLK, | ||
430 | FEAT_HANDLE_UV_SEPARATE, | ||
431 | FEAT_ATTR2, | ||
432 | FEAT_CPR, | ||
433 | FEAT_PRELOAD, | ||
434 | FEAT_FIR_COEF_V, | ||
435 | FEAT_ALPHA_FREE_ZORDER, | ||
436 | FEAT_FIFO_MERGE, | ||
437 | }; | ||
438 | |||
340 | /* OMAP2 DSS Features */ | 439 | /* OMAP2 DSS Features */ |
341 | static const struct omap_dss_features omap2_dss_features = { | 440 | static const struct omap_dss_features omap2_dss_features = { |
342 | .reg_fields = omap2_dss_reg_fields, | 441 | .reg_fields = omap2_dss_reg_fields, |
343 | .num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields), | 442 | .num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields), |
344 | 443 | ||
345 | .has_feature = | 444 | .features = omap2_dss_feat_list, |
346 | FEAT_LCDENABLEPOL | FEAT_LCDENABLESIGNAL | | 445 | .num_features = ARRAY_SIZE(omap2_dss_feat_list), |
347 | FEAT_PCKFREEENABLE | FEAT_FUNCGATED | | ||
348 | FEAT_ROWREPEATENABLE | FEAT_RESIZECONF, | ||
349 | 446 | ||
350 | .num_mgrs = 2, | 447 | .num_mgrs = 2, |
351 | .num_ovls = 3, | 448 | .num_ovls = 3, |
@@ -363,14 +460,8 @@ static const struct omap_dss_features omap3430_dss_features = { | |||
363 | .reg_fields = omap3_dss_reg_fields, | 460 | .reg_fields = omap3_dss_reg_fields, |
364 | .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), | 461 | .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), |
365 | 462 | ||
366 | .has_feature = | 463 | .features = omap3430_dss_feat_list, |
367 | FEAT_LCDENABLEPOL | | 464 | .num_features = ARRAY_SIZE(omap3430_dss_feat_list), |
368 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | | ||
369 | FEAT_FUNCGATED | FEAT_ROWREPEATENABLE | | ||
370 | FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF | | ||
371 | FEAT_DSI_PLL_FREQSEL | FEAT_DSI_REVERSE_TXCLKESC | | ||
372 | FEAT_VENC_REQUIRES_TV_DAC_CLK | FEAT_CPR | FEAT_PRELOAD | | ||
373 | FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER, | ||
374 | 465 | ||
375 | .num_mgrs = 2, | 466 | .num_mgrs = 2, |
376 | .num_ovls = 3, | 467 | .num_ovls = 3, |
@@ -387,14 +478,8 @@ static const struct omap_dss_features omap3630_dss_features = { | |||
387 | .reg_fields = omap3_dss_reg_fields, | 478 | .reg_fields = omap3_dss_reg_fields, |
388 | .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), | 479 | .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), |
389 | 480 | ||
390 | .has_feature = | 481 | .features = omap3630_dss_feat_list, |
391 | FEAT_LCDENABLEPOL | | 482 | .num_features = ARRAY_SIZE(omap3630_dss_feat_list), |
392 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | | ||
393 | FEAT_FUNCGATED | | ||
394 | FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT | | ||
395 | FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG | | ||
396 | FEAT_DSI_PLL_FREQSEL | FEAT_CPR | FEAT_PRELOAD | | ||
397 | FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER, | ||
398 | 483 | ||
399 | .num_mgrs = 2, | 484 | .num_mgrs = 2, |
400 | .num_ovls = 3, | 485 | .num_ovls = 3, |
@@ -413,13 +498,27 @@ static const struct omap_dss_features omap4430_es1_0_dss_features = { | |||
413 | .reg_fields = omap4_dss_reg_fields, | 498 | .reg_fields = omap4_dss_reg_fields, |
414 | .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), | 499 | .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), |
415 | 500 | ||
416 | .has_feature = | 501 | .features = omap4430_es1_0_dss_feat_list, |
417 | FEAT_MGR_LCD2 | | 502 | .num_features = ARRAY_SIZE(omap4430_es1_0_dss_feat_list), |
418 | FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC | | 503 | |
419 | FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH | | 504 | .num_mgrs = 3, |
420 | FEAT_DSI_GNQ | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 | | 505 | .num_ovls = 4, |
421 | FEAT_CPR | FEAT_PRELOAD | FEAT_FIR_COEF_V | | 506 | .supported_displays = omap4_dss_supported_displays, |
422 | FEAT_ALPHA_FREE_ZORDER, | 507 | .supported_color_modes = omap4_dss_supported_color_modes, |
508 | .overlay_caps = omap4_dss_overlay_caps, | ||
509 | .clksrc_names = omap4_dss_clk_source_names, | ||
510 | .dss_params = omap4_dss_param_range, | ||
511 | .buffer_size_unit = 16, | ||
512 | .burst_size_unit = 16, | ||
513 | }; | ||
514 | |||
515 | /* For OMAP4430 ES 2.0, 2.1 and 2.2 revisions */ | ||
516 | static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = { | ||
517 | .reg_fields = omap4_dss_reg_fields, | ||
518 | .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), | ||
519 | |||
520 | .features = omap4430_es2_0_1_2_dss_feat_list, | ||
521 | .num_features = ARRAY_SIZE(omap4430_es2_0_1_2_dss_feat_list), | ||
423 | 522 | ||
424 | .num_mgrs = 3, | 523 | .num_mgrs = 3, |
425 | .num_ovls = 4, | 524 | .num_ovls = 4, |
@@ -437,13 +536,8 @@ static const struct omap_dss_features omap4_dss_features = { | |||
437 | .reg_fields = omap4_dss_reg_fields, | 536 | .reg_fields = omap4_dss_reg_fields, |
438 | .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), | 537 | .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), |
439 | 538 | ||
440 | .has_feature = | 539 | .features = omap4_dss_feat_list, |
441 | FEAT_MGR_LCD2 | | 540 | .num_features = ARRAY_SIZE(omap4_dss_feat_list), |
442 | FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC | | ||
443 | FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH | | ||
444 | FEAT_DSI_GNQ | FEAT_HDMI_CTS_SWMODE | | ||
445 | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 | FEAT_CPR | | ||
446 | FEAT_PRELOAD | FEAT_FIR_COEF_V | FEAT_ALPHA_FREE_ZORDER, | ||
447 | 541 | ||
448 | .num_mgrs = 3, | 542 | .num_mgrs = 3, |
449 | .num_ovls = 4, | 543 | .num_ovls = 4, |
@@ -547,7 +641,16 @@ u32 dss_feat_get_burst_size_unit(void) | |||
547 | /* DSS has_feature check */ | 641 | /* DSS has_feature check */ |
548 | bool dss_has_feature(enum dss_feat_id id) | 642 | bool dss_has_feature(enum dss_feat_id id) |
549 | { | 643 | { |
550 | return omap_current_dss_features->has_feature & id; | 644 | int i; |
645 | const enum dss_feat_id *features = omap_current_dss_features->features; | ||
646 | const int num_features = omap_current_dss_features->num_features; | ||
647 | |||
648 | for (i = 0; i < num_features; i++) { | ||
649 | if (features[i] == id) | ||
650 | return true; | ||
651 | } | ||
652 | |||
653 | return false; | ||
551 | } | 654 | } |
552 | 655 | ||
553 | void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end) | 656 | void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end) |
@@ -569,6 +672,10 @@ void dss_features_init(void) | |||
569 | omap_current_dss_features = &omap3430_dss_features; | 672 | omap_current_dss_features = &omap3430_dss_features; |
570 | else if (omap_rev() == OMAP4430_REV_ES1_0) | 673 | else if (omap_rev() == OMAP4430_REV_ES1_0) |
571 | omap_current_dss_features = &omap4430_es1_0_dss_features; | 674 | omap_current_dss_features = &omap4430_es1_0_dss_features; |
675 | else if (omap_rev() == OMAP4430_REV_ES2_0 || | ||
676 | omap_rev() == OMAP4430_REV_ES2_1 || | ||
677 | omap_rev() == OMAP4430_REV_ES2_2) | ||
678 | omap_current_dss_features = &omap4430_es2_0_1_2_dss_features; | ||
572 | else if (cpu_is_omap44xx()) | 679 | else if (cpu_is_omap44xx()) |
573 | omap_current_dss_features = &omap4_dss_features; | 680 | omap_current_dss_features = &omap4_dss_features; |
574 | else | 681 | else |