Skip to content

Commit 43dae31

Browse files
fooishbarmmind
authored andcommitted
drm/rockchip: Don't spam logs in atomic check
Userspace should not be able to trigger DRM_ERROR messages to spam the logs; especially not through atomic commit parameters which are completely legitimate for userspace to attempt. Signed-off-by: Daniel Stone <daniels@collabora.com> Fixes: 7707f72 ("drm/rockchip: Add support for afbc") Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230808104405.522493-1-daniels@collabora.com
1 parent 1963546 commit 43dae31

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -833,20 +833,20 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
833833
* need align with 2 pixel.
834834
*/
835835
if (fb->format->is_yuv && ((new_plane_state->src.x1 >> 16) % 2)) {
836-
DRM_ERROR("Invalid Source: Yuv format not support odd xpos\n");
836+
DRM_DEBUG_KMS("Invalid Source: Yuv format not support odd xpos\n");
837837
return -EINVAL;
838838
}
839839

840840
if (fb->format->is_yuv && new_plane_state->rotation & DRM_MODE_REFLECT_Y) {
841-
DRM_ERROR("Invalid Source: Yuv format does not support this rotation\n");
841+
DRM_DEBUG_KMS("Invalid Source: Yuv format does not support this rotation\n");
842842
return -EINVAL;
843843
}
844844

845845
if (rockchip_afbc(fb->modifier)) {
846846
struct vop *vop = to_vop(crtc);
847847

848848
if (!vop->data->afbc) {
849-
DRM_ERROR("vop does not support AFBC\n");
849+
DRM_DEBUG_KMS("vop does not support AFBC\n");
850850
return -EINVAL;
851851
}
852852

@@ -855,15 +855,16 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
855855
return ret;
856856

857857
if (new_plane_state->src.x1 || new_plane_state->src.y1) {
858-
DRM_ERROR("AFBC does not support offset display, xpos=%d, ypos=%d, offset=%d\n",
859-
new_plane_state->src.x1,
860-
new_plane_state->src.y1, fb->offsets[0]);
858+
DRM_DEBUG_KMS("AFBC does not support offset display, " \
859+
"xpos=%d, ypos=%d, offset=%d\n",
860+
new_plane_state->src.x1, new_plane_state->src.y1,
861+
fb->offsets[0]);
861862
return -EINVAL;
862863
}
863864

864865
if (new_plane_state->rotation && new_plane_state->rotation != DRM_MODE_ROTATE_0) {
865-
DRM_ERROR("No rotation support in AFBC, rotation=%d\n",
866-
new_plane_state->rotation);
866+
DRM_DEBUG_KMS("No rotation support in AFBC, rotation=%d\n",
867+
new_plane_state->rotation);
867868
return -EINVAL;
868869
}
869870
}

0 commit comments

Comments
 (0)