Message ID | 20231115131549.2191589-2-javierm@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2528755vqg; Wed, 15 Nov 2023 05:16:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQc0zg7gumr1t4OSL+A3UnzdrcB5E3Q2dxixeZP7d9wc4CsLEJDXg6+Hzk+0tiFo2khNES X-Received: by 2002:a05:6a20:1585:b0:15e:a653:fed5 with SMTP id h5-20020a056a20158500b0015ea653fed5mr15946744pzj.16.1700054197761; Wed, 15 Nov 2023 05:16:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700054197; cv=none; d=google.com; s=arc-20160816; b=ARryGshw/u3/iO4DpaxRHGw5Ezcs/DU1X84uIZbCNhaoejVaK7Jt0JWlIP1zegrCK8 Tp6WHVvKndQJjCJW1lL3/d/YnYMBye2xUp9Z7NO7CPt46B3b6XGC4ECUdOgnOh7jWybL Z22ZMsl9a/BuPVJ+3TI+CIl1aGRO5xdYl3Iq+4yQEfUEB/l0NPja3SiK/P1wXKyG5XC1 J/lDPu81EHbqGRyivCojPv+71DrT/IDSVAEIcMMtHeksLRS6w09AUXNTRlKy/z085c52 fh+HrO6OQdXOwQWXYXyzPl99d/MIExZDBSXpJTwupb+6MQEcjb1X5gycCsLjdbQGdPxi sqDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WdkCfOkpqSODFD3esOEEEI4uePJ2ewc8SQpEyHY/6Ls=; fh=/wxBBWRcZhphG6Qs5cmFsHgtJGiO/C2QeT9jB1iRC3U=; b=VPHAkSQdcUL+9rsuGiwZ2IkxhMH1isdZJwOp+tzaIMPG6FB8Zfond1UsHUhyv57HU1 0PitagPNtw+MGrvluqaYF/laYWoux2kwyLCXK0hd58glojzJhaYjNK2raLlURBYsid66 I9Mlo/W+VyCrtF0BDiQ64ave0HmmVcH44rb8W+FnIDmmZPEnKmzAPN/VNEBBpYS8LLy5 q16q/gFix/EwOG4bYmm5I8rJwdiZuYVBCOtCYgpT+ukaDOb4H/OW1EuZ8060PmLAdgRZ PjbJB3gx08DfFwWzR6iXeaa7c3fk21/MjGbdzeK3ZDXNNa5C1GUdNohCoJgf2h/Gc0YI xBrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="U6Z/n1p9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y25-20020a056a00181900b006c1222cac30si10140608pfa.193.2023.11.15.05.16.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:16:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="U6Z/n1p9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 525F58028FA7; Wed, 15 Nov 2023 05:16:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343901AbjKONQF (ORCPT <rfc822;heyuhang3455@gmail.com> + 28 others); Wed, 15 Nov 2023 08:16:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343883AbjKONQC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Nov 2023 08:16:02 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCB38121 for <linux-kernel@vger.kernel.org>; Wed, 15 Nov 2023 05:15:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700054158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WdkCfOkpqSODFD3esOEEEI4uePJ2ewc8SQpEyHY/6Ls=; b=U6Z/n1p9JiqDC6CIvylOv98blOLZil+5Sn44C/Bc1UnsV6Uv/mvGji5mqDQGzv2m6fbzLS lT8LefOSQ+/GsB++WOMHvDIVtNjNYomAprvbfiaZUD0j7DAOW4fLo+kjEVV0x7J1edAxQk kMsaIaDL1U9DM7PoYyD7blRkr+ZOlMA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-186-XOgwZ_QaOJi5G-tYXSK-Nw-1; Wed, 15 Nov 2023 08:15:57 -0500 X-MC-Unique: XOgwZ_QaOJi5G-tYXSK-Nw-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-40a5290e259so20789795e9.2 for <linux-kernel@vger.kernel.org>; Wed, 15 Nov 2023 05:15:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700054155; x=1700658955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WdkCfOkpqSODFD3esOEEEI4uePJ2ewc8SQpEyHY/6Ls=; b=JfuC6tUtB5+C+nrFGFJS0nFApWgv9b7OuJrmIRUQ2Ag8vDgvyMchbvlGsULCVsfQ5L pjq1H+BIQrQ+R2XyKJr0sC5uPl4mwG0LHw1xbwjrzADF49Fo5ZiU2x76QMWSLxVMB5nN qd0gVnuIwuGFx9S8CGZNz3eWXdSle4BSGKZlA7x5vUj5COKxTJacFvT37VHPhhbUpbz/ zMvmSkRRrTWZF8XwO9NN9sRwvK0zIxtd6/VY4ALpNq/IYU3HFtNQG3eZuEgeaOgzRzji Z+9uxdFkm4nwQXfINIym7fuvJi9mgjxNG3KxD1E4kbLd+vJ9vi9SL7YpsVHveXCdlTnA f2tQ== X-Gm-Message-State: AOJu0Yw8hAHlbZ/Vt4jTHxFE85VnOluN/aEZa7bSjsBiwq38Ragbmfzy vuoOM0rJzZoyQOW/SPYwl/WmxXbkmxwJq9LueB1AnuftioEojN+a1uyu6RjHg2yqCzKm0H3uRH9 vKJfWL+U7hnxxgiIAieBbEWIXCu0y09FoyF5bE7H1lZY5s5/0WxakXuAoc26yC+pg9Ywp51n0cT SbxPuC6QY= X-Received: by 2002:a05:600c:1d12:b0:40a:4429:a994 with SMTP id l18-20020a05600c1d1200b0040a4429a994mr9334056wms.28.1700054155096; Wed, 15 Nov 2023 05:15:55 -0800 (PST) X-Received: by 2002:a05:600c:1d12:b0:40a:4429:a994 with SMTP id l18-20020a05600c1d1200b0040a4429a994mr9334033wms.28.1700054154854; Wed, 15 Nov 2023 05:15:54 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id m16-20020a7bca50000000b0040841e79715sm14706785wml.27.2023.11.15.05.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:15:54 -0800 (PST) From: Javier Martinez Canillas <javierm@redhat.com> To: linux-kernel@vger.kernel.org Cc: Maxime Ripard <mripard@kernel.org>, Bilal Elmoussaoui <belmouss@redhat.com>, Simon Ser <contact@emersion.fr>, Erico Nunes <nunes.erico@gmail.com>, Pekka Paalanen <pekka.paalanen@collabora.com>, Thomas Zimmermann <tzimmermann@suse.de>, Sima Vetter <daniel.vetter@ffwll.ch>, Javier Martinez Canillas <javierm@redhat.com>, stable@vger.kernel.org, nerdopolis <bluescreen_avenger@verizon.net>, Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>, Gerd Hoffmann <kraxel@redhat.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/5] drm: Allow drivers to indicate the damage helpers to ignore damage clips Date: Wed, 15 Nov 2023 14:15:40 +0100 Message-ID: <20231115131549.2191589-2-javierm@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231115131549.2191589-1-javierm@redhat.com> References: <20231115131549.2191589-1-javierm@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 15 Nov 2023 05:16:29 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782636029970871097 X-GMAIL-MSGID: 1782636029970871097 |
Series |
drm: Allow the damage helpers to handle buffer damage
|
|
Commit Message
Javier Martinez Canillas
Nov. 15, 2023, 1:15 p.m. UTC
It allows drivers to set a struct drm_plane_state .ignore_damage_clips in
their plane's .atomic_check callback, as an indication to damage helpers
such as drm_atomic_helper_damage_iter_init() that the damage clips should
be ignored.
To be used by drivers that do per-buffer (e.g: virtio-gpu) uploads (rather
than per-plane uploads), since these type of drivers need to handle buffer
damages instead of frame damages.
That way, these drivers could force a full plane update if the framebuffer
attached to a plane's state has changed since the last update (page-flip).
Fixes: 01f05940a9a7 ("drm/virtio: Enable fb damage clips property for the primary plane")
Cc: <stable@vger.kernel.org> # v6.4+
Reported-by: nerdopolis <bluescreen_avenger@verizon.net>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218115
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
Changes in v2:
- Add a struct drm_plane_state .ignore_damage_clips to set in the plane's
.atomic_check, instead of having different helpers (Thomas Zimmermann).
drivers/gpu/drm/drm_damage_helper.c | 3 ++-
include/drm/drm_plane.h | 8 ++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_damage_helper.c b/drivers/gpu/drm/drm_damage_helper.c index d8b2955e88fd..afb02aae707b 100644 --- a/drivers/gpu/drm/drm_damage_helper.c +++ b/drivers/gpu/drm/drm_damage_helper.c @@ -241,7 +241,8 @@ drm_atomic_helper_damage_iter_init(struct drm_atomic_helper_damage_iter *iter, iter->plane_src.x2 = (src.x2 >> 16) + !!(src.x2 & 0xFFFF); iter->plane_src.y2 = (src.y2 >> 16) + !!(src.y2 & 0xFFFF); - if (!iter->clips || !drm_rect_equals(&state->src, &old_state->src)) { + if (!iter->clips || state->ignore_damage_clips || + !drm_rect_equals(&state->src, &old_state->src)) { iter->clips = NULL; iter->num_clips = 0; iter->full_update = true; diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index 79d62856defb..cc2e8fc35fd2 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h @@ -190,6 +190,14 @@ struct drm_plane_state { */ struct drm_property_blob *fb_damage_clips; + /** + * @ignore_damage_clips: + * + * Set by drivers to indicate the drm_atomic_helper_damage_iter_init() + * helper that the @fb_damage_clips blob property should be ignored. + */ + bool ignore_damage_clips; + /** * @src: *