Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1749413rdb; Thu, 7 Dec 2023 07:52:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtsbY5e5r32gmCtQk7QPyWY1WyQhy6TvZ3GASdkyVNpgCT8+WjwD6wZn951Kq2Qqfvlv9d X-Received: by 2002:a17:90b:3b47:b0:286:a93c:5b29 with SMTP id ot7-20020a17090b3b4700b00286a93c5b29mr2878573pjb.12.1701964355483; Thu, 07 Dec 2023 07:52:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701964355; cv=none; d=google.com; s=arc-20160816; b=c8VraSAgg4vn66k9jYSFbH5cgN7AFgATmp/CkHbADamB82rqushm383hkS9S6vcZHR 8t3/YCBiAokiRHPXPpWu8zXSx0uXnzjViisiGcLROAZjIbaRGS+iEOq0f/VrCSc62eq5 cwM8aXFXfHjudzALCT9ANwkm6WFyU1w7LojpO5khRv85VQJ6Qz1hBYXF6eqCQRK1Z7zB dAe6vywb34r6ZpOk+7CkfNdYgAPSYu9O1i6Vs3R2Wxcq6m4t+RpkYZA8Ckzq9RxqUg+p IyWU7zmfIquWV+LeU6J34UqeXRSBeeTGwbyMs4RWPGXkGuGUKHzNvxWn5Z4t1IyIo5Hl /pXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Z94w53HdBnOv21wZpAuE8ngSn1fplE9TE+d7rTrPCBw=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=HuOKc55ziDtdqM2DobRpobQVXuvCQwANVCUiUGfgyyaHMB9KYuHOmRCpvdLNXc7Fy/ EadVbc/z8OXmX13HlHdtIBniPVPVJSUIrWA3chzE+h1JQPDn4t0PgpIklEToIMNoofJz uaMMJGPzj3GnP250uZn7H5RcUTt5xyQ1MK4KFIjgUb2mLqVKG75uR+XSyEtQTYcTfhpr cSKcQwHch5u1safVG+2HZHxAGVheIEDV/i33+TsJyPzd5wrCh7AwDVqnTeZxWOfiLz92 WtgYbIukV585auyWq1+q5KK80nOE6j0ZtqZvEp20bvEw/JjnV+2br8cynRoTEfrpQf0K BB5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FMtShcdE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id pi13-20020a17090b1e4d00b002851c699781si34083pjb.154.2023.12.07.07.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:52:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FMtShcdE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id EC3A0826E5A4; Thu, 7 Dec 2023 07:52:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443787AbjLGPv6 (ORCPT + 99 others); Thu, 7 Dec 2023 10:51:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443685AbjLGPv3 (ORCPT ); Thu, 7 Dec 2023 10:51:29 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CCBA198D for ; Thu, 7 Dec 2023 07:50:55 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54239C433D9; Thu, 7 Dec 2023 15:50:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701964254; bh=o/U/79rf6BqpMe1KK0LpfYFe7dMvg+XOPZEvtcJ8NVQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FMtShcdEMcnJ3mGKDgZUbhNhkGuNDVI8n6x3bYQ94+CkUzNFRJeQXp/T2Xx+7fAaB RgapKwH7phZYAy8AgfAX5vhT5gDg6Wy3szIoeuybT1GuhQzZYKlSpGHIWs1ngSbIzT Y+G2OhTMMmz+P5HG3g8CU3A8BMolu7OdmMG56u/e4HIFp7scs0Px8oDxzG6uTmMhUU P367WTxQhGFEtZ5bArRO9YlA4MUPt9kOA56I+WwaMTueKhs5MNA5UBO2ZIE6dDkdAm oxppqt1r+1fKivArFqnPPUgma3DJV2Ut6R+XFoh9omHWjGijvJ73jKYE7Wur9u0oLJ 4fDhXeX4D5KpA== From: Maxime Ripard Date: Thu, 07 Dec 2023 16:49:52 +0100 Subject: [PATCH v5 29/44] drm/rockchip: inno_hdmi: Remove useless output format MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231207-kms-hdmi-connector-state-v5-29-6538e19d634d@kernel.org> References: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> In-Reply-To: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Emma Anholt , Jonathan Corbet , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Hans Verkuil , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, Maxime Ripard X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3790; i=mripard@kernel.org; h=from:subject:message-id; bh=o/U/79rf6BqpMe1KK0LpfYFe7dMvg+XOPZEvtcJ8NVQ=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmFL9uqpf/WbbnAfMDu6gTzSzzb35/76eDWlXSn7r1bk IKPym6vjlIWBjEuBlkxRZYYYfMlcadmve5k45sHM4eVCWQIAxenAEzk6SFGhqn6Zk/XsVjLyjK2 LKr/acy8siOYN718HYe+0FnHCQYOgQz/C11Srnwsn8uwZWH26j3Vwc+zbfdc6ZnH+baUpXCWZ2w PCwA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 07:52:33 -0800 (PST) Similarly to the input format, the driver has a lot of code to deal with various output format, but the driver hardcodes it to RGB always. Let's get rid of the dead code. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/rockchip/inno_hdmi.c | 57 ++++-------------------------------- 1 file changed, 6 insertions(+), 51 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index e0696ab16da3..0c6c550e0ce7 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - unsigned int enc_out_format; unsigned int colorimetry; }; @@ -296,26 +295,14 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, &hdmi->connector, mode); - - if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) - frame.avi.colorspace = HDMI_COLORSPACE_YUV444; - else if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV422) - frame.avi.colorspace = HDMI_COLORSPACE_YUV422; - else - frame.avi.colorspace = HDMI_COLORSPACE_RGB; + frame.avi.colorspace = HDMI_COLORSPACE_RGB; return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI, 0, 0, 0); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) { - struct hdmi_data_info *data = &hdmi->hdmi_data; - int c0_c2_change = 0; - int csc_enable = 0; - int csc_mode = 0; - int auto_csc = 0; int value; - int i; /* Input video mode is SDR RGB24bit, data enable signal from external */ hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL1, v_DE_EXTERNAL | @@ -327,43 +314,13 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) v_VIDEO_INPUT_CSP(0); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); - if (HDMI_COLORSPACE_RGB == data->enc_out_format) { - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); - - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, - m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, - v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | - v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); - return 0; - } - - if (data->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { - csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; - auto_csc = AUTO_CSC_DISABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_ENABLE; - } - } else { - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { - csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; - auto_csc = AUTO_CSC_DISABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_ENABLE; - } - } - - for (i = 0; i < 24; i++) - hdmi_writeb(hdmi, HDMI_VIDEO_CSC_COEF + i, - coeff_csc[csc_mode][i]); - - value = v_SOF_DISABLE | csc_enable | v_COLOR_DEPTH_NOT_INDICATED(1); + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, m_VIDEO_AUTO_CSC | - m_VIDEO_C0_C2_SWAP, v_VIDEO_AUTO_CSC(auto_csc) | - v_VIDEO_C0_C2_SWAP(c0_c2_change)); + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, + m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, + v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | + v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); return 0; } @@ -425,8 +382,6 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_info *display = &hdmi->connector.display_info; u8 vic = drm_match_cea_mode(mode); - hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; - if ((vic == 6) || (vic == 7) || (vic == 21) || (vic == 22) || (vic == 2) || (vic == 3) || -- 2.43.0