diff mbox series

[v2,3/3] mgag200: Warn once if trying to set start address on broken hardware.

Message ID 20220504134026.283417-4-jfalempe@redhat.com (mailing list archive)
State New, archived
Headers show
Series mgag200: Improve damage handling | expand

Commit Message

Jocelyn Falempe May 4, 2022, 1:40 p.m. UTC
Some MGA200 hardware are broken, and can't use a start address > 0

v2: Warn if startaddr is not 0, and hw doesn't support it.
  (instead of removing MGAG200_FLAG_HW_BUG_NO_STARTADD)

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Zimmermann May 4, 2022, 2:53 p.m. UTC | #1
Hi

Am 04.05.22 um 15:40 schrieb Jocelyn Falempe:
> Some MGA200 hardware are broken, and can't use a start address > 0

I'm not a native speaker, but 'is broken' (without comma) would sound 
better to me. The period at the end of the sentence is missing.

Best regards
Thomas

> 
> v2: Warn if startaddr is not 0, and hw doesn't support it.
>    (instead of removing MGAG200_FLAG_HW_BUG_NO_STARTADD)
> 
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
> ---
>   drivers/gpu/drm/mgag200/mgag200_mode.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
> index 2bc380a85996..d2cf26b3cee0 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_mode.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
> @@ -223,6 +223,9 @@ static void mgag200_set_startadd(struct mga_device *mdev,
>   
>   	startadd = offset / 8;
>   
> +	if (startadd > 0)
> +		drm_WARN_ON_ONCE(dev, mdev->flags & MGAG200_FLAG_HW_BUG_NO_STARTADD);
> +
>   	/*
>   	 * Can't store addresses any higher than that, but we also
>   	 * don't have more than 16 MiB of memory, so it should be fine.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 2bc380a85996..d2cf26b3cee0 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -223,6 +223,9 @@  static void mgag200_set_startadd(struct mga_device *mdev,
 
 	startadd = offset / 8;
 
+	if (startadd > 0)
+		drm_WARN_ON_ONCE(dev, mdev->flags & MGAG200_FLAG_HW_BUG_NO_STARTADD);
+
 	/*
 	 * Can't store addresses any higher than that, but we also
 	 * don't have more than 16 MiB of memory, so it should be fine.