From patchwork Tue Dec 29 21:10:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Zhan" X-Patchwork-Id: 11992617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D7B4C433E6 for ; Tue, 29 Dec 2020 21:11:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3894621D1B for ; Tue, 29 Dec 2020 21:11:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3894621D1B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C68489232; Tue, 29 Dec 2020 21:11:01 +0000 (UTC) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2064.outbound.protection.outlook.com [40.107.236.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4932F89231; Tue, 29 Dec 2020 21:10:59 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gg3h0DbDaboQtyG4SD25xBXl4q9R03ayJqpTRu08CuoxWM2W5TjZ11+zl+dW/V5ymuyy9bLOkwQ2LPnLgbOabBruOkajF3xGtwgM34giTCwNM7lpQufs4OL8pGDvmLpvBauPAf2+YPGyq4aPbDUcnpZ5KFYpurKoOh4LnL7QOndmrBarTRzbwAti8GAg0iATSO1TeCrzd/8eAICa6q5vN6MSAnKghggXfClElyg5V02ruOwg5BN3UsB5p9tofkqBbnUvEVfw8uYt8CNwQ1pMSX5PuiQ+1Mgk2b6pmOHb8GCWasY6TAkHBOSeyY6OheVlq1OjMuzVyqSIkV8mlGlHqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yJ2nJofzgi6Qu9PVBaYNuJpo9ZIoSXBWfvdGytSok44=; b=grv2QxcR+6YFHAUKbLvfp4OtFkx9KIPd7EPrEGu2u5uAPIi0qJrt541674h5oshdThdSx2wzFqEmjqITp1pE0CacU5MdbC7+QjsyRmna/oE5kTsDG6TBzQBB4ywtc8hrnjyRjPIs1ZP0IZIQ2uy0StlK8iOgBkbRzLWtWnwPI8O/8H49O8HrB70q41rXYpQ4d3b2XTeg1K+icvSSKXtxxr0GCW8xf0gF5/7o/XjZ0GPgZm5qBEOB3W8Kb3ac9Rgw7DoH4nig5ND5bs0hB+6Cr6vRLDz+iCGp/Yt9AIspAJIlamTl2jv3eLJzePtMT7CqXWsF4UCkmavfgvTTFUBW1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yJ2nJofzgi6Qu9PVBaYNuJpo9ZIoSXBWfvdGytSok44=; b=TV1unBTzKj3tBgSSUYuJ/K5xyfTY/SGNwMbDjwlfqw9IiwsSVN/MzQVZBKrhQVRvTKD2td0lbbvufNis1UYrLeZ/fzUe0oc6gF0Gb2prCz8V91fXyKFkBLRO4k+9mCytgnVH/cmhBKPC8HT+0oBl52G0oeRrSAcGyEpwbRoxESw= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB2971.namprd12.prod.outlook.com (2603:10b6:5:118::28) by DM6PR12MB2971.namprd12.prod.outlook.com (2603:10b6:5:118::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Tue, 29 Dec 2020 21:10:57 +0000 Received: from DM6PR12MB2971.namprd12.prod.outlook.com ([fe80::64a5:97ca:ceaf:17e0]) by DM6PR12MB2971.namprd12.prod.outlook.com ([fe80::64a5:97ca:ceaf:17e0%7]) with mapi id 15.20.3700.031; Tue, 29 Dec 2020 21:10:57 +0000 From: Zhan Liu To: amd-gfx@lists.freedesktop.org, zhan.liu@amd.com, Nikola.Cornij@amd.com, Stylon.Wang@amd.com, Chao-kai.Wang@amd.com, dri-devel@lists.freedesktop.org, Nicholas.Kazlauskas@amd.com, bas@basnieuwenhuizen.nl Subject: [PATCH v2] drm/amdgpu: Do not change amdgpu framebuffer format during page flip Date: Tue, 29 Dec 2020 16:10:44 -0500 Message-Id: <20201229211044.109020-1-zhan.liu@amd.com> X-Mailer: git-send-email 2.25.1 X-Originating-IP: [165.204.55.250] X-ClientProxiedBy: YT1PR01CA0085.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:2d::24) To DM6PR12MB2971.namprd12.prod.outlook.com (2603:10b6:5:118::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ubuntu.amd.com (165.204.55.250) by YT1PR01CA0085.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:2d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.19 via Frontend Transport; Tue, 29 Dec 2020 21:10:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9c526ce9-a48c-4855-5cde-08d8ac3e3c46 X-MS-TrafficTypeDiagnostic: DM6PR12MB2971: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZL+nWwh8Ge674NkHKaaQOEOyJ5Ft7c4xImAQrRKgV30laF/O9kDRVC2g5w3cd94IDUWUaJkNC55tJdMoAPnP/bHqPpw5vzHsZMh8FrviZ+lFqgTx/pbIrOKVj/vioHwt9lqbezrJWwtU8h6kQII85nD0ZN4lctyrf+knxD++LqvcP/jRRmcncyVXuNz9Swt9er5JGqtkKRufFOunYOdWR1XQVknWdZIAueq+dmMD86k1JLJLRxbu/bMJijhhcMeGtffyCOKk1JCOVwkIsdB0HCIPRrMTzvcVtCqmZao4CQ80dRR+/ekfQfWPhdSiBS3sUocbQ1WxaQwYdV6qBojdS6Vleb3cp/GHtYAB0reOnH2bdXo8FQgIqZQm15Fwqa4HzwJ2nA3WEEPKYbPMhMBB9g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB2971.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(366004)(39860400002)(346002)(396003)(136003)(2906002)(7696005)(86362001)(6486002)(36756003)(26005)(956004)(316002)(83380400001)(44832011)(8676002)(2616005)(66946007)(16526019)(52116002)(66556008)(5660300002)(186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rU1eFhxZtsmtXF X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2971.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2020 21:10:56.9550 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-Network-Message-Id: 9c526ce9-a48c-4855-5cde-08d8ac3e3c46 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 52wUGSXMtKCuShypwzjpXOqG5il4FTeeDQprcTK+ICRQTLwGn+m3RP1HgciHr50h X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2971 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" [Why] Driver cannot change amdgpu framebuffer (afb) format while doing page flip. Force system doing so will cause ioctl error, and result in breaking several functionalities including FreeSync. If afb format is forced to change during page flip, following message will appear in dmesg.log: "[drm:drm_mode_page_flip_ioctl [drm]] Page flip is not allowed to change frame buffer format." [How] Do not change afb format while doing page flip. It is okay to check whether afb format is valid here, however, forcing afb format change shouldn't happen here. Signed-off-by: Zhan Liu Reported-by: kernel test robot Reported-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Thanks Nick and Bas. Here is my second patch for review. diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index a638709e9c92..8a12e27ff4ec 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -832,7 +832,8 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb) if (!format_info) return -EINVAL; - afb->base.format = format_info; + if (!afb->base.format) + afb->base.format = format_info; } }