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

Commit 79c9089f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'drm-fixes-for-v4.10-rc7' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Another fixes pull for v4.10, it's a bit big due to the backport of
  the VMA fixes for i915 that should fix the oops on shutdown problems
  that you've worked around.

  There are also two drm core connector registration fixes, a bunch of
  nouveau regression fixes and two AMD fixes"

* tag 'drm-fixes-for-v4.10-rc7' of git://people.freedesktop.org/~airlied/linux:
  drm/radeon: Fix vram_size/visible values in DRM_RADEON_GEM_INFO ioctl
  drm/amdgpu/si: fix crash on headless asics
  drm/i915: Track pinned vma in intel_plane_state
  drm/atomic: Unconditionally call prepare_fb.
  drm/atomic: Fix double free in drm_atomic_state_default_clear
  drm/nouveau/kms/nv50: request vblank events for commits that send completion events
  drm/nouveau/nv1a,nv1f/disp: fix memory clock rate retrieval
  drm/nouveau/disp/gt215: Fix HDA ELD handling (thus, HDMI audio) on gt215
  drm/nouveau/nouveau/led: prevent compiling the led-code if nouveau=y and leds=m
  drm/nouveau/disp/mcp7x: disable dptmds workaround
  drm/nouveau: prevent userspace from deleting client object
  drm/nouveau/fence/g84-: protect against concurrent access to semaphore buffers
  drm: Don't race connector registration
  drm: prevent double-(un)registration for connectors
parents 57480b98 f63cf464
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -254,6 +254,9 @@ static void gmc_v6_0_mc_program(struct amdgpu_device *adev)
	}
	WREG32(mmHDP_REG_COHERENCY_FLUSH_CNTL, 0);

	if (adev->mode_info.num_crtc)
		amdgpu_display_set_vga_render_state(adev, false);

	gmc_v6_0_mc_stop(adev, &save);

	if (gmc_v6_0_wait_for_idle((void *)adev)) {
@@ -283,7 +286,6 @@ static void gmc_v6_0_mc_program(struct amdgpu_device *adev)
		dev_warn(adev->dev, "Wait for MC idle timedout !\n");
	}
	gmc_v6_0_mc_resume(adev, &save);
	amdgpu_display_set_vga_render_state(adev, false);
}

static int gmc_v6_0_mc_init(struct amdgpu_device *adev)
+8 −5
Original line number Diff line number Diff line
@@ -2032,13 +2032,16 @@ static void complete_crtc_signaling(struct drm_device *dev,
	}

	for_each_crtc_in_state(state, crtc, crtc_state, i) {
		struct drm_pending_vblank_event *event = crtc_state->event;
		/*
		 * TEST_ONLY and PAGE_FLIP_EVENT are mutually
		 * exclusive, if they weren't, this code should be
		 * called on success for TEST_ONLY too.
		 * Free the allocated event. drm_atomic_helper_setup_commit
		 * can allocate an event too, so only free it if it's ours
		 * to prevent a double free in drm_atomic_state_clear.
		 */
		if (crtc_state->event)
			drm_event_cancel_free(dev, &crtc_state->event->base);
		if (event && (event->base.fence || event->base.file_priv)) {
			drm_event_cancel_free(dev, &event->base);
			crtc_state->event = NULL;
		}
	}

	if (!fence_state)
+0 −9
Original line number Diff line number Diff line
@@ -1666,9 +1666,6 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev,

		funcs = plane->helper_private;

		if (!drm_atomic_helper_framebuffer_changed(dev, state, plane_state->crtc))
			continue;

		if (funcs->prepare_fb) {
			ret = funcs->prepare_fb(plane, plane_state);
			if (ret)
@@ -1685,9 +1682,6 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev,
		if (j >= i)
			continue;

		if (!drm_atomic_helper_framebuffer_changed(dev, state, plane_state->crtc))
			continue;

		funcs = plane->helper_private;

		if (funcs->cleanup_fb)
@@ -1954,9 +1948,6 @@ void drm_atomic_helper_cleanup_planes(struct drm_device *dev,
	for_each_plane_in_state(old_state, plane, plane_state, i) {
		const struct drm_plane_helper_funcs *funcs;

		if (!drm_atomic_helper_framebuffer_changed(dev, old_state, plane_state->crtc))
			continue;

		funcs = plane->helper_private;

		if (funcs->cleanup_fb)
+18 −5
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ int drm_connector_init(struct drm_device *dev,

	INIT_LIST_HEAD(&connector->probed_modes);
	INIT_LIST_HEAD(&connector->modes);
	mutex_init(&connector->mutex);
	connector->edid_blob_ptr = NULL;
	connector->status = connector_status_unknown;

@@ -359,6 +360,8 @@ void drm_connector_cleanup(struct drm_connector *connector)
		connector->funcs->atomic_destroy_state(connector,
						       connector->state);

	mutex_destroy(&connector->mutex);

	memset(connector, 0, sizeof(*connector));
}
EXPORT_SYMBOL(drm_connector_cleanup);
@@ -374,14 +377,18 @@ EXPORT_SYMBOL(drm_connector_cleanup);
 */
int drm_connector_register(struct drm_connector *connector)
{
	int ret;
	int ret = 0;

	if (connector->registered)
	if (!connector->dev->registered)
		return 0;

	mutex_lock(&connector->mutex);
	if (connector->registered)
		goto unlock;

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

	ret = drm_debugfs_connector_add(connector);
	if (ret) {
@@ -397,12 +404,14 @@ int drm_connector_register(struct drm_connector *connector)
	drm_mode_object_register(connector->dev, &connector->base);

	connector->registered = true;
	return 0;
	goto unlock;

err_debugfs:
	drm_debugfs_connector_remove(connector);
err_sysfs:
	drm_sysfs_connector_remove(connector);
unlock:
	mutex_unlock(&connector->mutex);
	return ret;
}
EXPORT_SYMBOL(drm_connector_register);
@@ -415,8 +424,11 @@ EXPORT_SYMBOL(drm_connector_register);
 */
void drm_connector_unregister(struct drm_connector *connector)
{
	if (!connector->registered)
	mutex_lock(&connector->mutex);
	if (!connector->registered) {
		mutex_unlock(&connector->mutex);
		return;
	}

	if (connector->funcs->early_unregister)
		connector->funcs->early_unregister(connector);
@@ -425,6 +437,7 @@ void drm_connector_unregister(struct drm_connector *connector)
	drm_debugfs_connector_remove(connector);

	connector->registered = false;
	mutex_unlock(&connector->mutex);
}
EXPORT_SYMBOL(drm_connector_unregister);

+4 −0
Original line number Diff line number Diff line
@@ -745,6 +745,8 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
	if (ret)
		goto err_minors;

	dev->registered = true;

	if (dev->driver->load) {
		ret = dev->driver->load(dev, flags);
		if (ret)
@@ -785,6 +787,8 @@ void drm_dev_unregister(struct drm_device *dev)

	drm_lastclose(dev);

	dev->registered = false;

	if (drm_core_check_feature(dev, DRIVER_MODESET))
		drm_modeset_unregister_all(dev);

Loading