From: Jocelyn Falempe Date: Wed, 4 May 2022 13:40:26 +0000 (+0200) Subject: drm/mgag200: Warn once if trying to set start address on broken hardware. X-Git-Tag: baikal/mips/sdk6.1~5152^2~22^2~131 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=298ff33715af90978fe97ea2dde4ccf6fdd8d692;p=kernel.git drm/mgag200: Warn once if trying to set start address on broken hardware. Some MGA200 hardware is 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 Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220504134026.283417-4-jfalempe@redhat.com --- diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 294a53b95c612..dec744d0bee26 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.