Skip to content

Commit

Permalink
drm: Add drm_sysfs_connector_status_event()
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbbell authored and wulf7 committed Nov 27, 2023
1 parent 7865cf3 commit 425c0b2
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions drivers/gpu/drm/drm_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
#include <drm/drm_connector.h>
#include <drm/drm_device.h>
#include <drm/drm_print.h>
#include <drm/drm_property.h>
#include <drm/drm_sysfs.h>

#include "drm_internal.h"
#include "drm_crtc_internal.h"

static struct device_type drm_sysfs_device_minor = {
.name = "drm_minor"
Expand Down Expand Up @@ -88,10 +90,27 @@ void drm_sysfs_connector_hotplug_event(struct drm_connector *connector)
struct drm_device *dev = connector->dev;
struct sbuf *sb = sbuf_new_auto();

DRM_DEBUG("generating hotplug event\n");
drm_dbg_kms(connector->dev,
"[CONNECTOR:%d:%s] generating connector hotplug event\n",
connector->base.id, connector->name);

sbuf_printf(sb, "cdev=dri/%s connector=%u",
dev_name(dev->primary->kdev), connector->base.id);
sbuf_finish(sb);
devctl_notify("DRM", "CONNECTOR", "HOTPLUG", sbuf_data(sb));
sbuf_delete(sb);
}

void drm_sysfs_connector_status_event(struct drm_connector *connector,
struct drm_property *property)
{
struct drm_device *dev = connector->dev;
struct sbuf *sb = sbuf_new_auto();

DRM_DEBUG("generating connector status event\n");

sbuf_printf(sb, "cdev=dri/%s connector_id=%u connector_name=\"%s\"",
dev_name(dev->primary->kdev), connector->base.id, connector->name);
sbuf_printf(sb, "cdev=dri/%s connector=%u property=%u",
dev_name(dev->primary->kdev), connector->base.id, property->base.id);
sbuf_finish(sb);
devctl_notify("DRM", "CONNECTOR", "HOTPLUG", sbuf_data(sb));
sbuf_delete(sb);
Expand Down

0 comments on commit 425c0b2

Please sign in to comment.