]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
video: modedb: update vmode comparision
authorNaveen Kumar S <nkumars@nvidia.com>
Wed, 10 May 2017 11:20:42 +0000 (16:50 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 12 May 2017 13:05:15 +0000 (06:05 -0700)
To select full range quantization, userspace clears
LIMITED_RANGE flag in vmode. This shouldn't lead to
mode mismatch because the modes are still the same
even if LIMITED_RANGE flag doesn't match. Hence ignore
LIMITED_RANGE bit in vmode comparision while finding a
matching mode from modelist.

bug 200306471

Change-Id: I2b30e5232c5e0f2e2100adb674a6706a491d958a
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/1479088
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
drivers/video/fbdev/core/modedb.c

index 8612a2d29c29ec9c31dfeea68c235da425de27c0..dbd2015d182e4cba23e2e403286b295c8cbbd33a 100644 (file)
@@ -2070,7 +2070,14 @@ static bool fb_var_is_equal(const struct fb_var_screeninfo *var1,
            var1->vsync_len != var2->vsync_len)
                return false;
 
-       if (var1->vmode == var2->vmode)
+       /*
+        * Userspace might modify LIMITED_RANGE flag to select full range
+        * quantization. This shouldn't lead to mode mismatch as the modes
+        * are still the same even if LIMITED_RANGE flag doesn't match.
+        * Ignore LIMITED_RANGE bit during vmode comparision.
+        */
+       if ((var1->vmode & ~FB_VMODE_LIMITED_RANGE) ==
+                       (var2->vmode & ~FB_VMODE_LIMITED_RANGE))
                return true;
 
        /*