All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jocelyn Falempe <jfalempe@redhat.com>
To: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v9 2/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen
Date: Wed, 18 Dec 2024 14:51:24 +0100	[thread overview]
Message-ID: <6660b69e-4cd3-4d94-8617-365b043aece5@redhat.com> (raw)
In-Reply-To: <feb72a8c-06c1-48d9-abb0-d680c11922a7@web.de>

On 18/12/2024 13:25, Markus Elfring wrote:
> …
>> +++ b/drivers/gpu/drm/clients/drm_log.c
>> @@ -0,0 +1,370 @@
> …
>> +static int drm_log_count_modeset(struct drm_client_dev *client)
>> +{
>> +	struct drm_mode_set *mode_set;
>> +	int count = 0;
>> +
>> +	mutex_lock(&client->modeset_mutex);
>> +	drm_client_for_each_modeset(mode_set, client)
>> +		count++;
>> +	mutex_unlock(&client->modeset_mutex);
>> +	return count;
>> +}
> …
> 
> Under which circumstances would you become interested to apply a statement
> like “guard(mutex)(&client->modeset_mutex);”?
> https://elixir.bootlin.com/linux/v6.13-rc3/source/include/linux/mutex.h#L201

Ok, I didn't know about this new syntax, thanks for pointing this to me.
Regarding drm_log, I kept the mutex usage simple, as there is only one 
mutex_lock() and one mutex_unlock() in each function, which means there 
is not much benefit to use the guard syntax.
I will keep that in mind, and if there is a need to have more complex 
mutex handling, I will probably use this.

Best regards,

-- 

Jocelyn
> 
> Regards,
> Markus
> 


  reply	other threads:[~2024-12-18 13:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 15:44 [PATCH v9 0/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 1/6] drm/panic: Move drawing functions to drm_draw Jocelyn Falempe
2024-12-11 21:34   ` [v9,1/6] " Kees Bakker
2024-12-12  8:36     ` Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 2/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-12-05 16:21   ` Thomas Zimmermann
2024-12-12  7:41   ` Dan Carpenter
2024-12-12  8:49     ` Jocelyn Falempe
2024-12-12  8:53       ` Dan Carpenter
2024-12-12 10:07       ` Simona Vetter
2024-12-18 12:25   ` Markus Elfring
2024-12-18 13:51     ` Jocelyn Falempe [this message]
2024-12-04 15:45 ` [PATCH v9 3/6] drm/log: Do not draw if drm_master is taken Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 4/6] drm/log: Color the timestamp, to improve readability Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 5/6] drm/log: Implement suspend/resume Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 6/6] drm/log: Add integer scaling support Jocelyn Falempe
2024-12-10 13:42 ` [PATCH v9 0/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-12-17 14:19 ` Geert Uytterhoeven
2024-12-17 14:46   ` Jocelyn Falempe
2024-12-17 14:54     ` Geert Uytterhoeven
2024-12-18 10:14       ` Jocelyn Falempe
2024-12-18 11:00         ` Geert Uytterhoeven
2024-12-18 11:41           ` Jocelyn Falempe
2024-12-18 14:18             ` Petr Mladek
2024-12-18 14:25               ` Geert Uytterhoeven
2024-12-18 14:58               ` Jocelyn Falempe
2024-12-18 15:03                 ` Geert Uytterhoeven
2024-12-18 16:18                 ` Petr Mladek
2024-12-19 11:24                   ` Jocelyn Falempe

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=6660b69e-4cd3-4d94-8617-365b043aece5@redhat.com \
    --to=jfalempe@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.