The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Mark Yacoub <markyacoub@chromium.org>
Cc: David Airlie <airlied@linux.ie>,
	markyacoub@chromium.org, linux-kernel@vger.kernel.org,
	seanpaul@chromium.org, dri-devel@lists.freedesktop.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	markyacoub@google.com
Subject: Re: [PATCH] drm: Add a debug message when getting a prop is missing
Date: Tue, 17 May 2022 10:51:14 +0300	[thread overview]
Message-ID: <87bkvwfvgt.fsf@intel.com> (raw)
In-Reply-To: <20220510182810.1223574-1-markyacoub@chromium.org>

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

      parent reply	other threads:[~2022-05-17  7:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bkvwfvgt.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markyacoub@chromium.org \
    --cc=markyacoub@google.com \
    --cc=seanpaul@chromium.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox