video: tegra: dc: add list of preferred formats
Jon Mayo [Tue, 15 May 2012 18:23:13 +0000 (11:23 -0700)]
Move WinB's format limitations to a list of preferred formats.

Bug 985197

Change-Id: Ife37c79441b2737592ace51e94ab0c80af4af917
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/102629
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Chao Xu <cxu@nvidia.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Michael Frydrych <mfrydrych@nvidia.com>
Reviewed-by: Kevin Huang (Eng-SW) <kevinh@nvidia.com>

drivers/video/tegra/dc/dc_config.c
drivers/video/tegra/dc/dc_config.h

index 3eebab6..8282405 100644 (file)
@@ -29,6 +29,7 @@ static struct tegra_dc_feature_entry t20_feature_entries_a[] = {
        { 0, TEGRA_DC_FEATURE_INVERT_TYPE, {1, 1, 0,} },
 
        { 1, TEGRA_DC_FEATURE_FORMATS, {TEGRA_WIN_FMT_WIN_B,} },
+       { 1, TEGRA_DC_FEATURE_PREFERRED_FORMATS, {TEGRA_WIN_PREF_FMT_WIN_B,} },
        { 1, TEGRA_DC_FEATURE_BLEND_TYPE, {1,} },
        { 1, TEGRA_DC_FEATURE_MAXIMUM_SIZE, {4095, 16, 4095, 16,} },
        { 1, TEGRA_DC_FEATURE_MAXIMUM_SCALE, {2, 2, 2, 2,} },
@@ -55,6 +56,7 @@ static struct tegra_dc_feature_entry t20_feature_entries_b[] = {
        { 0, TEGRA_DC_FEATURE_INVERT_TYPE, {1, 1, 0,} },
 
        { 1, TEGRA_DC_FEATURE_FORMATS, {TEGRA_WIN_FMT_WIN_B,} },
+       { 1, TEGRA_DC_FEATURE_PREFERRED_FORMATS, {TEGRA_WIN_PREF_FMT_WIN_B,} },
        { 1, TEGRA_DC_FEATURE_BLEND_TYPE, {1,} },
        { 1, TEGRA_DC_FEATURE_MAXIMUM_SIZE, {4095, 16, 4095, 16,} },
        { 1, TEGRA_DC_FEATURE_MAXIMUM_SCALE, {2, 2, 2, 2,} },
@@ -89,6 +91,7 @@ static struct tegra_dc_feature_entry t30_feature_entries_a[] = {
        { 0, TEGRA_DC_FEATURE_INVERT_TYPE, {1, 1, 0,} },
 
        { 1, TEGRA_DC_FEATURE_FORMATS, {TEGRA_WIN_FMT_WIN_B,} },
+       { 1, TEGRA_DC_FEATURE_PREFERRED_FORMATS, {TEGRA_WIN_PREF_FMT_WIN_B,} },
        { 1, TEGRA_DC_FEATURE_BLEND_TYPE, {1,} },
        { 1, TEGRA_DC_FEATURE_MAXIMUM_SIZE, {4095, 16, 4095, 16,} },
        { 1, TEGRA_DC_FEATURE_MAXIMUM_SCALE, {2, 2, 2, 2,} },
@@ -115,6 +118,7 @@ static struct tegra_dc_feature_entry t30_feature_entries_b[] = {
        { 0, TEGRA_DC_FEATURE_INVERT_TYPE, {1, 1, 0,} },
 
        { 1, TEGRA_DC_FEATURE_FORMATS, {TEGRA_WIN_FMT_WIN_B,} },
+       { 1, TEGRA_DC_FEATURE_PREFERRED_FORMATS, {TEGRA_WIN_PREF_FMT_WIN_B,} },
        { 1, TEGRA_DC_FEATURE_BLEND_TYPE, {1,} },
        { 1, TEGRA_DC_FEATURE_MAXIMUM_SIZE, {4095, 16, 4095, 16,} },
        { 1, TEGRA_DC_FEATURE_MAXIMUM_SCALE, {2, 2, 2, 2,} },
index a0670d1..55df5ef 100644 (file)
                                (1 << TEGRA_WIN_FMT_B6x2G6x2R6x2A8) | \
                                (1 << TEGRA_WIN_FMT_R6x2G6x2B6x2A8))
 
-#define TEGRA_WIN_FMT_WIN_B    (TEGRA_WIN_FMT_BASE & \
-                               ~(1 << TEGRA_WIN_FMT_B8G8R8A8) & \
-                               ~(1 << TEGRA_WIN_FMT_R8G8B8A8))
+#define TEGRA_WIN_FMT_WIN_B    TEGRA_WIN_FMT_BASE
 
 #define TEGRA_WIN_FMT_WIN_C    TEGRA_WIN_FMT_BASE
 
+/* preferred formats do not include 32-bpp formats */
+#define TEGRA_WIN_PREF_FMT_WIN_B       (TEGRA_WIN_FMT_BASE & \
+                               ~(1 << TEGRA_WIN_FMT_B8G8R8A8) & \
+                               ~(1 << TEGRA_WIN_FMT_R8G8B8A8))
+
 #define UNDEFINED      -1
 #define MAX_WIDTH      0
 #define MIN_WIDTH      1
@@ -93,6 +96,7 @@ enum tegra_dc_feature_option {
        TEGRA_DC_FEATURE_FILTER_TYPE,
        TEGRA_DC_FEATURE_LAYOUT_TYPE,
        TEGRA_DC_FEATURE_INVERT_TYPE,
+       TEGRA_DC_FEATURE_PREFERRED_FORMATS,
 };
 
 struct tegra_dc_feature_entry {