linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: Add a debug message when getting a prop is missing
@ 2022-05-10 18:28 Mark Yacoub
  2022-05-12 14:22 ` Mark Yacoub
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Yacoub @ 2022-05-10 18:28 UTC (permalink / raw)
  Cc: seanpaul, markyacoub, markyacoub, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	dri-devel, linux-kernel

[Why]
If a connector property is attached but
drm_atomic_connector_get_property doesn't handle a case for it,
modeteset will crash with a segfault without.

[How]
Add a debug message indicating that a connector property is not handled
when user space is trying to read it.

TEST=modetest

Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index acb1ee93d206..36b0f664dd80 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -884,6 +884,12 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
 		return connector->funcs->atomic_get_property(connector,
 				state, property, val);
 	} else {
+		// LOG that the kernel is missing handling this property as a case here.
+		drm_dbg_atomic(
+			dev,
+			"[CONNECTOR:%d:%s] Get Property [PROP:%d:%s] is not handled\n",
+			connector->base.id, connector->name, property->base.id,
+			property->name);
 		return -EINVAL;
 	}
 
-- 
2.36.0.512.ge40c2bad7a-goog


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

* Re: [PATCH] drm: Add a debug message when getting a prop is missing
  2022-05-10 18:28 [PATCH] drm: Add a debug message when getting a prop is missing Mark Yacoub
@ 2022-05-12 14:22 ` Mark Yacoub
  2022-05-16 15:10 ` Mark Yacoub
  2022-05-17  7:51 ` Jani Nikula
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Yacoub @ 2022-05-12 14:22 UTC (permalink / raw)
  Cc: seanpaul, markyacoub, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, dri-devel,
	linux-kernel

friendly ping :)

On Tue, May 10, 2022 at 2:28 PM Mark Yacoub <markyacoub@chromium.org> wrote:
>
> [Why]
> If a connector property is attached but
> drm_atomic_connector_get_property doesn't handle a case for it,
> modeteset will crash with a segfault without.
>
> [How]
> Add a debug message indicating that a connector property is not handled
> when user space is trying to read it.
>
> TEST=modetest
>
> Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
> ---
>  drivers/gpu/drm/drm_atomic_uapi.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index acb1ee93d206..36b0f664dd80 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -884,6 +884,12 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
>                 return connector->funcs->atomic_get_property(connector,
>                                 state, property, val);
>         } else {
> +               // LOG that the kernel is missing handling this property as a case here.
> +               drm_dbg_atomic(
> +                       dev,
> +                       "[CONNECTOR:%d:%s] Get Property [PROP:%d:%s] is not handled\n",
> +                       connector->base.id, connector->name, property->base.id,
> +                       property->name);
>                 return -EINVAL;
>         }
>
> --
> 2.36.0.512.ge40c2bad7a-goog
>

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

* Re: [PATCH] drm: Add a debug message when getting a prop is missing
  2022-05-10 18:28 [PATCH] drm: Add a debug message when getting a prop is missing Mark Yacoub
  2022-05-12 14:22 ` Mark Yacoub
@ 2022-05-16 15:10 ` Mark Yacoub
  2022-05-17  7:51 ` Jani Nikula
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Yacoub @ 2022-05-16 15:10 UTC (permalink / raw)
  Cc: seanpaul, markyacoub, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, dri-devel,
	linux-kernel

friendly ping :))

On Tue, May 10, 2022 at 2:28 PM Mark Yacoub <markyacoub@chromium.org> wrote:
>
> [Why]
> If a connector property is attached but
> drm_atomic_connector_get_property doesn't handle a case for it,
> modeteset will crash with a segfault without.
>
> [How]
> Add a debug message indicating that a connector property is not handled
> when user space is trying to read it.
>
> TEST=modetest
>
> Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
> ---
>  drivers/gpu/drm/drm_atomic_uapi.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index acb1ee93d206..36b0f664dd80 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -884,6 +884,12 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
>                 return connector->funcs->atomic_get_property(connector,
>                                 state, property, val);
>         } else {
> +               // LOG that the kernel is missing handling this property as a case here.
> +               drm_dbg_atomic(
> +                       dev,
> +                       "[CONNECTOR:%d:%s] Get Property [PROP:%d:%s] is not handled\n",
> +                       connector->base.id, connector->name, property->base.id,
> +                       property->name);
>                 return -EINVAL;
>         }
>
> --
> 2.36.0.512.ge40c2bad7a-goog
>

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

* Re: [PATCH] drm: Add a debug message when getting a prop is missing
  2022-05-10 18:28 [PATCH] drm: Add a debug message when getting a prop is missing Mark Yacoub
  2022-05-12 14:22 ` Mark Yacoub
  2022-05-16 15:10 ` Mark Yacoub
@ 2022-05-17  7:51 ` Jani Nikula
  2 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2022-05-17  7:51 UTC (permalink / raw)
  To: Mark Yacoub
  Cc: David Airlie, markyacoub, linux-kernel, seanpaul, dri-devel,
	Thomas Zimmermann, markyacoub

On Tue, 10 May 2022, Mark Yacoub <markyacoub@chromium.org> wrote:
> [Why]
> If a connector property is attached but
> drm_atomic_connector_get_property doesn't handle a case for it,
> modeteset will crash with a segfault without.
>
> [How]
> Add a debug message indicating that a connector property is not handled
> when user space is trying to read it.
>
> TEST=modetest
>
> Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
> ---
>  drivers/gpu/drm/drm_atomic_uapi.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index acb1ee93d206..36b0f664dd80 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -884,6 +884,12 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
>  		return connector->funcs->atomic_get_property(connector,
>  				state, property, val);
>  	} else {
> +		// LOG that the kernel is missing handling this property as a case here.

The comment is unnecessary, and we also don't use // comments.

> +		drm_dbg_atomic(
> +			dev,
> +			"[CONNECTOR:%d:%s] Get Property [PROP:%d:%s] is not handled\n",
> +			connector->base.id, connector->name, property->base.id,
> +			property->name);

Why not use the same message as in drm_atomic_connector_set_property()?

Blank line here.

BR,
Jani.

>  		return -EINVAL;
>  	}

-- 
Jani Nikula, Intel Open Source Graphics Center

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

end of thread, other threads:[~2022-05-17  7:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 18:28 [PATCH] drm: Add a debug message when getting a prop is missing Mark Yacoub
2022-05-12 14:22 ` Mark Yacoub
2022-05-16 15:10 ` Mark Yacoub
2022-05-17  7:51 ` Jani Nikula

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).