linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/rockchip: vop: Quiet always-warning AFBC log
@ 2022-10-31 17:16 Brian Norris
  2023-02-05 14:56 ` Heiko Stuebner
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Norris @ 2022-10-31 17:16 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Sandy Huang, linux-arm-kernel, Andrzej Pietrasiewicz,
	linux-rockchip, linux-kernel, dri-devel, Brian Norris

The downstream code from which this was derived didn't ever run through
this 'switch' block with non-AFBC formats, but the upstream code does --
we use this function to probe whether a given format is supported.

Demote the warning to eliminate this sort of warning seen on every
boot:

  [drm] unsupported AFBC format[3231564e]

And make it warn more than once, because if we *actually* care to see
what formats we're probing/rejecting and for what reasons, we probably
care about more than just the first message.

Drop the comment, because one of the two *is* commonly reachable.

And lastly, drop the unreachable return; we'd do better to let the
compiler complain if we start hitting this unexpectedly.

Signed-off-by: Brian Norris <briannorris@chromium.org>
---

 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index fa1f4ee6d195..aab77eb6caa3 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -316,13 +316,10 @@ static int vop_convert_afbc_format(uint32_t format)
 	case DRM_FORMAT_RGB565:
 	case DRM_FORMAT_BGR565:
 		return AFBC_FMT_RGB565;
-	/* either of the below should not be reachable */
 	default:
-		DRM_WARN_ONCE("unsupported AFBC format[%08x]\n", format);
+		DRM_DEBUG_KMS("unsupported AFBC format[%08x]\n", format);
 		return -EINVAL;
 	}
-
-	return -EINVAL;
 }
 
 static uint16_t scl_vop_cal_scale(enum scale_mode mode, uint32_t src,
-- 
2.38.1.273.g43a17bfeac-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/rockchip: vop: Quiet always-warning AFBC log
  2022-10-31 17:16 [PATCH] drm/rockchip: vop: Quiet always-warning AFBC log Brian Norris
@ 2023-02-05 14:56 ` Heiko Stuebner
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stuebner @ 2023-02-05 14:56 UTC (permalink / raw)
  To: Brian Norris
  Cc: Heiko Stuebner, dri-devel, linux-rockchip, linux-kernel,
	Andrzej Pietrasiewicz, Sandy Huang, linux-arm-kernel

On Mon, 31 Oct 2022 10:16:01 -0700, Brian Norris wrote:
> The downstream code from which this was derived didn't ever run through
> this 'switch' block with non-AFBC formats, but the upstream code does --
> we use this function to probe whether a given format is supported.
> 
> Demote the warning to eliminate this sort of warning seen on every
> boot:
> 
> [...]

Applied, thanks!

[1/1] drm/rockchip: vop: Quiet always-warning AFBC log
      commit: 582212ee1611f77e0360d249f11c0f703ed723dc

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-05 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 17:16 [PATCH] drm/rockchip: vop: Quiet always-warning AFBC log Brian Norris
2023-02-05 14:56 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).