From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EADD2606A32D for ; Thu, 3 Dec 2026 15:49:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=I4+tzTCc Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AAEA4112A0C; Thu, 3 Dec 2026 15:49:50 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id C8073112A0B; Thu, 3 Dec 2026 15:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796312985; x=1827848985; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=ASJZJyFfPO3jn+KiBJ76XYiSqOD1KHJHN7KWtK9+m1A=; b=I4+tzTCcs3x+n564PV2EUt4hgRkwiM9mpDM1bQbyo/2Wrxtbx/jsipyA Llai3Bm5OF6ZZyMBCcYPMUgG0smClxRjS1KS1tx+DUnsMwsvi6yhitrh0 NndVhiGJuSLwtyRIVSIu7sZxtyUb1IsSpwsCWOsOIp9SKmyLEVMX84lBM EX/6kN3X5BYYmHgOVTov7XyTW4Em97D3nOXSoUycBlb1Umt/kjKNnIwqi T3s/UH4+avKH/mZQfNR1o+m3Cx1b8mcvGQu6UO+9Gh8LPZdLnYTE5sovM Ofgrq2+H426VRtUh3dM8inY2mfMFTbhYs6vS9hgi+gum5/9K59KE3besg Q==; X-CSE-ConnectionGUID: 6yobkuIYRXeCKTyT/A+hog== X-CSE-MsgGUID: zikQsZg7SYyW2TwW8chkJQ== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5198006" X-IronPort-AV: E=Sophos;i="6.29,248,1794902400"; d="scan'208";a="5198006" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 07:49:44 -0800 X-CSE-ConnectionGUID: z896zMIBTbqBCpidjjatuw== X-CSE-MsgGUID: VtAz33O8TI6Ui4TiZmptNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,248,1794902400"; d="scan'208";a="14082032" Received: from abityuts-desk1.ger.corp.intel.com (HELO localhost) ([10.245.244.117]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 07:49:40 -0800 Date: Thu, 3 Dec 2026 17:49:36 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Thomas Zimmermann Cc: ville.syrjala@intel.com, rodrigo.vivi@intel.com, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, tursulin@ursulin.net, airlied@gmail.com, simona@ffwll.ch, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, sashiko-reviews@lists.linux.dev, Javier Martinez Canillas Subject: Re: [PATCH RESEND v3] drm/i915/display: Handle struct drm_plane_state.ignore_damage_clips Message-ID: References: <20261124084108.528317-1-tzimmermann@suse.de> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261124084108.528317-1-tzimmermann@suse.de> X-Patchwork-Hint: comment Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-xe" X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Tue, Nov 24, 2026 at 09:40:01AM +0100, Thomas Zimmermann wrote: > Call drm_atomic_helper_check_plane_damage() in plane_atomic_check() > before copying the damage information to guarantees that ignore_damage_clips > from struct drm_plane_state has the correct value. Although i915 does not > directly modify or use the flag, DRM's damage iterator will soon rely on > it. > > As a side effect, if the CRTC has been marked for a full modeset before > the call to drm_atomic_helper_check_plane_damage() happens, the plane now > ignores all damage clips and does a full update. > > Git commit 35ed38d58257 ("drm: Allow drivers to indicate the damage > helpers to ignore damage clips") introduced ignore_damage_clips to > selectively ignore damage clipping for certain framebuffer changes. The > mode-setting pipeline can disabled damage clippings for an atomic commit > by setting ignore_damage_clips in struct drm_plane_state. The atomic > commit will then do a full display update. > > Future directions: there's currently a multitude of options that affect > damage clipping; with different places seeing different state. In order > to unify this, drm_atomic_helper_check_plane_state() will soon evaluate > all options in a single place and set ignore_damage_clips accordingly. All > later stages of the mode-setting pipeline will only look at this field. > > v3: > - fix the call to drm_atomic_helper_check_plane_state() > - use primary-CRTC's plane state (Sashiko) > - note full-plane updates in commit description > v2: > - move _check_plane_damage() before reading damage first time (Sashiko) > - expand commit description > > Signed-off-by: Thomas Zimmermann > Reviewed-by: Javier Martinez Canillas > --- > drivers/gpu/drm/i915/display/intel_plane.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_plane.c b/drivers/gpu/drm/i915/display/intel_plane.c > index d23de0f34e4b..058e92f383e4 100644 > --- a/drivers/gpu/drm/i915/display/intel_plane.c > +++ b/drivers/gpu/drm/i915/display/intel_plane.c > @@ -955,7 +955,7 @@ static int plane_atomic_check(struct intel_atomic_state *state, > intel_atomic_get_new_plane_state(state, plane); > const struct intel_plane_state *old_plane_state = > intel_atomic_get_old_plane_state(state, plane); > - const struct intel_plane_state *new_primary_crtc_plane_state; > + struct intel_plane_state *new_primary_crtc_plane_state; > const struct intel_plane_state *old_primary_crtc_plane_state; > struct intel_crtc *crtc = intel_crtc_for_pipe(display, plane->pipe); > const struct intel_crtc_state *old_crtc_state = > @@ -978,6 +978,14 @@ static int plane_atomic_check(struct intel_atomic_state *state, > old_primary_crtc_plane_state = old_plane_state; > } > > + /* > + * Prepare plane-damage state before using it; do this on all > + * display versions to keep the underlying DRM plane state in > + * good shape. > + */ > + drm_atomic_helper_check_plane_damage(&state->base, > + &new_primary_crtc_plane_state->uapi); This seems to be making assumptions about what the hardware/driver aims to do with the damage. And we don't even know yet whether a full modeset is going to happen or not, so this more or less just adding checks that we anyway have to repeat later. I also really dislike the fact that the helper is now messing with the actual uapi provided blob. IMO nothing but the direct uapi facing code should ever mutate the uapi state. In general I think the entire damage helper is rather overengineered. All we really want is a trivial for_each_damage_rect drm_rect_union() to get the full uapi damage, and then we can do with it as we wish. I have a local branch where I'm rewriting our PSR selective fetch stuff and there I used just such a simple approach. So, I suspect this wouldn't actually break anything, but it's not really doing anything useful either. And as mentioned I think the "mutate the uapi state in the helper" approach is very wrong. > + > intel_plane_copy_uapi_plane_damage(new_plane_state, > old_primary_crtc_plane_state, > new_primary_crtc_plane_state); > > base-commit: 401a3e7b64d174c4f2b256b035de716c7b79bdc1 > -- > 2.56.1 -- Ville Syrjälä Intel