From patchwork Sun Mar 27 22:39:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 12792993 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 258EAC433F5 for ; Sun, 27 Mar 2022 22:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eGQTQJv6L5VffaJw5r1N9fhFdxJMEOZ4g8X+55eCNsQ=; b=4ZpfzUj/oHS27d u+AI/K7Zkq/nStH9OzGCZhQF1kaSxDPAP+X8JT41DO3CAAQd3PNH7ShYjxYPKV92DS/JENwuw/go0 6p0G7TzQ/jwjJrPi6DEZehzhzWt5goFSJrO9AG8e1YAO0zJnUFTzaJIn5eekQo1F02eTyyHDipD0t 6sCo1mXevddGw10djzvgpvSrrPkV9wSs/6dvZP/B752IWBJB95k0MJz7hfLX6M5I8jy0CK11QfFBA /K2oMphGYgvWap7CVg2yamNltNK1tmplm/kh+vSvPnDXFzKAt97BIvXNgJUSqwM3VKLagQ1O0ngEx v+i8Zgj4E2pPYVEPzTZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYbdZ-006Xgj-Rp; Sun, 27 Mar 2022 22:45:30 +0000 Received: from mail-wr1-f49.google.com ([209.85.221.49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYbZY-006V7p-DM for linux-arm-kernel@lists.infradead.org; Sun, 27 Mar 2022 22:41:25 +0000 Received: by mail-wr1-f49.google.com with SMTP id d7so17901881wrb.7 for ; Sun, 27 Mar 2022 15:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7cdghCtZILOuy6wyiUAMSm10nHZvUCEwy3CxnJnpQ3E=; b=a00oZ0zFt/UkLWjLbBa3/jFbCTFYwg2m9Y3FViz0Wi20dUXxoCDB9YnYyPfCd0MwNp gakNUrmY9+qo8B/AYoDZ3Ws+4zQFGZDCDugqpUOF9d80iibYqXPpuptpER2gMjOneA2s tGOM5g+3gOheKiGXA1hKtVT1fywSDX0ke7puAkmSD4/kVLbnAMh9m8hYtXG3PT3zHNhQ bs9vAKnqDF9CevtIhWXCNwiMCsNlFgbUCey6aCehtCNR1EhzicmE38C8VmVuIxa0vmjV G0ms8mP59Tq0tLaNQq7YU/7ICYwtTYczJ7leCPw22dzLxXNfLh/Ugo8NCn4wIwCSJUfV OotQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7cdghCtZILOuy6wyiUAMSm10nHZvUCEwy3CxnJnpQ3E=; b=P3Ne4I4Ys9nykmbjbBGOY1IWDDkqkW97z/KXiCpLVGLYKnt4n+InHRUFQ27UQ7iMxg 6RIu7NgZAd9Juf2ie8Pyn6jhVFZg8s6uUt2YB9PSO27etV9QEHReCtNMkChkNdHaoHLX 06pNk1jSo+rs5b3cw3Pqe8IbOjzv1sbBOTfMtLuZ9i/n2t9peuL3Eh5FABmxqE5Bp9aG uSjHmAHSnVYZ6CB+CpV/DmOilhnhAENrI6R5BIZoQJ1mhqvHPI8p6pwNL7UFR/EE6tZw B5yWVwTCY5rPkADkpWokSkb31TEva3EZC8H7s+ROUiiBde0b+5E/m0efMExHKCRmbhv/ qUGg== X-Gm-Message-State: AOAM530Un3bQQg8UdNieqcIH9qjFIt/HjGjDy7Rk1iOglntNsDPNfpZ/ 27YD/3anPaEMlOjW+sY0DrNSKQ== X-Google-Smtp-Source: ABdhPJx0D/6eRjbTNpgctrBZBOznJL+XQ5R4taW1lDFAJyQP4uqZk0fMKVrOQi3TA5P25fvp/LidkA== X-Received: by 2002:a05:6000:2ab:b0:204:f77:c1a with SMTP id l11-20020a05600002ab00b002040f770c1amr19889863wry.173.1648420878388; Sun, 27 Mar 2022 15:41:18 -0700 (PDT) Received: from localhost.localdomain (2a02-8440-6341-357e-3074-96af-9642-0002.rev.sfr.net. [2a02:8440:6341:357e:3074:96af:9642:2]) by smtp.gmail.com with ESMTPSA id v5-20020adfe4c5000000b001edc1e5053esm10400867wrm.82.2022.03.27.15.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Mar 2022 15:41:18 -0700 (PDT) From: Guillaume Ranquet To: airlied@linux.ie, angelogioacchino.delregno@collabora.com, chunfeng.yun@mediatek.com, chunkuang.hu@kernel.org, ck.hu@mediatek.com, daniel@ffwll.ch, deller@gmx.de, jitao.shi@mediatek.com, kishon@ti.com, krzk+dt@kernel.org, maarten.lankhorst@linux.intel.com, matthias.bgg@gmail.com, mripard@kernel.org, p.zabel@pengutronix.de, robh+dt@kernel.org, tzimmermann@suse.de, vkoul@kernel.org Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, markyacoub@google.com Subject: [PATCH v9 12/22] drm/mediatek: dpi: move swap_shift to SoC config Date: Mon, 28 Mar 2022 00:39:17 +0200 Message-Id: <20220327223927.20848-13-granquet@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220327223927.20848-1-granquet@baylibre.com> References: <20220327223927.20848-1-granquet@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220327_154120_488205_6798E145 X-CRM114-Status: GOOD ( 12.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add flexibility by moving the swap shift value to SoC specific config Signed-off-by: Guillaume Ranquet Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Rex-BC Chen --- drivers/gpu/drm/mediatek/mtk_dpi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index 6eeda222a973..6d4d8c6ec47d 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -131,6 +131,7 @@ struct mtk_dpi_conf { u32 dimension_mask; /* HSIZE and VSIZE mask (no shift) */ u32 hvsize_mask; + u32 channel_swap_shift; const struct mtk_dpi_yc_limit *limit; }; @@ -349,7 +350,8 @@ static void mtk_dpi_config_channel_swap(struct mtk_dpi *dpi, break; } - mtk_dpi_mask(dpi, DPI_OUTPUT_SETTING, val << CH_SWAP, CH_SWAP_MASK); + mtk_dpi_mask(dpi, DPI_OUTPUT_SETTING, val << dpi->conf->channel_swap_shift, + CH_SWAP_MASK); } static void mtk_dpi_config_yuv422_enable(struct mtk_dpi *dpi, bool enable) @@ -821,6 +823,7 @@ static const struct mtk_dpi_conf mt8173_conf = { .swap_input_support = true, .dimension_mask = HPW_MASK, .hvsize_mask = HSIZE_MASK, + .channel_swap_shift = CH_SWAP, .limit = &mtk_dpi_limit, }; @@ -835,6 +838,7 @@ static const struct mtk_dpi_conf mt2701_conf = { .swap_input_support = true, .dimension_mask = HPW_MASK, .hvsize_mask = HSIZE_MASK, + .channel_swap_shift = CH_SWAP, .limit = &mtk_dpi_limit, }; @@ -848,6 +852,7 @@ static const struct mtk_dpi_conf mt8183_conf = { .swap_input_support = true, .dimension_mask = HPW_MASK, .hvsize_mask = HSIZE_MASK, + .channel_swap_shift = CH_SWAP, .limit = &mtk_dpi_limit, }; @@ -861,6 +866,7 @@ static const struct mtk_dpi_conf mt8192_conf = { .swap_input_support = true, .dimension_mask = HPW_MASK, .hvsize_mask = HSIZE_MASK, + .channel_swap_shift = CH_SWAP, .limit = &mtk_dpi_limit, };