linux/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
/**
 * vmw_du_update_layout - Update the display unit with topology from resolution
 * plugin and generate DRM uevent
 * @dev_priv: device private
 * @num_rects: number of drm_rect in rects
 * @rects: toplogy to update
 */
Update the display unit with topology from resolution
plugin and generate DRM uevent
@dev_priv: device private
@num_rects: number of drm_rect in rects
@rects: toplogy to update
Update the display unit with topology from resolution plugin and generate DRM uevent @dev_priv : device private @num_rects : number of drm_rect in rects @rects : toplogy to update
static int vmw_du_update_layout(struct vmw_private *dev_priv,
				unsigned int num_rects, struct drm_rect *rects)
{
	struct drm_device *dev = dev_priv->dev;
	struct vmw_display_unit *du;
	struct drm_connector *con;
	struct drm_connector_list_iter conn_iter;
	mutex_lock(&dev_priv->requested_layout_mutex);
	drm_connector_list_iter_begin(dev, &conn_iter);
	drm_for_each_connector_iter(con, &conn_iter) {
		du = vmw_connector_to_du(con);
		if (num_rects > du->unit) {
			du->pref_width = drm_rect_width(&rects[du->unit]);
			du->pref_height = drm_rect_height(&rects[du->unit]);
			du->pref_active = true;
			du->gui_x = rects[du->unit].x1;
			du->gui_y = rects[du->unit].y1;
		} else {
			du->pref_width = 800;
			du->pref_height = 600;
			du->pref_active = false;
			du->gui_x = 0;
			du->gui_y = 0;
		}
	}
	drm_connector_list_iter_end(&conn_iter);
	mutex_unlock(&dev_priv->requested_layout_mutex);
	mutex_lock(&dev->mode_config.mutex);
	list_for_each_entry(con, &dev->mode_config.connector_list, head) {
		du = vmw_connector_to_du(con);
		if (num_rects > du->unit) {
			drm_object_property_set_value
			  (&con->base, dev->mode_config.suggested_x_property,
			   du->gui_x);
			drm_object_property_set_value
			  (&con->base, dev->mode_config.suggested_y_property,
			   du->gui_y);
		} else {
			drm_object_property_set_value
			  (&con->base, dev->mode_config.suggested_x_property,
			   0);
			drm_object_property_set_value
			  (&con->base, dev->mode_config.suggested_y_property,
			   0);
		}
		con->status = vmw_du_connector_detect(con, true);
	}
	mutex_unlock(&dev->mode_config.mutex);
	drm_sysfs_hotplug_event(dev);
	return 0;
}
static int vmw_du_update_layout ( struct vmw_private * dev_priv , unsigned int num_rects , struct drm_rect * rects ) { struct drm_device * dev = dev_priv -> dev ; struct vmw_display_unit * du ; struct drm_connector * con ; struct drm_connector_list_iter conn_iter ; mutex_lock ( & dev_priv -> requested_layout_mutex ) ; drm_connector_list_iter_begin ( dev , & conn_iter ) ; drm_for_each_connector_iter ( con , & conn_iter ) { du = vmw_connector_to_du ( con ) ; if ( num_rects > du -> unit ) { du -> pref_width = drm_rect_width ( & rects [ du -> unit ] ) ; du -> pref_height = drm_rect_height ( & rects [ du -> unit ] ) ; du -> pref_active = true ; du -> gui_x = rects [ du -> unit ] . x1 ; du -> gui_y = rects [ du -> unit ] . y1 ; } else { du -> pref_width = 800 ; du -> pref_height = 600 ; du -> pref_active = false ; du -> gui_x = 0 ; du -> gui_y = 0 ; } } drm_connector_list_iter_end ( & conn_iter ) ; mutex_unlock ( & dev_priv -> requested_layout_mutex ) ; mutex_lock ( & dev -> mode_config . mutex ) ; list_for_each_entry ( con , & dev -> mode_config . connector_list , head ) { du = vmw_connector_to_du ( con ) ; if ( num_rects > du -> unit ) { drm_object_property_set_value ( & con -> base , dev -> mode_config . suggested_x_property , du -> gui_x ) ; drm_object_property_set_value ( & con -> base , dev -> mode_config . suggested_y_property , du -> gui_y ) ; } else { drm_object_property_set_value ( & con -> base , dev -> mode_config . suggested_x_property , 0 ) ; drm_object_property_set_value ( & con -> base , dev -> mode_config . suggested_y_property , 0 ) ; } con -> status = vmw_du_connector_detect ( con , true ) ; } mutex_unlock ( & dev -> mode_config . mutex ) ; drm_sysfs_hotplug_event ( dev ) ; return 0 ; }
vmw_du_update_layout - Update the display unit with topology from resolution
 plugin and generate DRM uevent
 @dev_priv: device private
 @num_rects: number of drm_rect in rects
 @rects: toplogy to update
vmw_du_update_layout - Update the display unit with topology from resolution plugin and generate DRM uevent @dev_priv : device private @num_rects : number of drm_rect in rects @rects : toplogy to update
/*
	 * Currently only gui_x/y is protected with requested_layout_mutex.
	 */