Re: [PATCH v9 2/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux