Commit 15ebea1b authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-fixes-2025-11-13' of...

Merge tag 'drm-misc-fixes-2025-11-13' of https://gitlab.freedesktop.org/drm/misc/kernel

 into drm-fixes

Short summary of fixes pull:

client:
- Fix description of module parameter

panthor:
- Flush writes before mapping buffers

vmwgfx:
- Improve command validation
- Improve ref counting
- Fix cursor-plane support

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20251113132317.GA451885@linux.fritz.box
parents 63444b4c 0a4a18e8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ static char drm_client_default[16] = CONFIG_DRM_CLIENT_DEFAULT;
module_param_string(active, drm_client_default, sizeof(drm_client_default), 0444);
MODULE_PARM_DESC(active,
		 "Choose which drm client to start, default is "
		 CONFIG_DRM_CLIENT_DEFAULT "]");
		 CONFIG_DRM_CLIENT_DEFAULT);

/**
 * drm_client_setup() - Setup in-kernel DRM clients
+18 −0
Original line number Diff line number Diff line
@@ -288,6 +288,23 @@ panthor_gem_create_with_handle(struct drm_file *file,

	panthor_gem_debugfs_set_usage_flags(bo, 0);

	/* If this is a write-combine mapping, we query the sgt to force a CPU
	 * cache flush (dma_map_sgtable() is called when the sgt is created).
	 * This ensures the zero-ing is visible to any uncached mapping created
	 * by vmap/mmap.
	 * FIXME: Ideally this should be done when pages are allocated, not at
	 * BO creation time.
	 */
	if (shmem->map_wc) {
		struct sg_table *sgt;

		sgt = drm_gem_shmem_get_pages_sgt(shmem);
		if (IS_ERR(sgt)) {
			ret = PTR_ERR(sgt);
			goto out_put_gem;
		}
	}

	/*
	 * Allocate an id of idr table where the obj is registered
	 * and handle has the id what user can see.
@@ -296,6 +313,7 @@ panthor_gem_create_with_handle(struct drm_file *file,
	if (!ret)
		*size = bo->base.base.size;

out_put_gem:
	/* drop reference from allocate - handle holds it now. */
	drm_gem_object_put(&shmem->base);

+15 −1
Original line number Diff line number Diff line
@@ -100,8 +100,10 @@ vmw_cursor_update_type(struct vmw_private *vmw, struct vmw_plane_state *vps)
	if (vmw->has_mob) {
		if ((vmw->capabilities2 & SVGA_CAP2_CURSOR_MOB) != 0)
			return VMW_CURSOR_UPDATE_MOB;
		else
			return VMW_CURSOR_UPDATE_GB_ONLY;
	}

	drm_warn_once(&vmw->drm, "Unknown Cursor Type!\n");
	return VMW_CURSOR_UPDATE_NONE;
}

@@ -139,6 +141,7 @@ static u32 vmw_cursor_mob_size(enum vmw_cursor_update_type update_type,
{
	switch (update_type) {
	case VMW_CURSOR_UPDATE_LEGACY:
	case VMW_CURSOR_UPDATE_GB_ONLY:
	case VMW_CURSOR_UPDATE_NONE:
		return 0;
	case VMW_CURSOR_UPDATE_MOB:
@@ -623,6 +626,7 @@ int vmw_cursor_plane_prepare_fb(struct drm_plane *plane,
		if (!surface || vps->cursor.legacy.id == surface->snooper.id)
			vps->cursor.update_type = VMW_CURSOR_UPDATE_NONE;
		break;
	case VMW_CURSOR_UPDATE_GB_ONLY:
	case VMW_CURSOR_UPDATE_MOB: {
		bo = vmw_user_object_buffer(&vps->uo);
		if (bo) {
@@ -737,6 +741,7 @@ void
vmw_cursor_plane_atomic_update(struct drm_plane *plane,
			       struct drm_atomic_state *state)
{
	struct vmw_bo *bo;
	struct drm_plane_state *new_state =
		drm_atomic_get_new_plane_state(state, plane);
	struct drm_plane_state *old_state =
@@ -762,6 +767,15 @@ vmw_cursor_plane_atomic_update(struct drm_plane *plane,
	case VMW_CURSOR_UPDATE_MOB:
		vmw_cursor_update_mob(dev_priv, vps);
		break;
	case VMW_CURSOR_UPDATE_GB_ONLY:
		bo = vmw_user_object_buffer(&vps->uo);
		if (bo)
			vmw_send_define_cursor_cmd(dev_priv, bo->map.virtual,
						   vps->base.crtc_w,
						   vps->base.crtc_h,
						   vps->base.hotspot_x,
						   vps->base.hotspot_y);
		break;
	case VMW_CURSOR_UPDATE_NONE:
		/* do nothing */
		break;
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ static const u32 __maybe_unused vmw_cursor_plane_formats[] = {
enum vmw_cursor_update_type {
	VMW_CURSOR_UPDATE_NONE = 0,
	VMW_CURSOR_UPDATE_LEGACY,
	VMW_CURSOR_UPDATE_GB_ONLY,
	VMW_CURSOR_UPDATE_MOB,
};

+5 −0
Original line number Diff line number Diff line
@@ -3668,6 +3668,11 @@ static int vmw_cmd_check(struct vmw_private *dev_priv,


	cmd_id = header->id;
	if (header->size > SVGA_CMD_MAX_DATASIZE) {
		VMW_DEBUG_USER("SVGA3D command: %d is too big.\n",
			       cmd_id + SVGA_3D_CMD_BASE);
		return -E2BIG;
	}
	*size = header->size + sizeof(SVGA3dCmdHeader);

	cmd_id -= SVGA_3D_CMD_BASE;
Loading