video: tegra: dc: fix blend update and query
Michael Frydrych [Thu, 2 May 2013 12:18:41 +0000 (15:18 +0300)]
Blending update needs to be requested for all windows
so that both the parallel and sequential blending state
are updated when the dc is re-enabled.

When querying blending features, query each window
only once.

Change-Id: I4f0abb56a2e704d540828d74e8ac170888f912a7
Signed-off-by: Michael Frydrych <mfrydrych@nvidia.com>
Reviewed-on: http://git-master/r/226183
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jon Mayo <jmayo@nvidia.com>

drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/window.c

index a0a76bb..03aacf9 100644 (file)
@@ -2086,6 +2086,7 @@ static int tegra_dc_init(struct tegra_dc *dc)
 static bool _tegra_dc_controller_enable(struct tegra_dc *dc)
 {
        int failed_init = 0;
+       int i;
 
        tegra_dc_unpowergate_locked(dc);
 
@@ -2119,7 +2120,8 @@ static bool _tegra_dc_controller_enable(struct tegra_dc *dc)
                dc->out_ops->enable(dc);
 
        /* force a full blending update */
-       dc->blend.z[0] = -1;
+       for (i = 0; i < DC_N_WINDOWS; i++)
+               dc->blend.z[i] = -1;
 
        tegra_dc_ext_enable(dc->ext);
 
index 528392d..65d3f46 100644 (file)
@@ -184,11 +184,11 @@ static void tegra_dc_blend_parallel(struct tegra_dc *dc,
 static void tegra_dc_blend_sequential(struct tegra_dc *dc,
                                struct tegra_dc_blend *blend)
 {
-       int i;
+       int idx;
+       unsigned long mask = dc->valid_windows;
 
        tegra_dc_io_start(dc);
-       for (i = 0; i < dc->feature->num_entries; i++) {
-               u32 idx = dc->feature->entries[i].window_index;
+       for_each_set_bit(idx, &mask, DC_N_WINDOWS) {
                if (!tegra_dc_feature_is_gen2_blender(dc, idx))
                        continue;