Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3392477imc; Wed, 13 Mar 2019 17:21:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBYFtKjqpW5/ZwKMiUELyrzQ+5gDC7+/nQHt+Zg+KFcQZtLkaIK0+XQITI165zvDx1aD2m X-Received: by 2002:a63:c64c:: with SMTP id x12mr42740572pgg.285.1552522907991; Wed, 13 Mar 2019 17:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552522907; cv=none; d=google.com; s=arc-20160816; b=1JlxMW+mASIP/olyN+l+w1gRJyE73N6uPvyHik+/DCj4wHtY9r+5fPz04dAlqmS0vg mUqB30y3D8CpWU1LoTTxQT5JfZydMGfgavm2a8vHhQha0HDrz9YFBdCt/FRFeC7uQcB+ mccF8bjwr9S+fPqWR6HKvDRUWQ1OqxY8tAOImuoORomEKy5w51UFwQ7MWeC5aSCuJ4aD Kpk9VqIZb0ZtxAdlD1JBO0CrFDpmefyJ+Cqgo1Nk6iryNpBiKH7Yx5ul2l6o4Q3VLRaR EK2D4mu6714jngxue4l3txl9gKWQqk6QPNbiwVe63Cddeb9DrYSzmVvN5fymzf/4NEdO tqow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=UuXArLYB1uXXU2C+xSy44nOI9zMTCp9/NBUoPA+vJBk=; b=ek2kUGqV/TyHNnAuI33ZArleWbfF2a6BIaCt2DxGKFCv0/Ep+GiDfjnlg0jSfWZC/j flHzImDsuc0jG7TUX3S90IdRg1gB6HlDUAK/wl+udsVtCUIYIhjEr12MWvaTlV6rzYaj Gsg9nVwP9BJiFEdlHulQdY2G/FOIE67q+WDQtytmtE6eylazQ01wOJ7ztrpckQwf5y8+ z33HS0mDMdMbRbAH73VgvuxRsuSN+HiQIZ8jDi8uYkZw36yanqI9bVlFBhQgejTVZrZB GF1m5/xn/9mgNtASY1NET4DyJ3zc/9vA79RyuOkpLGqP/w5WYxhOrIfOoV7/F/QsjOyi fXiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si11863796plp.406.2019.03.13.17.21.32; Wed, 13 Mar 2019 17:21:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727197AbfCNAVD (ORCPT + 99 others); Wed, 13 Mar 2019 20:21:03 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38140 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726640AbfCNAVC (ORCPT ); Wed, 13 Mar 2019 20:21:02 -0400 Received: from localhost.localdomain (unknown [IPv6:2804:431:9719:798c:867b:ebff:fe52:de60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: koike) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 6AFB8281457; Thu, 14 Mar 2019 00:20:55 +0000 (GMT) From: Helen Koike To: dri-devel@lists.freedesktop.org, nicholas.kazlauskas@amd.com Cc: andrey.grodzovsky@amd.com, daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org, Tomasz Figa , boris.brezillon@collabora.com, David Airlie , Sean Paul , kernel@collabora.com, harry.wentland@amd.com, =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Helen Koike , Leo Li , David Francis , Mikita Lipski , "David (ChunMing) Zhou" , Anthony Koo , amd-gfx@lists.freedesktop.org, Alex Deucher , Bhawanpreet Lakha , =?UTF-8?q?Christian=20K=C3=B6nig?= , Daniel Vetter Subject: [PATCH v3 2/5] drm/amd: fix fb references in async update Date: Wed, 13 Mar 2019 21:20:23 -0300 Message-Id: <20190314002027.7833-3-helen.koike@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190314002027.7833-1-helen.koike@collabora.com> References: <20190314002027.7833-1-helen.koike@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Async update callbacks are expected to set the old_fb in the new_state so prepare/cleanup framebuffers are balanced. Calling drm_atomic_set_fb_for_plane() (which gets a reference of the new fb and put the old fb) is not required, as it's taken care by drm_mode_cursor_universal() when calling drm_atomic_helper_update_plane(). Suggested-by: Boris Brezillon Signed-off-by: Helen Koike Reviewed-by: Nicholas Kazlauskas --- Changes in v3: None Changes in v2: - added reviewed-by tag drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-- 1 file changed, 1 insertion(+), 2 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 2f26581b93ff..ce4ccd28ac5e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3760,8 +3760,7 @@ static void dm_plane_atomic_async_update(struct drm_plane *plane, struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(new_state->state, plane); - if (plane->state->fb != new_state->fb) - drm_atomic_set_fb_for_plane(plane->state, new_state->fb); + swap(plane->state->fb, new_state->fb); plane->state->src_x = new_state->src_x; plane->state->src_y = new_state->src_y; -- 2.20.1