From patchwork Wed Nov 15 13:15:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 165347 Return-Path: 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 + 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 ); 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 ; 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 ; 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 To: linux-kernel@vger.kernel.org Cc: Maxime Ripard , Bilal Elmoussaoui , Simon Ser , Erico Nunes , Pekka Paalanen , Thomas Zimmermann , Sima Vetter , Javier Martinez Canillas , stable@vger.kernel.org, nerdopolis , Daniel Vetter , David Airlie , Gerd Hoffmann , Maarten Lankhorst , 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 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: 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 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: # v6.4+ Reported-by: nerdopolis Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218115 Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas --- 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: * From patchwork Wed Nov 15 13:15:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 165348 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2528838vqg; Wed, 15 Nov 2023 05:16:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWyjsqUq/2nsLJ66Ub8SihL7R0wnFey3luBdC++moadP/ZtztiIaQvLS++Q+nLn440gSfo X-Received: by 2002:a17:902:e88e:b0:1c5:6157:f073 with SMTP id w14-20020a170902e88e00b001c56157f073mr5796598plg.11.1700054204356; Wed, 15 Nov 2023 05:16:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700054204; cv=none; d=google.com; s=arc-20160816; b=yICiMtbJ5d2udFX7+alAilqb9RrK/IiaqVkDM27C08q7Lefk5M4JYHpColbVNd9xHv Kh8Kt0ysn2xZzHm7Je5jD7kroH7LNEO3g07FIRg7/Ow7dD4FvpIjRNpbIwivI0+YkGnX 8phudGpUOkSGhxtL9LLlntaVNn8VOKpzfuS3TPv1V8aNEc1/f0nOfF0gbEF36TXZ/YIu o2+fdvcGCJFZ1RvnDDd1J8hMxKagPkZkaXQ162xMKX3zH7Sn9HkNWwOioF/GahPztRWJ CdqolM4L/Ga0nb5xanJxVkxQpPQ9UPS1QPIHrombntDNVbou3iPWCZJ1a7lWM94bHWwE gsug== 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=B8baLtlzsuyZcOKODOHaJ6HAGilgrqHGy9qmPbinQNI=; fh=gQH0gtQq4Wco3BHMNJntyI4cForNBL6LoHgScR6cMTc=; b=BB5VECXOTdidxMZYHh9bQIblBKmdW57FWVedc90Uhnk8y4wPGdy6AotqWtkberzKn8 nDA254WlWZ4Q7c7IB0pZ7Vy+3Nd77xm/p+StkFInU8PskuHtCuSRWMj6z/i7z132dRXP 5OxWTO0EqDcmq92lpp1lHnQ/roLci13Iew8z0ASUhUClfVZkPzNsJkE4OaC2Jp0mFIlo g/bpvrEVsRWmF/7LJ2nXGkF1HSv/AuXbXEgIKTAVeg5/HWJa40OX+5f1opzOogSwwGyg k6nB+TZ+ynMlpz0DZl/7b/Rb8FcVVfQCMS4hGe+P5QFbKoyHPEJZLSpYW4E7yZnQHuxt V6+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O86MNo8X; 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 p8-20020a170902bd0800b001cc41020674si9820497pls.518.2023.11.15.05.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:16:44 -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=O86MNo8X; 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 195008028F98; Wed, 15 Nov 2023 05:16:38 -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 S1343913AbjKONQJ (ORCPT + 28 others); Wed, 15 Nov 2023 08:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343852AbjKONQE (ORCPT ); Wed, 15 Nov 2023 08:16:04 -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 42B6A121 for ; Wed, 15 Nov 2023 05:16:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700054160; 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=B8baLtlzsuyZcOKODOHaJ6HAGilgrqHGy9qmPbinQNI=; b=O86MNo8XLmmMSWx7rTO83xbBvLRLPbDHCnqHqvFN/SUx75ZRwMFmX06T4YdBPnRzTI4S+L LqbdyVwtt+Rx0sW6Ohl5GsRKOBAFJbxdGpo5AbbSZI2n0c/eEep5PVUHuhuuFhDT85JJ+W uIlNo8+FAwGtqjYQt9zgbCKakpC/7Ro= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-fkBQZ8oZPQq7uZijr4kYDw-1; Wed, 15 Nov 2023 08:15:59 -0500 X-MC-Unique: fkBQZ8oZPQq7uZijr4kYDw-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-3314bd215ceso1455734f8f.2 for ; Wed, 15 Nov 2023 05:15:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700054157; x=1700658957; 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=B8baLtlzsuyZcOKODOHaJ6HAGilgrqHGy9qmPbinQNI=; b=mC9YcX02cLfCw0xyZbwrxEJVu1hNY68fxzHREbZ5xyrzz6ZyNuJtubhpDCipcjwLAs uqqBQJzl0lFXyxSzVXvHdDgRFB62cL8y9zgZS3d31+KnuxT8nM/4Y0iOopsANC/c6wXO tbn82YAmSW61UkE0vv+GY7IT2yg8wXqNG1x5sWA9hjQJ6vhouo8ANRszLytyfWSbK+mv jDJ/NmCHDdn67y2sUFtJK+M4PwdtRR9FOqSJSNMgqr+AfoA6Jo1vsHtTFqM7eoKae7Ka MqjugzCOhQqiYWSrRntg39lva0Bl7KRfCWyMw3Yu66d5svF9wZfo+AWLm5l5MfWk+kpa AuDQ== X-Gm-Message-State: AOJu0YwFBF6bfzJfKNOGSb2hSxA8F/Iy8xJ46J0nOUfnpKcTybdW2N1o ST2WtGDyHEETZtPr8gvOtttz4NmPVzTaQv+u9Bly+NEM1n8i1y48Oo9+1DiPP9VcCei5JNMeUoT Zf3XipzdlVlPZ+hZZt0NRbXq1axM8wvXmiBDyd7kCs6MkT3rqrZdi2herB48hyf34kt23K/Vuir TfQhLntes= X-Received: by 2002:a5d:6d89:0:b0:32f:7b14:89d9 with SMTP id l9-20020a5d6d89000000b0032f7b1489d9mr10958302wrs.9.1700054157156; Wed, 15 Nov 2023 05:15:57 -0800 (PST) X-Received: by 2002:a5d:6d89:0:b0:32f:7b14:89d9 with SMTP id l9-20020a5d6d89000000b0032f7b1489d9mr10958258wrs.9.1700054156678; Wed, 15 Nov 2023 05:15:56 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id h15-20020a5d548f000000b0032fbe5b1e45sm10507123wrv.61.2023.11.15.05.15.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:15:55 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Maxime Ripard , Bilal Elmoussaoui , Simon Ser , Erico Nunes , Pekka Paalanen , Thomas Zimmermann , Sima Vetter , Javier Martinez Canillas , stable@vger.kernel.org, nerdopolis , Chia-I Wu , Daniel Vetter , David Airlie , Gerd Hoffmann , Gurchetan Singh , Maarten Lankhorst , dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev Subject: [PATCH v2 2/5] drm/virtio: Disable damage clipping if FB changed since last page-flip Date: Wed, 15 Nov 2023 14:15:41 +0100 Message-ID: <20231115131549.2191589-3-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 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: 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:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782636037144939397 X-GMAIL-MSGID: 1782636037144939397 The driver does per-buffer uploads and needs to force a full plane update if the plane's attached framebuffer has change since the last page-flip. Fixes: 01f05940a9a7 ("drm/virtio: Enable fb damage clips property for the primary plane") Cc: # v6.4+ Reported-by: nerdopolis Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218115 Suggested-by: Sima Vetter Signed-off-by: Javier Martinez Canillas --- Changes in v2: - Set struct drm_plane_state .ignore_damage_clips in virtio-gpu plane's .atomic_check instead of using a different helpers (Thomas Zimmermann). drivers/gpu/drm/virtio/virtgpu_plane.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index a2e045f3a000..a1ef657eba07 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -79,6 +79,8 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane, { struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); + struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, + plane); bool is_cursor = plane->type == DRM_PLANE_TYPE_CURSOR; struct drm_crtc_state *crtc_state; int ret; @@ -86,6 +88,14 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane, if (!new_plane_state->fb || WARN_ON(!new_plane_state->crtc)) return 0; + /* + * Ignore damage clips if the framebuffer attached to the plane's state + * has changed since the last plane update (page-flip). In this case, a + * full plane update should happen because uploads are done per-buffer. + */ + if (old_plane_state->fb != new_plane_state->fb) + new_plane_state->ignore_damage_clips = true; + crtc_state = drm_atomic_get_crtc_state(state, new_plane_state->crtc); if (IS_ERR(crtc_state)) From patchwork Wed Nov 15 13:15:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 165349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2528962vqg; Wed, 15 Nov 2023 05:16:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmXHC6/WFIV2XwYyPsKxIC4uiogn/oTZBULG44/U7Sb8dKJkP45GQNWAdiEgGY/QlROJqP X-Received: by 2002:a05:6a00:8d82:b0:6c3:468c:6caa with SMTP id im2-20020a056a008d8200b006c3468c6caamr8459374pfb.6.1700054216402; Wed, 15 Nov 2023 05:16:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700054216; cv=none; d=google.com; s=arc-20160816; b=dCazZ0nh86upjkvKyuXk1mfAmdNOSO5aJ3k3BG+NgA0qNb2KzK1IAYoKZqX53nrNFC kwC0hOXv1TU348u2jvY3vCBdXgbB7GmuZ0lVxAotZNmFBAHJ3kiMnjgKyxznYWECdhh/ jCfTpeY9Fc9IsEXr4tiTveomHa9l7eF+oCSyeFRk6+QlsRAOf6kosyvCVnYqSRisOFJZ sZplM8eTUHCFFOt8DEZfEwIcvzOgfA9fFJCNaaiGplQ4YsLTL6QdeJHSpTq4proucFsT fFn/zc7DC8kDPMtvqI/O7RfoviNVLzyrncbp6QXy2QhpTgCd9WdKIk06hN9w7r0i0PjE 1Pow== 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=g4aNlMTSkF6Z7WtRPqPRRN4O3d3mqRlG6UdzSZTHX4Q=; fh=JZc7Ky9ybZKYkk2rLIZ6vPKMjoOupI/RfcJ0s/qyCHw=; b=d0XrJOoWUWJjaUvh/Gt2F1YG5ErtZfsrL3azHHS2VL6pgzik+p45aYfWLw1X6kzQ7K AGa57CX4v/ZuSZpnh8ds3r3ta0iGJeZEbCuLZ8XfKBsWCPZt2Zh+DYij/coKDQQMZHVO fjhmzpVD3oYwt0RWw++1O9n8RLEk4Z8XbyCynHgRapOTJVxr4hDi40WorGnV2srnBp0G J3R42MkeE4JnirmCIMAohzxYq9yo5gmU0OlfYhLW3MbPVVEdOCg2K/ArgfCIPetqQuFT 7kB4EnrV1mcW5ouQOq6jx9+W3Y8O6A78jr89bu0qNE4aYxE6N3rlGTgIzv/cQIU/tQBF yVOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zc6r4a5E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j7-20020a056a00234700b006bcf4cb2849si10172557pfj.154.2023.11.15.05.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:16:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zc6r4a5E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 1708B805DC05; Wed, 15 Nov 2023 05:16:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343937AbjKONQR (ORCPT + 28 others); Wed, 15 Nov 2023 08:16:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343905AbjKONQG (ORCPT ); Wed, 15 Nov 2023 08:16:06 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C1FE11D for ; Wed, 15 Nov 2023 05:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700054162; 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=g4aNlMTSkF6Z7WtRPqPRRN4O3d3mqRlG6UdzSZTHX4Q=; b=Zc6r4a5ELkoj29e+7WzDYM4gddcQRuATlVqetDnRFZZgI/Bth/MnbTt1/m1yBM7WvwWkvK FC2244qfuo5bNnNyURSFTE6QC5Q5RA8Lh29GoSDn49ce0nflDFQDBo0JEvivsfms9YVp1a lNYXkpCSaQo4uiylzn8+hwElSjUgmvA= 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-659-rcU_iRgZNAqTnCDQ5ps-Iw-1; Wed, 15 Nov 2023 08:16:01 -0500 X-MC-Unique: rcU_iRgZNAqTnCDQ5ps-Iw-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4084d08235fso43103385e9.3 for ; Wed, 15 Nov 2023 05:16:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700054159; x=1700658959; 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=g4aNlMTSkF6Z7WtRPqPRRN4O3d3mqRlG6UdzSZTHX4Q=; b=EivhpINEIiqbKLoN4ELOESxhMt5oL62Pb5mzFJZVegJZSHyJWVFw7tUXCZvmbS5QzJ Lq5xfrKKUPT4wu2P9Wm4qnSsIgchaVvkdlb9eooz3D8nDLxeoEj7WqOe+nZHmfWeoIdl r5lYtRjCh8JngDc7IT9SQQI6ZUdK7bLJlPRvvwvRuoYHbgUMeqw9N9zOha6rIBbQvuhb NPkJB0UzeEB5HxERZe3iUmnmXE7A7DxjFUhlzwJzCDkvjUYqOzCaaV4zK49KwIDIy8vn XSq9a9yEgQ1GAL8VJoCA8kqfNA8gCOxrlxjCw/Ljv3dflQlq2ETB9SlTJln3a8vAKi+P U/OA== X-Gm-Message-State: AOJu0YyyiCTOBVa5fd1RGDYI7/px/n5OE3xDrvtHBL/3PvG5iy7JHXFL bdy0KyztV4u51oGa29HFi8kAz3wY5oCxCS40gaMLL7GGvc/akc3A0QS2SdRKoqtsX9WNBDjZAI1 Tv5zcZ0wcSkgdUJz/wX1vbFuDsBjUImldOZYkpr3ERfxCRf32PRSbb1LE+2J/r3l8LxbfSdrndl hYw6gZGLs= X-Received: by 2002:a5d:49c4:0:b0:32d:bc6e:7f0d with SMTP id t4-20020a5d49c4000000b0032dbc6e7f0dmr8014903wrs.18.1700054159384; Wed, 15 Nov 2023 05:15:59 -0800 (PST) X-Received: by 2002:a5d:49c4:0:b0:32d:bc6e:7f0d with SMTP id t4-20020a5d49c4000000b0032dbc6e7f0dmr8014875wrs.18.1700054159031; Wed, 15 Nov 2023 05:15:59 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id n2-20020a5d4202000000b0032d886039easm10435546wrq.14.2023.11.15.05.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:15:57 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Maxime Ripard , Bilal Elmoussaoui , Simon Ser , Erico Nunes , Pekka Paalanen , Thomas Zimmermann , Sima Vetter , Javier Martinez Canillas , Daniel Vetter , David Airlie , Maarten Lankhorst , VMware Graphics Reviewers , Zack Rusin , dri-devel@lists.freedesktop.org Subject: [PATCH v2 3/5] drm/vmwgfx: Disable damage clipping if FB changed since last page-flip Date: Wed, 15 Nov 2023 14:15:42 +0100 Message-ID: <20231115131549.2191589-4-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 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 05:16:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782636050054982058 X-GMAIL-MSGID: 1782636050054982058 The driver does per-buffer uploads and needs to force a full plane update if the plane's attached framebuffer has change since the last page-flip. Suggested-by: Sima Vetter Signed-off-by: Javier Martinez Canillas --- Changes in v2: - Set struct drm_plane_state .ignore_damage_clips in vmwgfx plane's .atomic_check instead of using a different helpers (Thomas Zimmermann). drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 818b7f109f53..f9364bf222e3 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -837,10 +837,21 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, { struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); + struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, + plane); struct drm_crtc_state *crtc_state = NULL; struct drm_framebuffer *new_fb = new_state->fb; + struct drm_framebuffer *old_fb = old_state->fb; int ret; + /* + * Ignore damage clips if the framebuffer attached to the plane's state + * has changed since the last plane update (page-flip). In this case, a + * full plane update should happen because uploads are done per-buffer. + */ + if (old_fb != new_fb) + new_state->ignore_damage_clips = true; + if (new_state->crtc) crtc_state = drm_atomic_get_new_crtc_state(state, new_state->crtc); From patchwork Wed Nov 15 13:15:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 165350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2528964vqg; Wed, 15 Nov 2023 05:16:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3aQnG3BM0joh+m4M8bsHYyOF9APTz3Fl6+VkkOUT0NAuCFh07IlJleGMGCq31v/KqAdI3 X-Received: by 2002:a05:6a20:7487:b0:181:1fc8:c5de with SMTP id p7-20020a056a20748700b001811fc8c5demr12271369pzd.43.1700054216542; Wed, 15 Nov 2023 05:16:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700054216; cv=none; d=google.com; s=arc-20160816; b=ZRVJKVp7nYj4CNRa1FLAIMVhdyPP66RdOEaBiWYHGNKcD8/aR9lp+HloUXQTSEY9ad M17b9kgiWi9Aniv+VEYC7T/0hTJv13p2jXQ//0h3c/XeSiB4igWUjeL6mp02NLNtE1c8 W+SaloDt8Q3qEPyMHYO1DsiElD9V6MWQsQ12GybfmNvd+CJO1PE2jjpt2JL5eQC+aED0 ZGtFb19FxYqymsU7ibKuxlJHqb1w8n05j5ZcG8h2H6Tc2BHzrvYZiaw930h8Iju7QK2z 5piM+JJSh4ycq54dsKNWD6nNpH89AGhQkWS0ODrrkgg10+IE39lIWXkfJKwUjrMtZLWd swWw== 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=gJqsY2/QsCenwJh5W290HFz55lPASu6G1HsKVTRTOh0=; fh=tGsf10ucJ2B5OaNpa5GouuDrcirQ+5hSHtHjnOhQ82s=; b=wW6QI0PgD7iQOwwa4AIBXicCxNR4PPJZA/9b4eyTRiHETW4y3JF0oy09eAxwRuzM6F N5+UOHRHe1DS+nmKoxFB7saMOeTLBaF4ukYcSJmq8WwB/YYBUMY0IBqGp9YoUeDRH136 ubBdb0OOKpHVicXIWdKLyFIlKqiSAv6wSlHARcR0/55omuTGwxMJMWT9KIxuj6h2jw3q UxmX5RQ/hG2gD2xeiyjMaapWEUl/xedTsB4t9q7ppH+OwfyFHcF28tfdmpdx/g3g0z01 K5RC9LRrWKnG0OjoNXRJMKGXbI4/MLZZMKIx8VEHpZAFz/ikUPca7RohEWsglbhRrxuQ jN0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QsOIIPXj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bv187-20020a632ec4000000b005bd3cf5fd1esi9984509pgb.389.2023.11.15.05.16.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:16:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QsOIIPXj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id EAA03805AC03; Wed, 15 Nov 2023 05:16:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343883AbjKONQT (ORCPT + 28 others); Wed, 15 Nov 2023 08:16:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343919AbjKONQP (ORCPT ); Wed, 15 Nov 2023 08:16:15 -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 8DDF6130 for ; Wed, 15 Nov 2023 05:16:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700054164; 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=gJqsY2/QsCenwJh5W290HFz55lPASu6G1HsKVTRTOh0=; b=QsOIIPXjEcipN66sXOeLYx+r5AMXp54yxPFDeJjQj/AFNt6OWbZ1R1rwbUVDDI1CJww7+x bVCn9HvbUfpNv+9abZl0WreQaPo9zrJYeWd16hG/CXrTX7izGcCQgczhQok882q5z8bpFO pnEVh97aE7G23Da0xj/ZWxBeOFcvOQg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-178-Mtn23c1cOL-IJQryoFb6jg-1; Wed, 15 Nov 2023 08:16:03 -0500 X-MC-Unique: Mtn23c1cOL-IJQryoFb6jg-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-40839252e81so43567185e9.3 for ; Wed, 15 Nov 2023 05:16:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700054161; x=1700658961; 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=gJqsY2/QsCenwJh5W290HFz55lPASu6G1HsKVTRTOh0=; b=nR/JxvDLFteIicTQ9wZho4KNh46Z2VorlHX0hiZ/k5rALHla/c4D6njTC97k7E9aOO 2/ZlZnr1u5xreLWs52DUBDiuG1azYXRyjCALIzG3Efr+7v2z7GqnkzOnxl8lOTnp0/jO sH3gv/9siH20oCAiYkgdeg9I4uQAJdBCdVOsFYy5hUjHivLHIuHAeZAKP9EwoCxSkiEb GosTadLn6VftM2opF0w0hCioteRAkSECjlxFPpjNT1W0CHqZ4+QxAEWIkJ1t+oGu4vFr bWW4xhOGM9VW5akd/kH/6W4lMWt+pA36vw0ebpNc6t/MFhRquCEAzuiuKU2qMCRGUt0I LhKQ== X-Gm-Message-State: AOJu0Yz3M249KmvAYVjOYa+wSl3IB7zADAgLhOAD0sny6KQbkY+F8dJ+ iOzpHJMsZDh7i7KWSDHyUi/qJv7NSuujh1dFCoUS4qbGLUyJXgdoNQddwo+cgV6AJGVp5ki9SQ1 /tZn9tv5Tj3D+xzBNsA+lc6QeSwzcfpndJqIaC94ItzOdd094jTZiWqPDaNicUZfGUkO2uf7mH8 YRB+BcuyQ= X-Received: by 2002:a05:600c:4fd2:b0:408:434c:dae7 with SMTP id o18-20020a05600c4fd200b00408434cdae7mr11319529wmq.2.1700054161330; Wed, 15 Nov 2023 05:16:01 -0800 (PST) X-Received: by 2002:a05:600c:4fd2:b0:408:434c:dae7 with SMTP id o18-20020a05600c4fd200b00408434cdae7mr11319502wmq.2.1700054161047; Wed, 15 Nov 2023 05:16:01 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id z10-20020a05600c0a0a00b00405959bbf4fsm15025163wmp.19.2023.11.15.05.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:16:00 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Maxime Ripard , Bilal Elmoussaoui , Simon Ser , Erico Nunes , Pekka Paalanen , Thomas Zimmermann , Sima Vetter , Javier Martinez Canillas , Daniel Vetter , David Airlie , Maarten Lankhorst , dri-devel@lists.freedesktop.org Subject: [PATCH v2 4/5] drm/plane: Extend damage tracking kernel-doc Date: Wed, 15 Nov 2023 14:15:43 +0100 Message-ID: <20231115131549.2191589-5-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 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 05:16:33 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782636050070870535 X-GMAIL-MSGID: 1782636050070870535 The "Damage Tracking Properties" section in the documentation doesn't have info about the two type of damage handling: frame damage vs buffer damage. Add it to the section and mention that helpers only support frame damage, and how drivers handling buffer damage can indicate that the damage clips should be ignored. Also add references to further documentation about the two damage types. Suggested-by: Simon Ser Signed-off-by: Javier Martinez Canillas Reviewed-by: Simon Ser --- - Dropped Simon Ser's Reviwed-by tag because the text changed to adapt to the approach Thomas Zimmermann suggested for v2. (no changes since v1) drivers/gpu/drm/drm_plane.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 24e7998d1731..3b1b8bca3065 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -1442,6 +1442,26 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, * Drivers implementing damage can use drm_atomic_helper_damage_iter_init() and * drm_atomic_helper_damage_iter_next() helper iterator function to get damage * rectangles clipped to &drm_plane_state.src. + * + * Note that there are two types of damage handling: frame damage and buffer + * damage. The type of damage handling implemented depends on a driver's upload + * target. Drivers implementing a per-plane or per-CRTC upload target need to + * handle frame damage while drivers implementing a per-buffer upload target + * need to handle buffer damage. + * + * The existing damage helpers only support the frame damage type, there is no + * buffer age support or similar damage accumulation algorithm implemented yet. + * + * Only drivers handling frame damage can use the mentiored damage helpers to + * iterate over the damaged regions. Drivers that handle buffer damage, need to + * set &struct drm_plane_state.ignore_damage_clips as an indication to + * drm_atomic_helper_damage_iter_init() that the damage clips should be ignored. + * In that case, the returned damage rectangle is the &drm_plane_state.src since + * a full plane update should happen. + * + * For more information about the two type of damage, see: + * https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_swap_buffers_with_damage.txt + * https://emersion.fr/blog/2019/intro-to-damage-tracking/ */ /** From patchwork Wed Nov 15 13:15:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 165351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2528983vqg; Wed, 15 Nov 2023 05:16:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMRTTGCS/6JfGqKWDuxmYjE7qayhxcBa7w9TQ10oDS+uSgeEgHLpufVNKnobmysmoH5+tA X-Received: by 2002:a05:6a21:6d8d:b0:187:185f:1dbe with SMTP id wl13-20020a056a216d8d00b00187185f1dbemr5957762pzb.11.1700054218911; Wed, 15 Nov 2023 05:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700054218; cv=none; d=google.com; s=arc-20160816; b=LwKquNQs6uNkDJSOa3YjYoK+r5QvSrg3TUEWExyrYorbmaGroCrDc8/GH86duuqDgq SK8dLQ6AeB1J9DCexM6MtdfxnpR9Oj+tl1/EW4zqknEYEjBzO/X8OsIDuXJOIYER4q65 7yeHKmrci2SlYhP8Gazv0FduyMcUdpnDMVCtEnW6Ky/UbIG6pRCgtwHIkYy9xmzg5J7b UkauX8p6XL9W44BfcyrQcAO02tWFuR2ALBDXTbkKqhCxSUuzW8yWfvO+AereOrW/PGGv 4DeEGCw+Vp7kLH2Alow/DZ8yKbej0YE+lclsiP1QZqac2qJbEN/6G5MEbCcEvml0AV/P DDOw== 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=LPNZAc6r0CSSO6lMN8bwDAougMdgFH11dwZvW1JyD1g=; fh=YfcV4OXQakDcgWyVZUHjmOcBUz+M6Xm7CEKoHWiy7MU=; b=cdvh6P/mj5Z0pezTGUdx+gmlCRVCQNFa5rSTHwU+ZD4lAzWYd5xQF/ISjsC9agqeCd Dbyr2AUUIcLvTwoHMu12xLnF0AenE7ELG8BB6HCskmlhC856/Vp/36q0Kpmq6MhWklXQ WiYkuZtBVJqNDfImRHzx6xmG+iSVx44kX4KJgcexBqb0NfIW1kQ7M1gUzO7bBNLdrk+H OKwhv0G1V+vp/ZbghbwPA6Am05PgPCAIo/B+qqdBadgGGYb453LzUcTGErdNW4Ae6F+r Y9Zg2K5rob491aOPrJQAbp963lNhtlVyxAZfMuEYUiL9tzkSigrzIQPJnWVAGQiCCqPZ m1SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="UdAR/0iF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bi5-20020a056a02024500b00573f885c4easi11207296pgb.753.2023.11.15.05.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:16:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="UdAR/0iF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 3B96C8194742; Wed, 15 Nov 2023 05:16:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343967AbjKONQW (ORCPT + 28 others); Wed, 15 Nov 2023 08:16:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343926AbjKONQP (ORCPT ); Wed, 15 Nov 2023 08:16:15 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C091F189 for ; Wed, 15 Nov 2023 05:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700054167; 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=LPNZAc6r0CSSO6lMN8bwDAougMdgFH11dwZvW1JyD1g=; b=UdAR/0iFW/NySxhyhm8uHp+xGalEE8pKj+ty8VpJGl3j3CLO52a+XpLb4gPW+oaiN8x96l iuLdPUBGKs7iDhceWMnzdvCZ10ohrPqO9nUx56MXuqG55ybcktEAbeSzwORozfp5sfb+FE vtXlzbOgsxbfFNrnmnny3VgcIHvMUvE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-625-5B9X58hIORykrwvdxA0t0Q-1; Wed, 15 Nov 2023 08:16:05 -0500 X-MC-Unique: 5B9X58hIORykrwvdxA0t0Q-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-32f8cb825c5so3204285f8f.2 for ; Wed, 15 Nov 2023 05:16:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700054163; x=1700658963; 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=LPNZAc6r0CSSO6lMN8bwDAougMdgFH11dwZvW1JyD1g=; b=WXbd/LYEzAegze9YJ8I8jGvnnvKTlS6HcJriqBP1djeQYS+5ccVjunua8FHqMSaZ3c 1IpkPlyJ4qvkNS2FYwif2e2Iisq1WB4/Ol3n4/OMdWBwhDequoCWOQwg/UvOUKbiN7QH eeMqtsQntii2lfV4vfBU5Bo3ReJWcFWdQNXL45AHN2HXZtrPMhfU/KP4iY7rWfKoO4GR g/ZGfeUnxpye7gBm13g33nxvdRRQ7wnB6+bdNsZYht0IClTmAfWLXXkRtYv7uJnggHpm +D7adeq1CLGcVlbHt8wp8EB1tee5n6y1vGpRbWA/OtQ8m9tlatV7UZFvzISs6CrrccaS olKw== X-Gm-Message-State: AOJu0YwQJdM6XxI3QusAwuVyy3PJq7txx2wiGQsv73sALDXPISdq8be+ 7pJNUBZFnmvFXQ3zZ1RrwEwgtk9tZQAdOGGszsLFUCPJXtuARdfmi+a9xTSJzj0jvHHlCQ2hcgX CZv6Uqrzw1yAJkKSAxx7fx8JloSYkc70Wo8MdiCpuCfmPa9z24aNrAKRe1cq2/h5DYpg0VJVAwE MEUOBzitA= X-Received: by 2002:a5d:6b8f:0:b0:331:4e5e:d9e7 with SMTP id n15-20020a5d6b8f000000b003314e5ed9e7mr5201145wrx.34.1700054163387; Wed, 15 Nov 2023 05:16:03 -0800 (PST) X-Received: by 2002:a5d:6b8f:0:b0:331:4e5e:d9e7 with SMTP id n15-20020a5d6b8f000000b003314e5ed9e7mr5201118wrx.34.1700054163127; Wed, 15 Nov 2023 05:16:03 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id b1-20020a5d6341000000b00323293bd023sm10579306wrw.6.2023.11.15.05.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:16:02 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Maxime Ripard , Bilal Elmoussaoui , Simon Ser , Erico Nunes , Pekka Paalanen , Thomas Zimmermann , Sima Vetter , Javier Martinez Canillas , Daniel Vetter , David Airlie , Jonathan Corbet , Maarten Lankhorst , dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org Subject: [PATCH v2 5/5] drm/todo: Add entry about implementing buffer age for damage tracking Date: Wed, 15 Nov 2023 14:15:44 +0100 Message-ID: <20231115131549.2191589-6-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 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 05:16:40 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782636052675472539 X-GMAIL-MSGID: 1782636052675472539 Currently, only damage tracking for frame damage is supported. If a driver needs to do buffer damage (e.g: the framebuffer attached to plane's state has changed since the last page-flip), the damage helpers just fallback to a full plane update. Add en entry in the TODO about implementing buffer age or any other damage accumulation algorithm for buffer damage handling. Suggested-by: Simon Ser Signed-off-by: Javier Martinez Canillas Reviewed-by: Simon Ser --- (no changes since v1) Documentation/gpu/todo.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index b62c7fa0c2bc..5c43a958814b 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -782,6 +782,26 @@ Contact: Hans de Goede Level: Advanced +Buffer age or other damage accumulation algorithm for buffer damage handling +============================================================================ + +Drivers that do per-buffer uploads, need a buffer damage handling (rather than +frame damage like drivers that do per-plane or per-CRTC uploads), but there is +no support to get the buffer age or any other damage accumulation algorithm. + +For this reason, the damage helpers just fallback to a full plane update if the +framebuffer attached to a plane has changed since the last page-flip. + +This should be improved to get damage tracking properly working on drivers that +do per-buffer uploads. + +More information about damage tracking and references to learning materials in +`Damage Tracking Properties `_ + +Contact: Javier Martinez Canillas + +Level: Advanced + Outside DRM ===========