From patchwork Mon Mar 13 00:47:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Cheng X-Patchwork-Id: 68609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp950639wrd; Sun, 12 Mar 2023 18:23:48 -0700 (PDT) X-Google-Smtp-Source: AK7set+jSZDrSH+3uqgfrJEPy7roFT01+okWO7GV0m2dyU+dZSuGfwB82s/5F6CkhJuvONbBQwfB X-Received: by 2002:a17:902:d504:b0:19c:e842:a9e0 with SMTP id b4-20020a170902d50400b0019ce842a9e0mr14512264plg.16.1678670628145; Sun, 12 Mar 2023 18:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678670628; cv=none; d=google.com; s=arc-20160816; b=yUd7nNUYm8KXivoHUWv9uU+dNTz+fCpf6tq5cO2H+EfGDgoVh351BK6JMEqa357M9d A/YG2OA0G6rd08LFPQoUsKdhwzVWVDs7y0kX989sW+KwYgy6B7pMLEJ8yi+tMDqp+GOp Tuy5PdpRKbkYoeZTq5eqkfTe7F6ceQ4+96QLVqI7J/58JOAZL/4TbztFt+Xvgjq27TpV 5eigGeNEnheKoNlTo3iWVxYnVKvo1a1d8Se4yslU8LMsgiDDDAjaTPGScwMhFIRntUxO 7obr0nzeN4ENrF+xkr+3kPTailgzOV8iat0dSq2yjpnVficXmhRgTK/52zBsjzRei8Kt NqjQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=/Bkqs2R+3MEoIRL8QEDpEtBOS+h+4C4T2XbVTnOUNIg=; b=NWkUNtFfFLn8EpkC58R2sWyr5DcKfcjaKv5cMZ5c2zBtybWzFIxngnks7lHHfVTCTJ 7Y2QEsa0tna5Pf+odMc0D55iZCjG8sAm9f0dt0xIPg6cTWYMOA5F9PkkJYZVZUP9pLK1 pO3lGNv8XepdAn97vmtl7ZEoZwW93jin8vM9g051Sr/YlW1NVYvRpXmlBr2/A6lPkEdT km/iARSaCZ03YzJBvc8mbRzshMGyGOUdTc8ihQ/enQ7WATjGOogQJaYlxj5iCB57/Mx8 StXJzCbMVD1yU4N5fRLUAs+VlZ9arUFUCoqUCvheLLnY1o6/lW+e8hRWR3DWnIJaPGX8 2trg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bcheng.me header.s=key1 header.b=bxr9QXNh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bcheng.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pg6-20020a17090b1e0600b0023755d1a1e1si5782056pjb.28.2023.03.12.18.23.35; Sun, 12 Mar 2023 18:23:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bcheng.me header.s=key1 header.b=bxr9QXNh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bcheng.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbjCMA4O (ORCPT + 99 others); Sun, 12 Mar 2023 20:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbjCMA4N (ORCPT ); Sun, 12 Mar 2023 20:56:13 -0400 X-Greylist: delayed 394 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 12 Mar 2023 17:56:10 PDT Received: from out-32.mta1.migadu.com (out-32.mta1.migadu.com [95.215.58.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DEAD1EBF2 for ; Sun, 12 Mar 2023 17:56:10 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bcheng.me; s=key1; t=1678668571; 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; bh=/Bkqs2R+3MEoIRL8QEDpEtBOS+h+4C4T2XbVTnOUNIg=; b=bxr9QXNhiSQos5uqKZu0GBVkMhrXbMkeSYPTWHLSDYX64KIRQoLKNv5Ut6uyzjKbGPKAWT X7zZNhER8iYEkHYzuph7+7ASoIJE2FxML52sj2C8lII5zDS0CN0Sh4b0bujUdVkIGFBw/L fmu5he+ud07XsUw6ZkQQLCsef8WWcdG/j1MHLslkeLn180cCHrnf1ZurtOA9hOKoosdmYo 5MMg8yZdSNELkc+m/28uUYvz6fgxCeStHUfyTsiTFD0Wsc7RW/vl657oAgNcWPNiaatVNY LGTbsXLXOXjOg16gO+2dUFcCIFyD9DfFLd5gyeAEg8p/h/rj+4Z216MsT0h3dA== From: Benjamin Cheng To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Hamza Mahfooz Cc: Benjamin Cheng , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amd/display: Write to correct dirty_rect Date: Sun, 12 Mar 2023 20:47:39 -0400 Message-Id: <20230313004739.3110719-1-ben@bcheng.me> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760213732594887287?= X-GMAIL-MSGID: =?utf-8?q?1760213732594887287?= When FB_DAMAGE_CLIPS are provided in a non-MPO scenario, the loop does not use the counter i. This causes the fill_dc_dity_rect() to always fill dirty_rects[0], causing graphical artifacts when a damage clip aware DRM client sends more than 1 damage clip. Instead, use the flip_addrs->dirty_rect_count which is incremented by fill_dc_dirty_rect() on a successful fill. Fixes: 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support") Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2453 Signed-off-by: Benjamin Cheng --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 8af58bba503f..a89ec2cc4ffc 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5130,9 +5130,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane, for (; flip_addrs->dirty_rect_count < num_clips; clips++) fill_dc_dirty_rect(new_plane_state->plane, - &dirty_rects[i], clips->x1, - clips->y1, clips->x2 - clips->x1, - clips->y2 - clips->y1, + &dirty_rects[flip_addrs->dirty_rect_count], + clips->x1, clips->y1, + clips->x2 - clips->x1, clips->y2 - clips->y1, &flip_addrs->dirty_rect_count, false); return;