Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp833532rwb; Mon, 26 Sep 2022 06:29:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OaFeHWpk3t5obWvfHFowR3qCO8Y+ognGJCIkw+KE3Xb3CguYMdktmQD+PEFdWFAXNh4xR X-Received: by 2002:a17:907:7fa5:b0:781:4add:3a21 with SMTP id qk37-20020a1709077fa500b007814add3a21mr18576383ejc.267.1664198976021; Mon, 26 Sep 2022 06:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198976; cv=none; d=google.com; s=arc-20160816; b=Z5WBg7GJTBuKhtj3NqQ+DpNTWZmb9H9CUC7UdHOmr9onIoMayJy4YvWnO9wLhJnQs2 aogAYMS29mt7SrLsD8ypVGQeB89BndtXtiLvag09d73XEPsBJI96I+jmMN4f6F5ggpC3 GSwcVWWVcmjY8cA9wwlsHd1Xm2KBFkovHjAQUBvtd0JjEeOePxWH8KkPyR7KT9LaWSm5 3Fbitb95q12dDQ8SrnMBaDbIHQf5EOOxogKyQK8u+jDYQDg+UEfjw+zVof+0Gr5akrWP 23ZE+1osxO32f+2gN1MaaoxUlZ4FD9o8uDjaXMxpTXbGggVOpaAKg8UknoiuaGZqIPC3 fzvw== 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=O1NbleWBC25k5CH+z9/p2Tp9d4ieZ4BOe87FIuaeC1I=; b=tHvj6i8QSH1MOlSXyd/dsvGMuaiSj3YimIKQEBafBkUDefV0LLq7ZM9pgTMnN1A0oU 4ZHFt3faKb1/etIkPwQkCeDoOjYOmN/q4k3RsCW1OqBbCBe3QPWGh6HUFHC5pHCwakF3 fHQqpVPm1xlYkk2rMZQ8DdDFzuYCnvQggUi92uWhiwVBYAJAzpNLYo8CQOnnOCodG/tw jhoi/01Ehm/V7ouz/idncmB/QV5xMUx9sQwCVgFOrM646z7iUvKy03WUZeRfr9NUtKe/ jx8aw8d5JvshNj1MxG6TepRrs5fma1vaoF7sqesZaaGYR+A5OWUkwByOxD0W3izOB1eV 4RmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZLNKiRCi; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a170906794600b007417c6edb0asi16544167ejo.402.2022.09.26.06.29.10; Mon, 26 Sep 2022 06:29:36 -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=@linuxfoundation.org header.s=korg header.b=ZLNKiRCi; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235401AbiIZMZy (ORCPT + 99 others); Mon, 26 Sep 2022 08:25:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239513AbiIZMZS (ORCPT ); Mon, 26 Sep 2022 08:25:18 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58F52A7226; Mon, 26 Sep 2022 04:06:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 73191CE1123; Mon, 26 Sep 2022 10:51:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F23BC433D7; Mon, 26 Sep 2022 10:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189462; bh=ww4b36ztulCznsgn7FjuKot9ify6pm/HPOVFFydwAlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZLNKiRCi6NnrK0k2xCQ3w0vPucwzhM1K1vXNO+yJLMS35LeUstECymOlUn7zlHV57 9Wqzox/prQxBQDPhwgAFnkdNNTAVtJ5MA5FLtuhfM2ywGi3q46n04TfvLb1LnyfgHM XVoomzqzLRONb8GXX6m2nfvUM7HrMyfmXv1y1Hyk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arthur Marsh , Hamza Mahfooz , Alex Deucher , Sasha Levin Subject: [PATCH 5.19 195/207] drm/amdgpu: dont register a dirty callback for non-atomic Date: Mon, 26 Sep 2022 12:13:04 +0200 Message-Id: <20220926100815.331593360@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Alex Deucher [ Upstream commit abbc7a3dafb91b9d4ec56b70ec9a7520f8e13334 ] Some asics still support non-atomic code paths. Fixes: 66f99628eb2440 ("drm/amdgpu: use dirty framebuffer helper") Reported-by: Arthur Marsh Reviewed-by: Hamza Mahfooz Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 3451147beda3..0a8c15c3a04c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -494,6 +495,11 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector, static const struct drm_framebuffer_funcs amdgpu_fb_funcs = { .destroy = drm_gem_fb_destroy, .create_handle = drm_gem_fb_create_handle, +}; + +static const struct drm_framebuffer_funcs amdgpu_fb_funcs_atomic = { + .destroy = drm_gem_fb_destroy, + .create_handle = drm_gem_fb_create_handle, .dirty = drm_atomic_helper_dirtyfb, }; @@ -1071,7 +1077,10 @@ static int amdgpu_display_gem_fb_verify_and_init(struct drm_device *dev, if (ret) goto err; - ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs); + if (drm_drv_uses_atomic_modeset(dev)) + ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs_atomic); + else + ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs); if (ret) goto err; -- 2.35.1