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

Commit e08870c8 authored by Thomas Hellstrom's avatar Thomas Hellstrom Committed by Dave Airlie
Browse files

drm: allow multiple addMaps with the same 32-bit map offsset.



Reported on -mm kernels.

Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent 214ff13d
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -77,14 +77,16 @@ static int drm_map_handle(drm_device_t *dev, drm_hash_item_t *hash,
#error Unsupported long size. Neither 64 nor 32 bits.
#endif

	if (use_hashed_handle) {
	if (!use_hashed_handle) {
		int ret;
		hash->key = user_token;
		ret = drm_ht_insert_item(&dev->map_hash, hash);
		if (ret != -EINVAL)
			return ret;
	}
	return drm_ht_just_insert_please(&dev->map_hash, hash,
					 user_token, 32 - PAGE_SHIFT - 3,
					 PAGE_SHIFT, DRM_MAP_HASH_OFFSET);
	} else {
		hash->key = user_token;
		return drm_ht_insert_item(&dev->map_hash, hash);
	}
}

/**