Trigger a kevent when we change the backlight. This gives the Xorg
authorkettenis <kettenis@openbsd.org>
Mon, 5 Dec 2022 07:37:57 +0000 (07:37 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 5 Dec 2022 07:37:57 +0000 (07:37 +0000)
drivers a chance to notice the update of the Backlight connector property
when we change it behind its back.

ok jsg@

sys/dev/pci/drm/drm_connector.c
sys/dev/pci/drm/drm_mode_object.c
sys/dev/pci/drm/i915/i915_drv.c

index e9e12a1..d0e09dd 100644 (file)
@@ -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)
index eeea6e5..6826d3f 100644 (file)
@@ -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 {
index 5f1ba56..6ef2944 100644 (file)
@@ -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;