From patchwork Mon Jul 12 09:46:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12370635 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,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 3DE67C07E99 for ; Mon, 12 Jul 2021 09:47:05 +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 EFAD76102A for ; Mon, 12 Jul 2021 09:47:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFAD76102A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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 6760B89856; Mon, 12 Jul 2021 09:47:04 +0000 (UTC) Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by gabe.freedesktop.org (Postfix) with ESMTPS id 12C7289856 for ; Mon, 12 Jul 2021 09:47:03 +0000 (UTC) Received: by mail-pg1-x534.google.com with SMTP id t9so17669809pgn.4 for ; Mon, 12 Jul 2021 02:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ka9MgwmW5QsHbE3oC7CaA6AD1jb4S5a4fPDgxsbWrLU=; b=WHVTpBseJgLMnGqaa+1RqcoNPqyIUkmougt9lWoVSXdb1vDOPYvj9eqascjIEXhUfU qC8HnRP3UKSYTTDn1FHNirspfOX/GrqUkMSGuMwPyC7KDJ2ek5pBGzf+qFGiT3Idzqba i7rp4XxeTPaLwnY1OxOE89C796t1Nwq7aSat8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ka9MgwmW5QsHbE3oC7CaA6AD1jb4S5a4fPDgxsbWrLU=; b=iMZ0/DKVyc4iw9kfjvfy3/HaQsBYji5zMfy4gHV5fPmZHJ5P5US4OpFH7/XpsGAeO9 pjCvHiuEQFxutYINpLbpv676yG/Do+Euw6qDXpQQ+Wk0eU+i4Sh4CcmzVI367crLXTNV H6uJPyHFMTpo/+lr72mS090Pwcqi/7CR03qoZ16mNjLHA6EruIW29uFQY0o2Zeen3cGo Cb+NxCbmnwQSy+dN6rAxVF/Djf3g6H/gAp85aWwX/vMXz5NENDc1F5LrYU3tQi88MhZB WwSKz725h5Jd7ncnP6V1Mc47Uk9fcLZujfht07LinlGxFUSldTGjr+YV8ej1BJOLESRg y7MQ== X-Gm-Message-State: AOAM532BTczqeMDtyaLy7+KrA0FtocDpWqMEP/nF7yGgi2q7n9RiiE/H FVpU95YzZwCKGY+3oH9snqk6qw== X-Google-Smtp-Source: ABdhPJzu+zuvDdKs4oR5z4/fiaSC07w3RNE3ZQ7jClgmYHqoH/5VyU8uRrV+hg7Lxiz2yMeqaJj2+g== X-Received: by 2002:a05:6a00:98b:b029:32a:d9a5:2540 with SMTP id u11-20020a056a00098bb029032ad9a52540mr8333872pfg.66.1626083222436; Mon, 12 Jul 2021 02:47:02 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:6e22:4686:299f:5f2a]) by smtp.gmail.com with ESMTPSA id 10sm14631650pjc.41.2021.07.12.02.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 02:47:02 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Subject: [PATCH] drm/mediatek: mtk-dpi: Set out_fmt from config if not the last bridge Date: Mon, 12 Jul 2021 17:46:57 +0800 Message-Id: <20210712094657.1159299-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog MIME-Version: 1.0 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: , Cc: Jitao Shi , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rex-BC Chen , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" atomic_get_output_bus_fmts() is only called when the bridge is the last element in the bridge chain. If mtk-dpi is not the last bridge, the format of output_bus_cfg is MEDIA_BUS_FMT_FIXED, and mtk_dpi_dual_edge() will fail to write correct value to regs. Fixes: ec8747c52434 ("drm/mediatek: dpi: Add bus format negotiation") Signed-off-by: Hsin-Yi Wang Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_dpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index bced555648b01..25c565f9179cc 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -610,6 +610,10 @@ static int mtk_dpi_bridge_atomic_check(struct drm_bridge *bridge, out_bus_format = bridge_state->output_bus_cfg.format; + if (out_bus_format == MEDIA_BUS_FMT_FIXED) + if (dpi->conf->num_output_fmts) + out_bus_format = dpi->conf->output_fmts[0]; + dev_dbg(dpi->dev, "input format 0x%04x, output format 0x%04x\n", bridge_state->input_bus_cfg.format, bridge_state->output_bus_cfg.format);