Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5036001pxb; Mon, 15 Feb 2021 07:55:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwL8sGiK+V3uY6sjaMTw6zIcbSUiKIsi7O+VAmO9HwaYKgA6CXbzD6wa/0belsiCFGSKYZN X-Received: by 2002:a17:906:7d9:: with SMTP id m25mr15947676ejc.473.1613404552286; Mon, 15 Feb 2021 07:55:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613404552; cv=none; d=google.com; s=arc-20160816; b=H7nSzYKTx2ChgbRYktx20xnZHkWaxKci7Td9FzcfOVecl751/2+Mgldc0jXckiTbbo nnE2SJVegbRro7lfje4j7SDYiYMTD+SCGNuhEq8sRpQnK191ymfRNQjfX1KZPzTKOhWM Pe6sbcGEy8wOGte8VQgI66FoebF2wz1UdMF/B4AtmSCIXu/g2+AKUqKRk282aOnRangO C2g7cGRHybUp7wUSQIiWrHDwqoeGNz44xcl2ce0MMpyt4pmfZDFASN37B4Tb6iJ4Fp5w jqELdhnB6aS9L5EG1juka9Lutf9B1992TDYjZZTdKv1tCSbBNw4WSVxP3x0laPlsqNm1 4hkA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uNZVfxOBuThhzMDlMJcMAyv+Eu+/vtXYgagWHBTv2DU=; b=Tv7SHWc/AvGXLiN6HhaJxpvIjLN9SVmcLhPQNbdUGT3s290hzj5u7Xk1dBZPWD8qiS WmC1vgMZChckvMWz85Q57gTAdsonC6fdeP/l+T6W6jC0Y5o19g0Lo0kuHrk2JiKsIm5M w+EbsFIadQcZXdwynuUzK+oNsP8+e/XSQmVpUf8yllGj9Jl0mQE8fQGu3Bxd3y+ezlvA Y3YrHM7whf5HHd7kQJMljRSekHQ6/5Wk8P3Juecf840+4bLMlySVfL9KC5yndJdSaa0L Vmlnhh0hjh+2Fspsr/DKAVUgb7UGyNSIPFbtMnqW+XKXZIPeI0I2qXX8Rvc78q4NndL/ 86jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ymrciRxW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pw11si12459370ejb.270.2021.02.15.07.55.29; Mon, 15 Feb 2021 07:55:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ymrciRxW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231704AbhBOPy1 (ORCPT + 99 others); Mon, 15 Feb 2021 10:54:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:46648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbhBOPcg (ORCPT ); Mon, 15 Feb 2021 10:32:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3AAAB64EA1; Mon, 15 Feb 2021 15:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403006; bh=tQDgRxccZT0w5FpWpcu44zNGlL5L0CwpxUugW1uxiOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ymrciRxWN17TcCZyNmPnhHQ4Pc8ycVjuh+nz5y8vxAZXpEIaggGjR7ccck1B+VH8/ 7uR78AGha4s2wSFbGhozCpjCg811At/EaagctgfLJdl+mePqKnGzT8CSJqXWgbVnmY +HT1PAySbzJbx7SBkTVDz1F/AmH6x3c8XfAf2nS4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Victor Lu , Roman Li , Anson Jacob , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 5.4 17/60] drm/amd/display: Free atomic state after drm_atomic_commit Date: Mon, 15 Feb 2021 16:27:05 +0100 Message-Id: <20210215152715.926381087@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152715.401453874@linuxfoundation.org> References: <20210215152715.401453874@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Victor Lu [ Upstream commit 2abaa323d744011982b20b8f3886184d56d23946 ] [why] drm_atomic_commit was changed so that the caller must free their drm_atomic_state reference on successes. [how] Add drm_atomic_commit_put after drm_atomic_commit call in dm_force_atomic_commit. Signed-off-by: Victor Lu Reviewed-by: Roman Li Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 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 3671b3e8f69d8..b4da8d1e4fb87 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6463,14 +6463,14 @@ static int dm_force_atomic_commit(struct drm_connector *connector) ret = PTR_ERR_OR_ZERO(conn_state); if (ret) - goto err; + goto out; /* Attach crtc to drm_atomic_state*/ crtc_state = drm_atomic_get_crtc_state(state, &disconnected_acrtc->base); ret = PTR_ERR_OR_ZERO(crtc_state); if (ret) - goto err; + goto out; /* force a restore */ crtc_state->mode_changed = true; @@ -6480,17 +6480,15 @@ static int dm_force_atomic_commit(struct drm_connector *connector) ret = PTR_ERR_OR_ZERO(plane_state); if (ret) - goto err; - + goto out; /* Call commit internally with the state we just constructed */ ret = drm_atomic_commit(state); - if (!ret) - return 0; -err: - DRM_ERROR("Restoring old state failed with %i\n", ret); +out: drm_atomic_state_put(state); + if (ret) + DRM_ERROR("Restoring old state failed with %i\n", ret); return ret; } -- 2.27.0