drm: emit change events when mode config changes
Subsystems (2)
RFC 1/1 drm: emit change events when mode config changes
We've already seen that apps want to monitor the display config, and some (like upowerd) poll for changes since we don't provide a notification for general mode config changes, just hotplug events. So add a new drm event, with CHANGE=1 set in the event, to allow for it.
drivers/gpu/drm/drm_crtc.c +2 -0
@@ -1589,6 +1589,8 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, set.fb = fb; ret = crtc->funcs->set_config (&set); +drm_sysfs_change_event (dev); + out:kfree (connector_set);mutex_unlock (&dev->mode_config.mutex);
drivers/gpu/drm/drm_fb_helper.c +2 -0
@@ -822,6 +822,8 @@ int drm_fb_helper_set_par(struct fb_info *info)return ret; } } + +drm_sysfs_change_event (dev);mutex_unlock (&dev->mode_config.mutex);if (fb_helper->delayed_hotplug) {
drivers/gpu/drm/drm_sysfs.c +21 -3
@@ -467,9 +467,9 @@ EXPORT_SYMBOL(drm_sysfs_connector_remove);* drm_sysfs_hotplug_event - generate a DRM uevent * @dev: DRM device * -* Send a uevent for the DRM device specified by @dev. Currently we only -* set HOTPLUG=1 in the uevent environment, but this could be expanded to -* deal with other types of events. +* Send a uevent for the DRM device specified by @dev. Set HOTPLUG=1 in the +* event to indicate a display config change occurred, probably due to a +* display being added or removed. */ void drm_sysfs_hotplug_event (struct drm_device *dev) {
@@ -483,6 +483,24 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)EXPORT_SYMBOL (drm_sysfs_hotplug_event);/** +* drm_sysfs_change_event - generate a DRM uevent indicating a display config change +* @dev: DRM device +* +* Send a uevent for the DRM device specified by @dev. Set CHANGE=1 to +* indicate that a userspace initiated display configuration change occurred. +*/ +void drm_sysfs_change_event (struct drm_device *dev) +{ +char *event_string ="CHANGE=1" ; +char *envp[] = { event_string,NULL }; + +DRM_DEBUG ("generating hotplug event\n" ); + +kobject_uevent_env (&dev->primary->kdev.kobj,KOBJ_CHANGE , envp); +} +EXPORT_SYMBOL (drm_sysfs_change_event); + +/** * drm_sysfs_device_add - adds a class device to sysfs for a character driver * @dev: DRM device to be added * @head: DRM head in question
include/drm/drmP.h +1 -0
@@ -1506,6 +1506,7 @@ extern struct class *drm_sysfs_create(struct module *owner, char *name);extern void drm_sysfs_destroy (void );extern int drm_sysfs_device_add (struct drm_minor *minor);extern void drm_sysfs_hotplug_event (struct drm_device *dev); +extern void drm_sysfs_change_event (struct drm_device *dev);extern void drm_sysfs_device_remove (struct drm_minor *minor);extern char *drm_get_connector_status_name (enum drm_connector_status status);extern int drm_sysfs_connector_add (struct drm_connector *connector);
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
Quoted 56 lines · Jesse Barnes
We've already seen that apps want to monitor the display config, and some (like upowerd) poll for changes since we don't provide a notification for general mode config changes, just hotplug events. So add a new drm event, with CHANGE=1 set in the event, to allow for it.
Signed-off-by Jesse Barnes <[email protected]>drivers/gpu/drm/drm_crtc.c +2
-0@@ -1589,6 +1589,8 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, set.fb = fb; ret = crtc->funcs->set_config (&set); +drm_sysfs_change_event (dev); + out:kfree (connector_set);mutex_unlock (&dev->mode_config.mutex);drivers/gpu/drm/drm_fb_helper.c +2
-0@@ -822,6 +822,8 @@ int drm_fb_helper_set_par(struct fb_info *info)return ret; } } + +drm_sysfs_change_event (dev);mutex_unlock (&dev->mode_config.mutex);if (fb_helper->delayed_hotplug) {drivers/gpu/drm/drm_sysfs.c +5
-3@@ -467,9 +467,9 @@ EXPORT_SYMBOL(drm_sysfs_connector_remove);* drm_sysfs_hotplug_event - generate a DRM uevent * @dev: DRM device * -* Send a uevent for the DRM device specified by @dev. Currently we only -* set HOTPLUG=1 in the uevent environment, but this could be expanded to -* deal with other types of events. +* Send a uevent for the DRM device specified by @dev. Set HOTPLUG=1 in the +* event to indicate a display config change occurred, probably due to a +* display being added or removed. */ void drm_sysfs_hotplug_event (struct drm_device *dev) {@@ -483,6 +483,24 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)EXPORT_SYMBOL (drm_sysfs_hotplug_event);/** +* drm_sysfs_change_event - generate a DRM uevent indicating a display config change +* @dev: DRM device
drivers/gpu/drm/drm_sysfs.c void drm_sysfs_hotplug_event(struct drm_device *dev) · line 497
Quoted 10 lines
drivers/gpu/drm/drm_sysfs.c +10
-0+* +* Send a uevent for the DRM device specified by @dev. Set CHANGE=1 to +* indicate that a userspace initiated display configuration change occurred. +*/ +void drm_sysfs_change_event (struct drm_device *dev) +{ +char *event_string ="CHANGE=1" ; +char *envp[] = { event_string,NULL }; + +DRM_DEBUG ("generating hotplug event\n" );
Should be "change event" here?
Quoted 29 lines
drivers/gpu/drm/drm_sysfs.c +6
-0+ +kobject_uevent_env (&dev->primary->kdev.kobj,KOBJ_CHANGE , envp); +} +EXPORT_SYMBOL (drm_sysfs_change_event); + +/** * drm_sysfs_device_add - adds a class device to sysfs for a character driver * @dev: DRM device to be added * @head: DRM head in question include/drm/drmP.h +1
-1@@ -1506,6 +1506,7 @@ extern struct class *drm_sysfs_create(struct module *owner, char *name);extern void drm_sysfs_destroy (void );extern int drm_sysfs_device_add (struct drm_minor *minor);extern void drm_sysfs_hotplug_event (struct drm_device *dev); +extern void drm_sysfs_change_event (struct drm_device *dev);extern void drm_sysfs_device_remove (struct drm_minor *minor);extern char *drm_get_connector_status_name (enum drm_connector_status status);extern int drm_sysfs_connector_add (struct drm_connector *connector); ------------------------------------------------------------------------------Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
--
Quoted 8 lines
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
Quoted 16 lines · On Fri, 15 Apr 2011 09:23:38 -0500 Chris Bandy <[email protected]> wrote:
drivers/gpu/drm/drm_sysfs.c void drm_sysfs_hotplug_event(struct drm_device *dev) · line 497
Quoted 13 lines · Jesse Barnes
/**
+ *drm_sysfs_change_event- generate a DRM uevent indicating a display config change
+ * @dev: DRM device
+ *
+ * Send a uevent for the DRM device specified by @dev. Set CHANGE=1 to
+ * indicate that a userspace initiated display configuration change occurred.
+ */drivers/gpu/drm/drm_sysfs.c +6
-0+void drm_sysfs_change_event (struct drm_device *dev) +{ +char *event_string ="CHANGE=1" ; +char *envp[] = { event_string,NULL }; + +DRM_DEBUG ("generating hotplug event\n" );Should be "change event" here?
Yeah, I noticed after I sent it out, I think I'll just drop the DRM_DEBUG altogether though.
Signature · 13 lines
Jesse Barnes, Intel Open Source Technology Center ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
Quoted 6 lines · Jesse Barnes
We've already seen that apps want to monitor the display config, and some (like upowerd) poll for changes since we don't provide a notification for general mode config changes, just hotplug events. So add a new drm event, with CHANGE=1 set in the event, to allow for it.
Signed-off-by Jesse Barnes<[email protected]>
- ajax
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel