dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/atomic: Remove WARN_ON for invalid plane configuration.
@ 2018-01-30 10:27 Maarten Lankhorst
  2018-01-30 15:21 ` Harry Wentland
  0 siblings, 1 reply; 3+ messages in thread
From: Maarten Lankhorst @ 2018-01-30 10:27 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter

Userspace can set a FB_ID on a plane without setting CRTC_ID, which
will fail with -EINVAL, but the kernel shouldn't warn about that.

Same for !FB_ID and CRTC_ID being set.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_atomic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 51a848c553b9..7d9ad20040a1 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -863,10 +863,10 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
 	int ret;
 
 	/* either *both* CRTC and FB must be set, or neither */
-	if (WARN_ON(state->crtc && !state->fb)) {
+	if (state->crtc && !state->fb) {
 		DRM_DEBUG_ATOMIC("CRTC set but no FB\n");
 		return -EINVAL;
-	} else if (WARN_ON(state->fb && !state->crtc)) {
+	} else if (state->fb && !state->crtc) {
 		DRM_DEBUG_ATOMIC("FB set but no CRTC\n");
 		return -EINVAL;
 	}
-- 
2.15.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/atomic: Remove WARN_ON for invalid plane configuration.
  2018-01-30 10:27 [PATCH] drm/atomic: Remove WARN_ON for invalid plane configuration Maarten Lankhorst
@ 2018-01-30 15:21 ` Harry Wentland
  2018-01-30 15:45   ` Maarten Lankhorst
  0 siblings, 1 reply; 3+ messages in thread
From: Harry Wentland @ 2018-01-30 15:21 UTC (permalink / raw)
  To: Maarten Lankhorst, dri-devel; +Cc: Daniel Vetter

On 2018-01-30 05:27 AM, Maarten Lankhorst wrote:
> Userspace can set a FB_ID on a plane without setting CRTC_ID, which
> will fail with -EINVAL, but the kernel shouldn't warn about that.
> 
> Same for !FB_ID and CRTC_ID being set.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/drm_atomic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 51a848c553b9..7d9ad20040a1 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -863,10 +863,10 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
>  	int ret;
>  
>  	/* either *both* CRTC and FB must be set, or neither */
> -	if (WARN_ON(state->crtc && !state->fb)) {
> +	if (state->crtc && !state->fb) {
>  		DRM_DEBUG_ATOMIC("CRTC set but no FB\n");
>  		return -EINVAL;
> -	} else if (WARN_ON(state->fb && !state->crtc)) {
> +	} else if (state->fb && !state->crtc) {
>  		DRM_DEBUG_ATOMIC("FB set but no CRTC\n");
>  		return -EINVAL;
>  	}
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/atomic: Remove WARN_ON for invalid plane configuration.
  2018-01-30 15:21 ` Harry Wentland
@ 2018-01-30 15:45   ` Maarten Lankhorst
  0 siblings, 0 replies; 3+ messages in thread
From: Maarten Lankhorst @ 2018-01-30 15:45 UTC (permalink / raw)
  To: Harry Wentland, dri-devel; +Cc: Daniel Vetter

Op 30-01-18 om 16:21 schreef Harry Wentland:
> On 2018-01-30 05:27 AM, Maarten Lankhorst wrote:
>> Userspace can set a FB_ID on a plane without setting CRTC_ID, which
>> will fail with -EINVAL, but the kernel shouldn't warn about that.
>>
>> Same for !FB_ID and CRTC_ID being set.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
Thanks, pushed!

~Maarten
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> ---
>>  drivers/gpu/drm/drm_atomic.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
>> index 51a848c553b9..7d9ad20040a1 100644
>> --- a/drivers/gpu/drm/drm_atomic.c
>> +++ b/drivers/gpu/drm/drm_atomic.c
>> @@ -863,10 +863,10 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
>>  	int ret;
>>  
>>  	/* either *both* CRTC and FB must be set, or neither */
>> -	if (WARN_ON(state->crtc && !state->fb)) {
>> +	if (state->crtc && !state->fb) {
>>  		DRM_DEBUG_ATOMIC("CRTC set but no FB\n");
>>  		return -EINVAL;
>> -	} else if (WARN_ON(state->fb && !state->crtc)) {
>> +	} else if (state->fb && !state->crtc) {
>>  		DRM_DEBUG_ATOMIC("FB set but no CRTC\n");
>>  		return -EINVAL;
>>  	}
>>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-01-30 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-30 10:27 [PATCH] drm/atomic: Remove WARN_ON for invalid plane configuration Maarten Lankhorst
2018-01-30 15:21 ` Harry Wentland
2018-01-30 15:45   ` Maarten Lankhorst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox