Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1807273ioo; Mon, 23 May 2022 03:54:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwZTa8rqjyaE6tgmK7VeuSGvMXKhtJWgxYiO2wRG5QO/2x/OdW/CtUciqYMhy2DpJp7n0w X-Received: by 2002:a17:902:be01:b0:15e:fb07:ba85 with SMTP id r1-20020a170902be0100b0015efb07ba85mr22589487pls.85.1653303288795; Mon, 23 May 2022 03:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653303288; cv=none; d=google.com; s=arc-20160816; b=kcNKofFSqaJurk6/eJlVEtlPihPcmDLYT37wke8nfmA/1f9o8Ug4jKQtfN/mRfFPl+ N9EKXi8sn+rx+gkM5S/MCaJY2ovwrJCtO4jHTaM6Bf0ldJ3MnP35v76qOOlsEjIKAIy3 6RMiAkqd6qcZASnJco7WuMxiistuV8Qicry+GaR9cTrcnyDm8swh/QaCbM89ffI5nK0Z a9VqaWOjL/oAfjmao3HIAQsgCzqHfAr8V7+L5mcx5aZuZ1pDlCTPug3QQR+DzQ/41xFB P+77Nrl1KJq7BTF7R7+h7cVSHacxkx9DM4dm7cokT86tKwsKJ7AX9XSyfc4sfp0b0dEL Ldgw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CWgqk9KhFkOffkb3OEMTrNnAfqhM77Ox4JDvfW/o1S8=; b=0RH605+PzQxBZDRsgKb3r+YG+pgpeuZlA7g9i7szMf6ZB28u6NmKgjVRxarw3dXXIK mng4YP/icGVnlHE4IzWsBdkx0/O8XNcYfSndOPZT51zVvMBXsiAJshLoXi1rnc9OVXCi p6hiKa976Td6tYoMEku30jfkiaTctORvo+fuz6PwCtBK/RlLD656XHRrFXteOJt6Tzk/ SOyAfllqUaJqMVOi3sjIE+5hJMVFBZB7Xn77xOM6m1qiwpB1alklv1F1Yvl5ysjMpcBz aOq4Tl+UGYh1uxrhAvEA0ihUsrqmnSLKPgnedHc9xvtg24+DshWuBTOg7HOA9ph3jG1p 5LvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=JdEhccv0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w13-20020a1709027b8d00b0015f0063568bsi8182872pll.340.2022.05.23.03.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 03:54:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=JdEhccv0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6CFF631915; Mon, 23 May 2022 03:52:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234581AbiEWKwO (ORCPT + 99 others); Mon, 23 May 2022 06:52:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234568AbiEWKvZ (ORCPT ); Mon, 23 May 2022 06:51:25 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97C4728729 for ; Mon, 23 May 2022 03:51:23 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id t13so1581722wrg.9 for ; Mon, 23 May 2022 03:51:23 -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=CWgqk9KhFkOffkb3OEMTrNnAfqhM77Ox4JDvfW/o1S8=; b=JdEhccv00JjYKHfLCeZR4SBq3r1mpyIzHgvk2jWMBa66ocy5zkNG+dqpG02U2B2q2h Tjkw4VDmRWqGKrSi9mU5AagmMOybaI/eIkEkeE09PZHVg979ODz5Jjp/v5dI4f/3hJWU WRMWTbgCLTkeVezqAa360Eus1As226/OURVlVyn+52XT6QfeGjrUuZUi9MDK33Pq6nqB ZVBc96O81UYVu/wJS9JCyqra8bVi6dWW651erb9THLCb/zMJycaLyCMJcvj3W3MBdExS zi8hR5nIJAmtFB9zOxjMsTc3HlNcX6vTR6r79xtjeziCBr6IltidQMFpXz0YxO3cNNuv SPLw== 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=CWgqk9KhFkOffkb3OEMTrNnAfqhM77Ox4JDvfW/o1S8=; b=GJ5+BIxEf/iHDpxzjAKFeHyyWEr7Xdhd/iOyq/rMFnzejDtK0ENuKAFUeM8v0YTJ3n lsuiaCl7biaLqgDIJ+aMkb136aK3srvohx4mUCl33RjiPqM2FUbycyqnmgAgCUEXEILz jzkqIWvKcAs0E6NeKy1QyIXrBOFnXGJtwprzsw+MaD+q5W/U0UA3R8CxcNxaR389aWAX DJyjzWVJ/7fdwDikkj904P9x1u8tDwXW5bOS59oEc+r0fx00uD9Z7kYTZn97e1ckQz6M b+MHoGuhfSbqfg8rbx1DnlxZduXyAKWNoJ3qeHCfZDBw8w2oudibD80U9PItdssTk8Xt NS/A== X-Gm-Message-State: AOAM533brkGgF5XGgudkm/LbaxQhhLyRZaJh4ej0iEATkyPFFxPj6F54 uOQhRqopJorQTCpQKO5zgckvtg== X-Received: by 2002:a5d:4207:0:b0:20e:63c3:e398 with SMTP id n7-20020a5d4207000000b0020e63c3e398mr18892329wrq.642.1653303083160; Mon, 23 May 2022 03:51:23 -0700 (PDT) Received: from localhost.localdomain (2a02-8440-6141-9d1b-3074-96af-9642-0003.rev.sfr.net. [2a02:8440:6141:9d1b:3074:96af:9642:3]) by smtp.gmail.com with ESMTPSA id n11-20020a7bc5cb000000b003942a244f38sm8453607wmk.17.2022.05.23.03.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 03:51:22 -0700 (PDT) From: Guillaume Ranquet To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Matthias Brugger , Chunfeng Yun , Kishon Vijay Abraham I , Vinod Koul , Helge Deller , CK Hu , Jitao shi Cc: AngeloGioacchino Del Regno , Rex-BC Chen , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-fbdev@vger.kernel.org Subject: [PATCH v10 12/21] drm/mediatek: dpi: move the yuv422_en_bit to SoC config Date: Mon, 23 May 2022 12:47:45 +0200 Message-Id: <20220523104758.29531-13-granquet@baylibre.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220523104758.29531-1-granquet@baylibre.com> References: <20220523104758.29531-1-granquet@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Add flexibility by moving the yuv422 en bit 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 6d4d8c6ec47d..40254cd9d168 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -132,6 +132,7 @@ struct mtk_dpi_conf { /* HSIZE and VSIZE mask (no shift) */ u32 hvsize_mask; u32 channel_swap_shift; + u32 yuv422_en_bit; const struct mtk_dpi_yc_limit *limit; }; @@ -356,7 +357,8 @@ static void mtk_dpi_config_channel_swap(struct mtk_dpi *dpi, static void mtk_dpi_config_yuv422_enable(struct mtk_dpi *dpi, bool enable) { - mtk_dpi_mask(dpi, DPI_CON, enable ? YUV422_EN : 0, YUV422_EN); + mtk_dpi_mask(dpi, DPI_CON, enable ? dpi->conf->yuv422_en_bit : 0, + dpi->conf->yuv422_en_bit); } static void mtk_dpi_config_csc_enable(struct mtk_dpi *dpi, bool enable) @@ -824,6 +826,7 @@ static const struct mtk_dpi_conf mt8173_conf = { .dimension_mask = HPW_MASK, .hvsize_mask = HSIZE_MASK, .channel_swap_shift = CH_SWAP, + .yuv422_en_bit = YUV422_EN, .limit = &mtk_dpi_limit, }; @@ -839,6 +842,7 @@ static const struct mtk_dpi_conf mt2701_conf = { .dimension_mask = HPW_MASK, .hvsize_mask = HSIZE_MASK, .channel_swap_shift = CH_SWAP, + .yuv422_en_bit = YUV422_EN, .limit = &mtk_dpi_limit, }; @@ -853,6 +857,7 @@ static const struct mtk_dpi_conf mt8183_conf = { .dimension_mask = HPW_MASK, .hvsize_mask = HSIZE_MASK, .channel_swap_shift = CH_SWAP, + .yuv422_en_bit = YUV422_EN, .limit = &mtk_dpi_limit, }; @@ -867,6 +872,7 @@ static const struct mtk_dpi_conf mt8192_conf = { .dimension_mask = HPW_MASK, .hvsize_mask = HSIZE_MASK, .channel_swap_shift = CH_SWAP, + .yuv422_en_bit = YUV422_EN, .limit = &mtk_dpi_limit, }; -- 2.35.1