[2/2] drm/radeon: Fix max_vblank_count value for current display engines
diff mbox

Message ID 1432630419-23490-2-git-send-email-michel@daenzer.net
State New
Headers show

Commit Message

Michel Dänzer May 26, 2015, 8:53 a.m. UTC
From: Michel Dänzer <michel.daenzer@amd.com>

The value was much too low, which could cause the userspace visible
vblank counter to move backwards when the hardware counter wrapped
around.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 drivers/gpu/drm/radeon/radeon_irq_kms.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Alex Deucher May 28, 2015, 4:17 a.m. UTC | #1
On Tue, May 26, 2015 at 4:53 AM, Michel Dänzer <michel@daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> The value was much too low, which could cause the userspace visible
> vblank counter to move backwards when the hardware counter wrapped
> around.
>
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

Applied to my -next tree.

Thanks!

> ---
>  drivers/gpu/drm/radeon/radeon_irq_kms.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
> index 7162c93..d5c392b 100644
> --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
> @@ -143,7 +143,13 @@ void radeon_driver_irq_preinstall_kms(struct drm_device *dev)
>   */
>  int radeon_driver_irq_postinstall_kms(struct drm_device *dev)
>  {
> -       dev->max_vblank_count = 0x001fffff;
> +       struct radeon_device *rdev = dev->dev_private;
> +
> +       if (ASIC_IS_AVIVO(rdev))
> +               dev->max_vblank_count = 0x00ffffff;
> +       else
> +               dev->max_vblank_count = 0x001fffff;
> +
>         return 0;
>  }
>
> --
> 2.1.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

Patch
diff mbox

diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 7162c93..d5c392b 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -143,7 +143,13 @@  void radeon_driver_irq_preinstall_kms(struct drm_device *dev)
  */
 int radeon_driver_irq_postinstall_kms(struct drm_device *dev)
 {
-	dev->max_vblank_count = 0x001fffff;
+	struct radeon_device *rdev = dev->dev_private;
+
+	if (ASIC_IS_AVIVO(rdev))
+		dev->max_vblank_count = 0x00ffffff;
+	else
+		dev->max_vblank_count = 0x001fffff;
+
 	return 0;
 }