Commit dbf35b4d authored by Simona Vetter's avatar Simona Vetter
Browse files

Merge tag 'drm-intel-next-2024-06-28' of...

Merge tag 'drm-intel-next-2024-06-28' of https://gitlab.freedesktop.org/drm/i915/kernel

 into drm-next

drm/i915 feature pull #2 for v6.11:

Features and functionality:
- More eDP Panel Replay enabling (Jouni)
- Add async flip and flip done tracepoints (Ville)

Refactoring and cleanups:
- Clean up BDW+ pipe interrupt register definitions (Ville)
- Prep work for DSB based plane programming (Ville)
- Relocate encoder suspend/shutdown helpers (Imre)
- Polish plane surface alignment handling (Ville)

Fixes:
- Enable more fault interrupts on TGL+/MTL+ (Ville)
- Fix CMRR 32-bit build (Mitul)
- Fix PSR Selective Update Region Scan Line Capture Indication (Jouni)
- Fix cursor fb unpinning (Maarten, Ville)
- Fix Cx0 PHY PLL state verification in TBT mode (Imre)
- Fix unnecessary MG DP programming on MTL+ Type-C (Imre)

DRM changes:
- Rename drm_plane_check_pixel_format() to drm_plane_has_format() and export
  (Ville)
- Add drm_vblank_work_flush_all() (Maarten)

Xe driver changes:
- Call encoder .suspend_complete() hook also on Xe (Imre)

Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/875xttazx2.fsf@intel.com
parents 62a05f4a 32a120f5
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -608,7 +608,6 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state,
	unsigned int fb_width, fb_height;
	struct drm_mode_rect *clips;
	uint32_t num_clips;
	int ret;

	/* either *both* CRTC and FB must be set, or neither */
	if (crtc && !fb) {
@@ -635,14 +634,12 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state,
	}

	/* Check whether this plane supports the fb pixel format. */
	ret = drm_plane_check_pixel_format(plane, fb->format->format,
					   fb->modifier);
	if (ret) {
	if (!drm_plane_has_format(plane, fb->format->format, fb->modifier)) {
		drm_dbg_atomic(plane->dev,
			       "[PLANE:%d:%s] invalid pixel format %p4cc, modifier 0x%llx\n",
			       plane->base.id, plane->name,
			       &fb->format->format, fb->modifier);
		return ret;
		return -EINVAL;
	}

	/* Give drivers some help against integer overflows */
+2 −4
Original line number Diff line number Diff line
@@ -789,12 +789,10 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
		 * case.
		 */
		if (!plane->format_default) {
			ret = drm_plane_check_pixel_format(plane,
							   fb->format->format,
							   fb->modifier);
			if (ret) {
			if (!drm_plane_has_format(plane, fb->format->format, fb->modifier)) {
				drm_dbg_kms(dev, "Invalid pixel format %p4cc, modifier 0x%llx\n",
					    &fb->format->format, fb->modifier);
				ret = -EINVAL;
				goto out;
			}
		}
+0 −2
Original line number Diff line number Diff line
@@ -272,8 +272,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
/* drm_plane.c */
int drm_plane_register_all(struct drm_device *dev);
void drm_plane_unregister_all(struct drm_device *dev);
int drm_plane_check_pixel_format(struct drm_plane *plane,
				 u32 format, u64 modifier);
struct drm_mode_rect *
__drm_plane_get_damage_clips(const struct drm_plane_state *state);

+20 −12
Original line number Diff line number Diff line
@@ -877,7 +877,16 @@ int drm_mode_getplane(struct drm_device *dev, void *data,
	return 0;
}

int drm_plane_check_pixel_format(struct drm_plane *plane,
/**
 * drm_plane_has_format - Check whether the plane supports this format and modifier combination
 * @plane: drm plane
 * @format: pixel format (DRM_FORMAT_*)
 * @modifier: data layout modifier
 *
 * Returns:
 * Whether the plane supports the specified format and modifier combination.
 */
bool drm_plane_has_format(struct drm_plane *plane,
			  u32 format, u64 modifier)
{
	unsigned int i;
@@ -887,25 +896,26 @@ int drm_plane_check_pixel_format(struct drm_plane *plane,
			break;
	}
	if (i == plane->format_count)
		return -EINVAL;
		return false;

	if (plane->funcs->format_mod_supported) {
		if (!plane->funcs->format_mod_supported(plane, format, modifier))
			return -EINVAL;
			return false;
	} else {
		if (!plane->modifier_count)
			return 0;
			return true;

		for (i = 0; i < plane->modifier_count; i++) {
			if (modifier == plane->modifiers[i])
				break;
		}
		if (i == plane->modifier_count)
			return -EINVAL;
			return false;
	}

	return 0;
	return true;
}
EXPORT_SYMBOL(drm_plane_has_format);

static int __setplane_check(struct drm_plane *plane,
			    struct drm_crtc *crtc,
@@ -924,12 +934,10 @@ static int __setplane_check(struct drm_plane *plane,
	}

	/* Check whether this plane supports the fb pixel format. */
	ret = drm_plane_check_pixel_format(plane, fb->format->format,
					   fb->modifier);
	if (ret) {
	if (!drm_plane_has_format(plane, fb->format->format, fb->modifier)) {
		DRM_DEBUG_KMS("Invalid pixel format %p4cc, modifier 0x%llx\n",
			      &fb->format->format, fb->modifier);
		return ret;
		return -EINVAL;
	}

	/* Give drivers some help against integer overflows */
@@ -964,7 +972,7 @@ bool drm_any_plane_has_format(struct drm_device *dev,
	struct drm_plane *plane;

	drm_for_each_plane(plane, dev) {
		if (drm_plane_check_pixel_format(plane, format, modifier) == 0)
		if (drm_plane_has_format(plane, format, modifier))
			return true;
	}

+22 −0
Original line number Diff line number Diff line
@@ -232,6 +232,28 @@ void drm_vblank_work_flush(struct drm_vblank_work *work)
}
EXPORT_SYMBOL(drm_vblank_work_flush);

/**
 * drm_vblank_work_flush_all - flush all currently pending vblank work on crtc.
 * @crtc: crtc for which vblank work to flush
 *
 * Wait until all currently queued vblank work on @crtc
 * has finished executing once.
 */
void drm_vblank_work_flush_all(struct drm_crtc *crtc)
{
	struct drm_device *dev = crtc->dev;
	struct drm_vblank_crtc *vblank = &dev->vblank[drm_crtc_index(crtc)];

	spin_lock_irq(&dev->event_lock);
	wait_event_lock_irq(vblank->work_wait_queue,
			    list_empty(&vblank->pending_work),
			    dev->event_lock);
	spin_unlock_irq(&dev->event_lock);

	kthread_flush_worker(vblank->worker);
}
EXPORT_SYMBOL(drm_vblank_work_flush_all);

/**
 * drm_vblank_work_init - initialize a vblank work item
 * @work: vblank work item
Loading