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

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

Merge tag 'topic/drm-misc-2016-04-21' of git://anongit.freedesktop.org/drm-intel into drm-next

misc pull req all over. Biggest thing is the
drm_connector_(un)register_all cleanup from Alexey for drivers without the
load/unload midlayer hooks. I.e. all the new ones, and a bunch of the
pending new atomic drivers depend upon this. Or at least I asked them to
rebase ;-)

* tag 'topic/drm-misc-2016-04-21' of git://anongit.freedesktop.org/drm-intel:
  drm: Make drm.debug parameter description more helpful
  drm: Remove warning from drm_connector_unregister_all()
  drm: probe_helper: Hide ugly ifdef
  drm: rcar-du: Use generic drm_connector_register_all() helper
  drm: atmel_hldc: Use generic drm_connector_register_all() helper
  drm: Introduce drm_connector_register_all() helper
  drm: fix lut value extraction function
  drm/atomic-helper: Print an error if vblank wait times out
  drm/dp/mst: Restore primary hub guid on resume
  drm: Release driver references to handle before making it available again
  drm/i915/dp/mst: Add source port info to debugfs output
  drm/dp/mst: Enhance DP MST debugfs output
  drm/edid: Add drm_edid_get_monitor_name()
  include/drm: Reword debug categories comment.
  drm/crtc_helper: Reset empty plane state in drm_helper_crtc_mode_set_base()
  drm/virtio: Drop dummy gamma table support
  drm/bochs: Drop fake gamma support
  drm/core: Fix ordering in drm_mode_config_cleanup.
parents f230ffa1 6dc3e22e
Loading
Loading
Loading
Loading
+1 −29
Original line number Diff line number Diff line
@@ -584,34 +584,6 @@ static void atmel_hlcdc_dc_unload(struct drm_device *dev)
	destroy_workqueue(dc->wq);
}

static int atmel_hlcdc_dc_connector_plug_all(struct drm_device *dev)
{
	struct drm_connector *connector, *failed;
	int ret;

	mutex_lock(&dev->mode_config.mutex);
	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
		ret = drm_connector_register(connector);
		if (ret) {
			failed = connector;
			goto err;
		}
	}
	mutex_unlock(&dev->mode_config.mutex);
	return 0;

err:
	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
		if (failed == connector)
			break;

		drm_connector_unregister(connector);
	}
	mutex_unlock(&dev->mode_config.mutex);

	return ret;
}

static void atmel_hlcdc_dc_connector_unplug_all(struct drm_device *dev)
{
	mutex_lock(&dev->mode_config.mutex);
@@ -736,7 +708,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
	if (ret)
		goto err_unload;

	ret = atmel_hlcdc_dc_connector_plug_all(ddev);
	ret = drm_connector_register_all(ddev);
	if (ret)
		goto err_unregister;

+0 −15
Original line number Diff line number Diff line
@@ -162,22 +162,7 @@ static int bochs_fbdev_destroy(struct bochs_device *bochs)
	return 0;
}

void bochs_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
			u16 blue, int regno)
{
}

void bochs_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
			u16 *blue, int regno)
{
	*red   = regno;
	*green = regno;
	*blue  = regno;
}

static const struct drm_fb_helper_funcs bochs_fb_helper_funcs = {
	.gamma_set = bochs_fb_gamma_set,
	.gamma_get = bochs_fb_gamma_get,
	.fb_probe = bochsfb_create,
};

+0 −7
Original line number Diff line number Diff line
@@ -93,11 +93,6 @@ static void bochs_crtc_commit(struct drm_crtc *crtc)
{
}

static void bochs_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
				 u16 *blue, uint32_t start, uint32_t size)
{
}

static int bochs_crtc_page_flip(struct drm_crtc *crtc,
				struct drm_framebuffer *fb,
				struct drm_pending_vblank_event *event,
@@ -120,7 +115,6 @@ static int bochs_crtc_page_flip(struct drm_crtc *crtc,

/* These provide the minimum set of functions required to handle a CRTC */
static const struct drm_crtc_funcs bochs_crtc_funcs = {
	.gamma_set = bochs_crtc_gamma_set,
	.set_config = drm_crtc_helper_set_config,
	.destroy = drm_crtc_cleanup,
	.page_flip = bochs_crtc_page_flip,
@@ -140,7 +134,6 @@ static void bochs_crtc_init(struct drm_device *dev)
	struct drm_crtc *crtc = &bochs->crtc;

	drm_crtc_init(dev, crtc, &bochs_crtc_funcs);
	drm_mode_crtc_set_gamma_size(crtc, 256);
	drm_crtc_helper_add(crtc, &bochs_helper_funcs);
}

+2 −0
Original line number Diff line number Diff line
@@ -1103,6 +1103,8 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
					drm_crtc_vblank_count(crtc),
				msecs_to_jiffies(50));

		WARN(!ret, "[CRTC:%d] vblank wait timed out\n", crtc->base.id);

		drm_crtc_vblank_put(crtc);
	}
}
+50 −10
Original line number Diff line number Diff line
@@ -1067,6 +1067,46 @@ void drm_connector_unregister(struct drm_connector *connector)
}
EXPORT_SYMBOL(drm_connector_unregister);

/**
 * drm_connector_register_all - register all connectors
 * @dev: drm device
 *
 * This function registers all connectors in sysfs and other places so that
 * userspace can start to access them. Drivers can call it after calling
 * drm_dev_register() to complete the device registration, if they don't call
 * drm_connector_register() on each connector individually.
 *
 * When a device is unplugged and should be removed from userspace access,
 * call drm_connector_unregister_all(), which is the inverse of this
 * function.
 *
 * Returns:
 * Zero on success, error code on failure.
 */
int drm_connector_register_all(struct drm_device *dev)
{
	struct drm_connector *connector;
	int ret;

	mutex_lock(&dev->mode_config.mutex);

	drm_for_each_connector(connector, dev) {
		ret = drm_connector_register(connector);
		if (ret)
			goto err;
	}

	mutex_unlock(&dev->mode_config.mutex);

	return 0;

err:
	mutex_unlock(&dev->mode_config.mutex);
	drm_connector_unregister_all(dev);
	return ret;
}
EXPORT_SYMBOL(drm_connector_register_all);

/**
 * drm_connector_unregister_all - unregister connector userspace interfaces
 * @dev: drm device
@@ -1082,7 +1122,7 @@ void drm_connector_unregister_all(struct drm_device *dev)
	struct drm_connector *connector;

	/* FIXME: taking the mode config mutex ends up in a clash with sysfs */
	drm_for_each_connector(connector, dev)
	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
		drm_connector_unregister(connector);
}
EXPORT_SYMBOL(drm_connector_unregister_all);
@@ -5914,6 +5954,15 @@ void drm_mode_config_cleanup(struct drm_device *dev)
		drm_property_destroy(dev, property);
	}

	list_for_each_entry_safe(plane, plt, &dev->mode_config.plane_list,
				 head) {
		plane->funcs->destroy(plane);
	}

	list_for_each_entry_safe(crtc, ct, &dev->mode_config.crtc_list, head) {
		crtc->funcs->destroy(crtc);
	}

	list_for_each_entry_safe(blob, bt, &dev->mode_config.property_blob_list,
				 head_global) {
		drm_property_unreference_blob(blob);
@@ -5932,15 +5981,6 @@ void drm_mode_config_cleanup(struct drm_device *dev)
		drm_framebuffer_free(&fb->refcount);
	}

	list_for_each_entry_safe(plane, plt, &dev->mode_config.plane_list,
				 head) {
		plane->funcs->destroy(plane);
	}

	list_for_each_entry_safe(crtc, ct, &dev->mode_config.crtc_list, head) {
		crtc->funcs->destroy(crtc);
	}

	ida_destroy(&dev->mode_config.connector_ida);
	idr_destroy(&dev->mode_config.tile_idr);
	idr_destroy(&dev->mode_config.crtc_idr);
Loading