Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afa95e74 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'topic/core-stuff-2014-06-30' of git://anongit.freedesktop.org/drm-intel into drm-next

misc core patches picked up by Daniel and Jani.

* tag 'topic/core-stuff-2014-06-30' of git://anongit.freedesktop.org/drm-intel:
  drm/fb-helper: Remove unnecessary list empty check in drm_fb_helper_debug_enter()
  drm/fb-helper: Redundant info->fix.type_aux setting in drm_fb_helper_fill_fix()
  drm/debugfs: add an "edid_override" file per connector
  drm/debugfs: add a "force" file per connector
  drm: add register and unregister functions for connectors
  drm: fix uninitialized acquire_ctx fields (v2)
  drm: Driver-specific ioctls range from 0x40 to 0x9f
  drm: Don't export internal module variables
parents 4b7ba869 2a8c6edf
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1610,7 +1610,7 @@ int max_width, max_height;</synopsis>
          The connector is then registered with a call to
          <function>drm_connector_init</function> with a pointer to the connector
          functions and a connector type, and exposed through sysfs with a call to
          <function>drm_sysfs_connector_add</function>.
          <function>drm_connector_register</function>.
        </para>
        <para>
          Supported connector types are
@@ -1768,7 +1768,7 @@ int max_width, max_height;</synopsis>
	(<function>drm_encoder_cleanup</function>) and connectors
	(<function>drm_connector_cleanup</function>). Furthermore, connectors
	that have been added to sysfs must be removed by a call to
	<function>drm_sysfs_connector_remove</function> before calling
	<function>drm_connector_unregister</function> before calling
	<function>drm_connector_cleanup</function>.
      </para>
      <para>
@@ -1813,7 +1813,7 @@ void intel_crt_init(struct drm_device *dev)
	drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs);
	drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);

	drm_sysfs_connector_add(connector);
	drm_connector_register(connector);
}]]></programlisting>
      <para>
        In the example above (taken from the i915 driver), a CRTC, connector and
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ static void armada_drm_connector_destroy(struct drm_connector *conn)
{
	struct armada_connector *dconn = drm_to_armada_conn(conn);

	drm_sysfs_connector_remove(conn);
	drm_connector_unregister(conn);
	drm_connector_cleanup(conn);
	kfree(dconn);
}
@@ -141,7 +141,7 @@ int armada_output_create(struct drm_device *dev,
	if (ret)
		goto err_conn;

	ret = drm_sysfs_connector_add(&dconn->conn);
	ret = drm_connector_register(&dconn->conn);
	if (ret)
		goto err_sysfs;

+2 −2
Original line number Diff line number Diff line
@@ -829,7 +829,7 @@ static void ast_connector_destroy(struct drm_connector *connector)
{
	struct ast_connector *ast_connector = to_ast_connector(connector);
	ast_i2c_destroy(ast_connector->i2c);
	drm_sysfs_connector_remove(connector);
	drm_connector_unregister(connector);
	drm_connector_cleanup(connector);
	kfree(connector);
}
@@ -871,7 +871,7 @@ static int ast_connector_init(struct drm_device *dev)
	connector->interlace_allowed = 0;
	connector->doublescan_allowed = 0;

	drm_sysfs_connector_add(connector);
	drm_connector_register(connector);

	connector->polled = DRM_CONNECTOR_POLL_CONNECT;

+1 −1
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder,
	}
	drm_connector_helper_add(&ptn_bridge->connector,
			&ptn3460_connector_helper_funcs);
	drm_sysfs_connector_add(&ptn_bridge->connector);
	drm_connector_register(&ptn_bridge->connector);
	drm_mode_connector_attach_encoder(&ptn_bridge->connector, encoder);

	return 0;
+48 −1
Original line number Diff line number Diff line
@@ -881,6 +881,8 @@ int drm_connector_init(struct drm_device *dev,
	drm_object_attach_property(&connector->base,
				      dev->mode_config.dpms_property, 0);

	connector->debugfs_entry = NULL;

out_put:
	if (ret)
		drm_mode_object_put(dev, &connector->base);
@@ -920,6 +922,47 @@ void drm_connector_cleanup(struct drm_connector *connector)
}
EXPORT_SYMBOL(drm_connector_cleanup);

/**
 * drm_connector_register - register a connector
 * @connector: the connector to register
 *
 * Register userspace interfaces for a connector
 *
 * Returns:
 * Zero on success, error code on failure.
 */
int drm_connector_register(struct drm_connector *connector)
{
	int ret;

	ret = drm_sysfs_connector_add(connector);
	if (ret)
		return ret;

	ret = drm_debugfs_connector_add(connector);
	if (ret) {
		drm_sysfs_connector_remove(connector);
		return ret;
	}

	return 0;
}
EXPORT_SYMBOL(drm_connector_register);

/**
 * drm_connector_unregister - unregister a connector
 * @connector: the connector to unregister
 *
 * Unregister userspace interfaces for a connector
 */
void drm_connector_unregister(struct drm_connector *connector)
{
	drm_sysfs_connector_remove(connector);
	drm_debugfs_connector_remove(connector);
}
EXPORT_SYMBOL(drm_connector_unregister);


/**
 * drm_connector_unplug_all - unregister connector userspace interfaces
 * @dev: drm device
@@ -934,7 +977,7 @@ void drm_connector_unplug_all(struct drm_device *dev)

	/* taking the mode config mutex ends up in a clash with sysfs */
	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
		drm_sysfs_connector_remove(connector);
		drm_connector_unregister(connector);

}
EXPORT_SYMBOL(drm_connector_unplug_all);
@@ -3720,6 +3763,10 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
	struct drm_device *dev = connector->dev;
	int ret, size;

	/* ignore requests to set edid when overridden */
	if (connector->override_edid)
		return 0;

	if (connector->edid_blob_ptr)
		drm_property_destroy_blob(dev, connector->edid_blob_ptr);

Loading