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

Commit b4fa9d0f authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs
Browse files

drm/nouveau: make cursor_set implementation consistent with other drivers



When xorg state tracker wants to hide the cursor it calls set_cursor
with NULL buffer_handle and size=0x0, but nouveau refuses to hide it
because size is not 64x64... which is a bit odd. Both radeon and intel
check buffer_handle before validating size of cursor, so make nouveau
implementation consistent with them.

Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 52eba8dd
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -943,14 +943,14 @@ nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
	struct drm_gem_object *gem;
	struct drm_gem_object *gem;
	int ret = 0;
	int ret = 0;


	if (width != 64 || height != 64)
		return -EINVAL;

	if (!buffer_handle) {
	if (!buffer_handle) {
		nv_crtc->cursor.hide(nv_crtc, true);
		nv_crtc->cursor.hide(nv_crtc, true);
		return 0;
		return 0;
	}
	}


	if (width != 64 || height != 64)
		return -EINVAL;

	gem = drm_gem_object_lookup(dev, file_priv, buffer_handle);
	gem = drm_gem_object_lookup(dev, file_priv, buffer_handle);
	if (!gem)
	if (!gem)
		return -ENOENT;
		return -ENOENT;
+3 −3
Original line number Original line Diff line number Diff line
@@ -349,14 +349,14 @@ nv50_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
	struct drm_gem_object *gem;
	struct drm_gem_object *gem;
	int ret = 0, i;
	int ret = 0, i;


	if (width != 64 || height != 64)
		return -EINVAL;

	if (!buffer_handle) {
	if (!buffer_handle) {
		nv_crtc->cursor.hide(nv_crtc, true);
		nv_crtc->cursor.hide(nv_crtc, true);
		return 0;
		return 0;
	}
	}


	if (width != 64 || height != 64)
		return -EINVAL;

	gem = drm_gem_object_lookup(dev, file_priv, buffer_handle);
	gem = drm_gem_object_lookup(dev, file_priv, buffer_handle);
	if (!gem)
	if (!gem)
		return -ENOENT;
		return -ENOENT;