From: kettenis Date: Mon, 5 Dec 2022 07:37:57 +0000 (+0000) Subject: Trigger a kevent when we change the backlight. This gives the Xorg X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=141f4e1756e0587ede9f0d04081c7f82d3c48887;p=openbsd Trigger a kevent when we change the backlight. This gives the Xorg drivers a chance to notice the update of the Backlight connector property when we change it behind its back. ok jsg@ --- diff --git a/sys/dev/pci/drm/drm_connector.c b/sys/dev/pci/drm/drm_connector.c index e9e12a1a6ee..d0e09ddafc8 100644 --- a/sys/dev/pci/drm/drm_connector.c +++ b/sys/dev/pci/drm/drm_connector.c @@ -2340,6 +2340,7 @@ int drm_connector_set_obj_prop(struct drm_mode_object *obj, } else if (property == connector->backlight_property) { connector->backlight_device->props.brightness = value; backlight_schedule_update_status(connector->backlight_device); + KNOTE(&connector->dev->note, NOTE_CHANGE); ret = 0; #endif } else if (connector->funcs->set_property) diff --git a/sys/dev/pci/drm/drm_mode_object.c b/sys/dev/pci/drm/drm_mode_object.c index eeea6e539a1..6826d3fbd8d 100644 --- a/sys/dev/pci/drm/drm_mode_object.c +++ b/sys/dev/pci/drm/drm_mode_object.c @@ -527,6 +527,7 @@ retry: struct drm_connector *connector = obj_to_connector(obj); connector->backlight_device->props.brightness = prop_value; backlight_schedule_update_status(connector->backlight_device); + KNOTE(&connector->dev->note, NOTE_CHANGE); ret = 0; #endif } else { diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index 5f1ba56413b..6ef29443a1e 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -2134,6 +2134,7 @@ inteldrm_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) case WSDISPLAYIO_PARAM_BRIGHTNESS: bd->props.brightness = dp->curval; backlight_update_status(bd); + KNOTE(&dev_priv->drm.note, NOTE_CHANGE); return 0; } break;