@@ -19,6 +19,7 @@
#include "drm_client_internal.h"
#include "drm_draw_internal.h"
+#include "drm_internal.h"
MODULE_AUTHOR("Jocelyn Falempe");
MODULE_DESCRIPTION("DRM boot logger");
@@ -308,8 +309,13 @@ static void drm_log_write_thread(struct console *con, struct nbcon_write_context
if (!dlog->probed)
drm_log_init_client(dlog);
- for (i = 0; i < dlog->n_scanout; i++)
- drm_log_draw_kmsg_record(&dlog->scanout[i], wctxt->outbuf, wctxt->len);
+ /* Check that we are still the master before drawing */
+ if (drm_master_internal_acquire(dlog->client.dev)) {
+ drm_master_internal_release(dlog->client.dev);
+
+ for (i = 0; i < dlog->n_scanout; i++)
+ drm_log_draw_kmsg_record(&dlog->scanout[i], wctxt->outbuf, wctxt->len);
+ }
}
static void drm_log_lock(struct console *con, unsigned long *flags)