video: tegra: nvsd: set zero aggressiveness in high priority
Min-wuk Lee [Fri, 28 Jun 2013 09:46:34 +0000 (18:46 +0900)]
When smart dimmer zero aggressiveness of high priority is
requested, that should be superior to non zero one of
lower priority.

Bug 1297022

Change-Id: I1d10b6915699a0be90e1348da318f31223ccffa8
Signed-off-by: Min-wuk Lee <mlee@nvidia.com>
Reviewed-on: http://git-master/r/243362
(cherry picked from commit 59673cab9ca4bcd00bb6126cb843d122541cfe85)
Reviewed-on: http://git-master/r/289697
Reviewed-by: Gabby Lee <galee@nvidia.com>
Tested-by: Gabby Lee <galee@nvidia.com>

arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc_reg.h
drivers/video/tegra/dc/nvsd.c

index c05bb46..40932c3 100644 (file)
@@ -30,7 +30,7 @@
 #define TEGRA_MAX_DC           2
 #define DC_N_WINDOWS           3
 #define DEFAULT_FPGA_FREQ_KHZ  160000
-
+#define NUM_AGG_PRI_LVLS       4
 
 /* DSI pixel data format */
 enum {
@@ -389,7 +389,8 @@ struct tegra_dc_sd_rgb {
 
 struct tegra_dc_sd_agg_priorities {
        u8 pri_lvl;
-       u8 agg[4];
+       u8 agg[NUM_AGG_PRI_LVLS];
+       bool dirty[NUM_AGG_PRI_LVLS];
 };
 
 struct tegra_dc_sd_window {
index 7ad07e4..bb0d05d 100644 (file)
 #define DC_DISP_SD_SMOOTH_K                    0x4e3
 #define  SD_SMOOTH_K_INCR(x)           (((x) & 0x3fff) << 0)
 
-#define  NUM_AGG_PRI_LVLS              4
 #define  SD_AGG_PRI_LVL(x)             ((x) >> 3)
 #define  SD_GET_AGG(x)                 ((x) & 0x7)
 
index 75cc856..b4b5769 100644 (file)
@@ -341,11 +341,13 @@ static bool nvsd_update_agg(struct tegra_dc_sd_settings *settings, int agg_val)
        else if (agg_lvl == 0 && pri_lvl == 0)
                return false;
 
-       if (pri_lvl >= 0 && pri_lvl < 4)
+       if (pri_lvl >= 0 && pri_lvl < NUM_AGG_PRI_LVLS) {
                sd_agg_priorities->agg[pri_lvl] = agg_lvl;
+               sd_agg_priorities->dirty[pri_lvl] = true;
+       }
 
        for (i = NUM_AGG_PRI_LVLS - 1; i >= 0; i--) {
-               if (sd_agg_priorities->agg[i])
+               if (sd_agg_priorities->dirty[i])
                        break;
        }