]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
drm: Clarify vblank ts/scanoutpos sampling #defines
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 10 Sep 2014 15:36:11 +0000 (17:36 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 11 Sep 2014 11:40:33 +0000 (13:40 +0200)
I've read INVBL as "invalid backlight" and got mightly confused.
The #defines are already fairly long and we can afford to extend
them a bit more without resulting in ugly code all over.

I'm not sure how useful the complicated bitmask return value of these
functions really are since no one checks them. But for now let's keep
things as is.

Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_irq.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_pm.c
include/drm/drmP.h

index 15f748c7fa7ebfd2bcaf4688b2a6a7a7f008f8e9..79836594030c01cdd4ad9d9f332f15cd83fc7d84 100644 (file)
@@ -721,7 +721,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
         * within vblank area, counting down the number of lines until
         * start of scanout.
         */
-       invbl = vbl_status & DRM_SCANOUTPOS_INVBL;
+       invbl = vbl_status & DRM_SCANOUTPOS_IN_VBLANK;
 
        /* Convert scanout position into elapsed time at raw_time query
         * since start of scanout at first display scanline. delta_ns
@@ -751,7 +751,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
 
        vbl_status = DRM_VBLANKTIME_SCANOUTPOS_METHOD;
        if (invbl)
-               vbl_status |= DRM_VBLANKTIME_INVBL;
+               vbl_status |= DRM_VBLANKTIME_IN_VBLANK;
 
        return vbl_status;
 }
index 845f0f6c1eeb57c62c377c5e86826c180d2ab1ea..20dd9e233fc6be13fb41765f4166632f58fa5737 100644 (file)
@@ -1020,7 +1020,7 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
 
        /* In vblank? */
        if (in_vbl)
-               ret |= DRM_SCANOUTPOS_INVBL;
+               ret |= DRM_SCANOUTPOS_IN_VBLANK;
 
        return ret;
 }
index 47ad74255bf1e6501bc9f7a266d91d329033921e..37a6ab8a97f85976ebb650961c66f0a31b69be2f 100644 (file)
@@ -111,7 +111,7 @@ nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos,
        if (etime) *etime = ns_to_ktime(args.time[1]);
 
        if (*vpos < 0)
-               ret |= DRM_SCANOUTPOS_INVBL;
+               ret |= DRM_SCANOUTPOS_IN_VBLANK;
        return ret;
 }
 
index 3fdf87318069f1a6b26e1e37f9fd504641b19132..fd8cd0c3600f5bb0b2cc38049dbae991bbffdf55 100644 (file)
@@ -1917,7 +1917,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int fl
 
        /* In vblank? */
        if (in_vbl)
-               ret |= DRM_SCANOUTPOS_INVBL;
+               ret |= DRM_SCANOUTPOS_IN_VBLANK;
 
        /* Is vpos outside nominal vblank area, but less than
         * 1/100 of a frame height away from start of vblank?
index 23314be49480684c583aefffedec4587af48e524..7fd665a2290854e1b3270b03441e68f4f61c916c 100644 (file)
@@ -1560,7 +1560,7 @@ static bool radeon_pm_in_vbl(struct radeon_device *rdev)
                if (rdev->pm.active_crtcs & (1 << crtc)) {
                        vbl_status = radeon_get_crtc_scanoutpos(rdev->ddev, crtc, 0, &vpos, &hpos, NULL, NULL);
                        if ((vbl_status & DRM_SCANOUTPOS_VALID) &&
-                           !(vbl_status & DRM_SCANOUTPOS_INVBL))
+                           !(vbl_status & DRM_SCANOUTPOS_IN_VBLANK))
                                in_vbl = false;
                }
        }
index a97307525c2dc029b39e10f80be04912b2deb897..7b87fccff1830fe4beae3f18643899e23b3ea24d 100644 (file)
@@ -674,11 +674,11 @@ struct drm_master {
 /* Flags and return codes for get_vblank_timestamp() driver function. */
 #define DRM_CALLED_FROM_VBLIRQ 1
 #define DRM_VBLANKTIME_SCANOUTPOS_METHOD (1 << 0)
-#define DRM_VBLANKTIME_INVBL             (1 << 1)
+#define DRM_VBLANKTIME_IN_VBLANK         (1 << 1)
 
 /* get_scanout_position() return flags */
 #define DRM_SCANOUTPOS_VALID        (1 << 0)
-#define DRM_SCANOUTPOS_INVBL        (1 << 1)
+#define DRM_SCANOUTPOS_IN_VBLANK    (1 << 1)
 #define DRM_SCANOUTPOS_ACCURATE     (1 << 2)
 
 struct drm_bus {