Message ID | 20230213085612.1026538-3-victor.liu@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2242135wrn; Mon, 13 Feb 2023 01:03:30 -0800 (PST) X-Google-Smtp-Source: AK7set/wxQv+PiF3X8HgUTHAjupQRdR3Opqh+OwBQYgz1D1NOiSuOL8e6Q0oEz119NP9FhIl4zC3 X-Received: by 2002:a50:a41d:0:b0:4ac:6ad5:413d with SMTP id u29-20020a50a41d000000b004ac6ad5413dmr9017393edb.15.1676279010730; Mon, 13 Feb 2023 01:03:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676279010; cv=pass; d=google.com; s=arc-20160816; b=UoKn/TceRbpkYKlXGVwGEvkSxhIE3SfCpPwHpefTe3KyEqNZFKtNV2TxNaCALy4vyp CXZ7OJYfUESu9UdusRg/P4UQVK8GPyqgWTP77RFPiyPr0V0Cv0c5pKlv/I4aYYMcLJGh 3Ico5+XS7dWK7/AunEfGg2aqAIaFK7muqSfFxPIvs2l5IuVSH81Z0hWxQZ77qlEw8tmS cIzgErNmdm1Uh7lY1ydho6nbCkzMwkS0Puxu04Ifcj8+ixWDC89LMVwWX9V1yi7UE6wP qlyknOY1PIeVWbIDKBZznpvzzYaup4+zVjCwDcWBkSnYPEGZkfMbMdb7aDDoKCoRiO1Z tpQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=L6NnXmZ44ctfaktKFPzdLi2unr3ubsu9j8G8/JUVyNU=; b=gxD0nAOYOiNYZA+UuByhQj8Hj1U6eL+lsJCErLshwumg+7Y1kUf0GvOLHsOjKSf1Nb qWaqptLMFVjxFWMuzDgUfZhdUPQShMCpoCb38rLfi55knHtwXdRIctJkQ3e7p0sKYzAt RL8ZMpN2euvf3EhMHoVPDQRGTS+Oi0MnsjyXtJRBGdb00icyE0YXjA0FyHBiBDk/EHzt BG74Exo0gUxnB4CtDZSZ7CR7r3NQPJ47twe5iXyThSHBuFUbIX/QPf6NTyroUEXdkIy8 T6nK2iuGjxMu9DrM9a//2rLhCm5p5KoSloWr5lb/j2+TCVFc9/e8caMMDs268ErS9Xll KX7A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Yoi4PFGl; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12-20020aa7d80c000000b004acc80b26e2si2594997edq.300.2023.02.13.01.03.08; Mon, 13 Feb 2023 01:03:30 -0800 (PST) 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=@nxp.com header.s=selector2 header.b=Yoi4PFGl; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230208AbjBMIzd (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Mon, 13 Feb 2023 03:55:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbjBMIzZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Feb 2023 03:55:25 -0500 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2074.outbound.protection.outlook.com [40.107.20.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C76713D67; Mon, 13 Feb 2023 00:55:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V073yHrwnl0guTrdzfUrVjL0dn1xG1yE/kqHPv+k6+2RXR1E2pUslMayB9UTRWSaX+Aa6JPEn6NSP5Ut2/dQoPNLhPWBPSIPNc59+Ki40jWz1M6EN8ZkFMWrhYUNZajwUgLrPa2bxBNIQJvq/4ZJ/iiESlDyPtfNgiSygbmmgUjyAXA7ulLyoQ3YNvmiG7p/ZZjousBMq6nLXvpPkY0WaeGHm471epnNV6diEHL9X+YiUuqOxoGJNG9wgmJahOxALTmKqT2z26uYE9cHoqw9Ub9h5NE+PwMMPANa1bKdmQyfCfu2cQOq7XTXD8P3ERoyVvogl9U+ORg1+MxR2X26GA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=L6NnXmZ44ctfaktKFPzdLi2unr3ubsu9j8G8/JUVyNU=; b=hwQeu7ehP67u32n6a4fMNIm/wlO0y5WA80wcLMzVRBnEsc375tYbKpmk4+MRVFwgkjoLO6FU9h6QkbWlYORD3OMrjjqXKzjl3EWsrB1IZGU+1lXODFunCYrvqszomLcp0DmyNB9uy3OKJU1TW4MEAyH/masw6pmMPTnJMQ0iO4h9Swu7PY2biN8b5SgBLNfU9+1f30v3ZHe3YPG5cdS7iSRmppJL2yDuXM292dgF5rtpiswW1M6OAqB38rKj4LR6bwF/gAV82MdSxN4ol7Gu+PlKsba+0eVWw5y8sT7WYgbOT28xeaEnu5e1+jG+49NSy97Y2wAWfgflRrWZRIxJ6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L6NnXmZ44ctfaktKFPzdLi2unr3ubsu9j8G8/JUVyNU=; b=Yoi4PFGlgCjGeJkPoHdNVHUbpBDWPYa+GjzDLO+1EYVVjksh55Cz/H47sNctCHjkBFAGBWlDgpC4IM8//9Vf7h/IudCatJ/ZTCxeaW1dpjmhbx/0QuePfvy600FdZkWGkxqF7hLLSOZ1uN931SJG0vcsrR1WodIDY3tDEsNR3HE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by PA4PR04MB7600.eurprd04.prod.outlook.com (2603:10a6:102:f2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24; Mon, 13 Feb 2023 08:55:18 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::5725:92ec:f43e:f5fc]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::5725:92ec:f43e:f5fc%9]) with mapi id 15.20.6086.023; Mon, 13 Feb 2023 08:55:18 +0000 From: Liu Ying <victor.liu@nxp.com> To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: marex@denx.de, stefan@agner.ch, airlied@gmail.com, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, krzysztof.kozlowski@linaro.org, LW@KARO-electronics.de, alexander.stein@ew.tq-group.com Subject: [PATCH v3 2/6] drm: lcdif: Drop unnecessary NULL pointer check on lcdif->bridge Date: Mon, 13 Feb 2023 16:56:08 +0800 Message-Id: <20230213085612.1026538-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230213085612.1026538-1-victor.liu@nxp.com> References: <20230213085612.1026538-1-victor.liu@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0009.apcprd01.prod.exchangelabs.com (2603:1096:4:191::18) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|PA4PR04MB7600:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c4ac0f3-54ee-489f-a698-08db0da007d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kH6pjT54zSkfCpwQuieUIojh2BM6xlgUMTHTvWW2e9mitbvb6uc5d+ZKaYjk+RT8jJoQIFGemVeJjX2dZ3AGRBJHsmnz5+h9fLWj0YYHJIiHY3nDqknh4PVCz9aw33N4uHXlsNuIPgs/cT5T6jiDt1NJjlakXCT23A4RJ7UKzly0+39v+gM6yMAOLaVXhyhEBFUFxguPg6TuvY1m60j+4+0t7aRf8rwElkjoklPhi9ZpnvGwE/l6qRFPqPWmg46ScMf3sy0TzcyXTy1zvGHnK58J5NtMvQ9Opog58UO+SWwpzXdkDNUgOzulEJ5cTmEVSghJnLqm1wA9QHIfhhoVxTm95NysDvmrDPUZLtk7mvJ4A8StDg4LpsRWOUNCeMeA7LNHQMYUhO8wczS/3MAK3xY7IWe1db4dDKUWVsOdCQsjU6Cb/4n4mskqPCPUaeaKiCxs0oud4jujp9kCSUIrwtR9MHvil0lVOj3EBzLDcD/yW+1WLf+5bl4L/thGqxsWGq/dQeW5JTnXS8XzUH8zE/pu2ufJi1oyxqHTXdjOlqPZ608hzG4cwWpRgGcYGwIAFao5cA9T58WFEIjYM5//bCAh0hIjQPCPer3VAfxnxV59o1nki1ZD2ICFSPdsZ4rwlX0HKX4hyns3pj+bM2hIEqmqBSWBkVhN8fHL9CHci+gjy82JTYwD40VmVtd2DNYdoHg8TsGQOn0fTyClyj22Ww== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(366004)(396003)(39860400002)(346002)(376002)(451199018)(4326008)(8676002)(1076003)(66946007)(316002)(86362001)(36756003)(2616005)(186003)(83380400001)(6512007)(6506007)(38350700002)(38100700002)(26005)(66476007)(7416002)(6666004)(478600001)(6486002)(52116002)(41300700001)(2906002)(66556008)(8936002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JSLu4/LZ1HUxum3HLJCF5pQbu1v0D4SpfM/g7BrsAX2+mKqEKnrfxIqFDac66CyCRCMIPDuZVmfap589qywLNEHOaPNrAzAYXy1ljfhrcKk4F0BwbnoV6B+ZPWetsKgjHfmdF7M4SxQpLee6tkhU/pYznFt1uaAupj+oF0j6PGPiWVdQEqsiDIvkHnTHBjHxR7b2ar/9YBGZcsnR7z5Vt79ss8aAoZ7g7+AMJ3funP/qYmSaM6OcW9yHKn3vzho4FnWBMixZNAveS30b+D01qqqHXRfiaVaEKSYP9FS2YmW+hvVuzkiXhTf9pd94gJWLGwlm+1gpdPdBn8GNM29B9KoB8cNOsmpR6fEpUQqjqBsAHO17WRfaDqAG/tWsGe+c8Xk2N55ZV2aDfL83y0jpAniCwixJz5ALqEM0UID+8vinX+VNx/wyTgD11ijvmc9Pp+E/hH0zC8WICHyQLHVPbjKxPJp96Kvy+PUIbgKXt8hiWjJjDxlXL2oqLHqXVZN132H9ugKT0HQwhTmjo2/KBpevHJb0GojgHOnetMcK+GF+trhysevIpuO9NcZLQhX94LBn4c8yNlxH/4W4R6juIgIw36PSX1u2pQgulxZEb+nd1PVoYKTln+J8tAmq+gJdbA7F/siGD6PMyxB2f2fvFmiJKyG87PbfSTj5w2PmNGNF0gxQ9Dg09a3j23i96gokj3RneKXfg2krpSX/c+OSKZ9PqF9QllWCXctf0y4oSxzSM7MfxlPV1Xo6KClBy0ifBxM3FEGp1ORzUTEpD8gmpwjzHn8Jb1YLoMNP3M2xFpYa0lF5sf+EHzhyHkzvQIzTO7VlCfzkJrvMKA7Mky7JPXT7mSddEzS3/Uoy+byWe9rcYw7K/8dhTm+fyyaohlanMXv0O5SuDwMG/LsUsk2DGO95t2bY03oMESWhfydgWBoNLvyxDxLtgwkrfQYqYsKP5WUZACPzELlGqEvDnHCFP2hYLyclnOEZUuN7qmwPB3K/QGHFjawz4TcOtna5Ysh9FEwjH3LX6OL1XXpTSZXdUbpX6c7HKJSX5ZZy7mjeuKQO+Yd+RoVU4V1S0dQNQvZ6lDyWYA9ks+7NH2wilbdqeWugXEp5+AVSSK4FcYa2/s9PCpudttnZeVVc8eOYOycbUP3DZefc8bcDQy/y5WPky4GMIYh6bYxCxdaPtckmgfCQQ0YD3bTSaWoUINVwYba+//aF8xc243PXHpSHVuHMXtx5oHngf/uBYeUFslEFwkrI/18wNXEzVdaWAhZwOmEUSVMzOU/m4m40W9cucYOSWcPaKMBTcC3LFxa0g6cjyYksejjA9girr/ncBYExTm3mAL4ptTTtbKJ5XCjGSKuOfqM7RSpv7xKl5vEb3bwSale6ayurti0FMnXLISrjikMaO0Fx7VpOaSPdFUAl2NxPqTAbAg0pV7nUKJ87QvRmi2kAzewFOcXG/xEMtS/10qvW+X1bZUa5XoB/93mQjEam6xv+KQp5BIR9mKJ0gQig45BbLVo+Ur14SXidKj832qyBo+4YtuBnohaLWAefnO0Si3b3Gabvs13FCTNOHdlRbCg2GQURI+zhATUELzZAcbAD X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c4ac0f3-54ee-489f-a698-08db0da007d5 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2023 08:55:18.6080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ycYhzj9qSi6HicPSH9RHRrEtSShYizG1zaPE2sLdKzv+U6dRTvR3YEI4RP5MNpqf8MZ/GMTyTQJ5axmBcT7KYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7600 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757705939812587512?= X-GMAIL-MSGID: =?utf-8?q?1757705939812587512?= |
Series |
drm: lcdif: Add i.MX93 LCDIF support
|
|
Commit Message
Liu Ying
Feb. 13, 2023, 8:56 a.m. UTC
A valid bridge is already found in lcdif_attach_bridge() and set
to lcdif->bridge, so lcdif->bridge cannot be a NULL pointer. Drop
the unnecessary NULL pointer check in KMS stage.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
v2->v3:
* No change.
v1->v2:
* Split from patch 2/2 in v1. (Marek, Alexander)
drivers/gpu/drm/mxsfb/lcdif_kms.c | 33 +++++++++++--------------------
1 file changed, 12 insertions(+), 21 deletions(-)
Comments
Hi Liu, thanks for the update. Am Montag, 13. Februar 2023, 09:56:08 CET schrieb Liu Ying: > A valid bridge is already found in lcdif_attach_bridge() and set > to lcdif->bridge, so lcdif->bridge cannot be a NULL pointer. Drop > the unnecessary NULL pointer check in KMS stage. > > Signed-off-by: Liu Ying <victor.liu@nxp.com> > --- > v2->v3: > * No change. > > v1->v2: > * Split from patch 2/2 in v1. (Marek, Alexander) > > drivers/gpu/drm/mxsfb/lcdif_kms.c | 33 +++++++++++-------------------- > 1 file changed, 12 insertions(+), 21 deletions(-) > > diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c > b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 262bc43b1079..e54200a9fcb9 100644 > --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c > +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c > @@ -394,7 +394,7 @@ static void lcdif_crtc_mode_set_nofb(struct > lcdif_drm_private *lcdif, struct drm_display_mode *m = > &lcdif->crtc.state->adjusted_mode; > u32 bus_flags = 0; > > - if (lcdif->bridge && lcdif->bridge->timings) > + if (lcdif->bridge->timings) > bus_flags = lcdif->bridge->timings->input_bus_flags; > else if (bridge_state) > bus_flags = bridge_state->input_bus_cfg.flags; > @@ -463,30 +463,21 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc > *crtc, struct drm_display_mode *m = &lcdif->crtc.state->adjusted_mode; > struct drm_bridge_state *bridge_state = NULL; > struct drm_device *drm = lcdif->drm; > - u32 bus_format = 0; > + u32 bus_format; > dma_addr_t paddr; > > - /* If there is a bridge attached to the LCDIF, use its bus format */ > - if (lcdif->bridge) { > - bridge_state = > - drm_atomic_get_new_bridge_state(state, > - lcdif- >bridge); > - if (!bridge_state) > - bus_format = MEDIA_BUS_FMT_FIXED; > - else > - bus_format = bridge_state->input_bus_cfg.format; > - > - if (bus_format == MEDIA_BUS_FMT_FIXED) { > - dev_warn_once(drm->dev, > - "Bridge does not provide bus format, assuming > MEDIA_BUS_FMT_RGB888_1X24.\n" - "Please fix bridge driver by > handling atomic_get_input_bus_fmts.\n"); - bus_format = > MEDIA_BUS_FMT_RGB888_1X24; > - } > - } > + bridge_state = drm_atomic_get_new_bridge_state(state, lcdif- >bridge); > + if (!bridge_state) > + bus_format = MEDIA_BUS_FMT_FIXED; > + else > + bus_format = bridge_state->input_bus_cfg.format; > > - /* If all else fails, default to RGB888_1X24 */ > - if (!bus_format) > + if (bus_format == MEDIA_BUS_FMT_FIXED) { > + dev_warn_once(drm->dev, > + "Bridge does not provide bus format, assuming > MEDIA_BUS_FMT_RGB888_1X24.\n" + "Please fix bridge driver by > handling atomic_get_input_bus_fmts.\n"); bus_format = > MEDIA_BUS_FMT_RGB888_1X24; > + } > > clk_set_rate(lcdif->clk, m->crtc_clock * 1000); LGTM. Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 262bc43b1079..e54200a9fcb9 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -394,7 +394,7 @@ static void lcdif_crtc_mode_set_nofb(struct lcdif_drm_private *lcdif, struct drm_display_mode *m = &lcdif->crtc.state->adjusted_mode; u32 bus_flags = 0; - if (lcdif->bridge && lcdif->bridge->timings) + if (lcdif->bridge->timings) bus_flags = lcdif->bridge->timings->input_bus_flags; else if (bridge_state) bus_flags = bridge_state->input_bus_cfg.flags; @@ -463,30 +463,21 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_display_mode *m = &lcdif->crtc.state->adjusted_mode; struct drm_bridge_state *bridge_state = NULL; struct drm_device *drm = lcdif->drm; - u32 bus_format = 0; + u32 bus_format; dma_addr_t paddr; - /* If there is a bridge attached to the LCDIF, use its bus format */ - if (lcdif->bridge) { - bridge_state = - drm_atomic_get_new_bridge_state(state, - lcdif->bridge); - if (!bridge_state) - bus_format = MEDIA_BUS_FMT_FIXED; - else - bus_format = bridge_state->input_bus_cfg.format; - - if (bus_format == MEDIA_BUS_FMT_FIXED) { - dev_warn_once(drm->dev, - "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n" - "Please fix bridge driver by handling atomic_get_input_bus_fmts.\n"); - bus_format = MEDIA_BUS_FMT_RGB888_1X24; - } - } + bridge_state = drm_atomic_get_new_bridge_state(state, lcdif->bridge); + if (!bridge_state) + bus_format = MEDIA_BUS_FMT_FIXED; + else + bus_format = bridge_state->input_bus_cfg.format; - /* If all else fails, default to RGB888_1X24 */ - if (!bus_format) + if (bus_format == MEDIA_BUS_FMT_FIXED) { + dev_warn_once(drm->dev, + "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n" + "Please fix bridge driver by handling atomic_get_input_bus_fmts.\n"); bus_format = MEDIA_BUS_FMT_RGB888_1X24; + } clk_set_rate(lcdif->clk, m->crtc_clock * 1000);