From patchwork Thu Nov 2 13:41:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13443767 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 107F5C4332F for ; Thu, 2 Nov 2023 13:42:26 +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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tVcHXXClF2kFCuXITA5TgZIt9Oxw5j26SAOAerunR0U=; b=oNorE+iba4sZsr hO1CDeUIHpWZEMclxrbZ1DBFu6ph51FG3KLYnfB987Zwo391aMxD/ixjiD9nm9+8UU2Qebshhn4Q9 KSZkp+R83WPZRTyTvxwoJTCaETH4LX+WyrPlatUKlDumYrZtR+vqqtPZtI6v/O0OZlVYsdSZd/tvD DLH+R3Bh5VOEAX7KU5xv1PuU1n6F1LmrV/iwRXaNF4h22h3L5OyEXMmiu/vhMxyMEAsKI/uiXzfcH 5Hjxdw4rS8+YMQ0F10p+6IXRaznVpKCwV1vqWdnQCHvkmehse2/LbXSgZYZI667g2iLMMA/BkKzLL HF1cBkYbGJFGzg05IgWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qyXxL-009YNq-2R; Thu, 02 Nov 2023 13:41:55 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qyXxJ-009YMo-2j; Thu, 02 Nov 2023 13:41:55 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9c603e235d1so137631266b.3; Thu, 02 Nov 2023 06:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698932510; x=1699537310; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=525ntZUU9IDbVV4Jw2CWfdlqQxiLo8Ec66BuDOeD0GA=; b=SgCf33+HWXXCOJs5EgW0NnHL5P+o9yqCQRjL3ebqjCX8JEUn8GGTLmQzUrC0vi96UA 3ld6OJIn0dqOEelF+yaBA3Fl5Fpxr4NomXj/XZjFcLRaClK62Tg7PAB7VDF/naYUfQ4+ jN/8tmTo77369BvW7/7A35pZmuGgDlolSXFmDP4fKnpJzqEfO39hLY6ZgnkzIsWJfF4c MKjb1c12tLY/Ru2/+bNJ8rGIAMRQ6rvuC5rAc2MgAVk2XMT9+GEtpogfDg2n45boOCvy tkpXaQv/hXn3eIXJch/FO/ZAtzvtCrVBjtL9fB5UN0/HWEgfUDDFifBLQF83wY6rJu+d igIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698932510; x=1699537310; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=525ntZUU9IDbVV4Jw2CWfdlqQxiLo8Ec66BuDOeD0GA=; b=QvqToY6EFZLQu/Gb8lJFOqfU9A0QBXk/Lsh8AO+FJIeSrUbEOKLibuYRLTFKzs8nJa S5O1B9k/AJ2iNzJEZQJ8MpyRjRHRhn3advzV9nU/GkvCF6V1ddQSHwE7F1EL/ZzTe3QF zebNGGhCP+FVZKveEw9w1LRZBpiW2yl7byKOS4pms04P9LuHSDn/NwGTL4oTojegXB7a 0WbyXStwYgGH7y5cOwkdQPTVam2PV9DVHa1oHVmn23wYoWwCsSnatarj67kzJQoqKFWT 04IyoQAFTv1JYLJHfbFGFldEEZOM2v1FDDPwA19LJbTUbHX1CYr8KJcN8u46EO3mxe6I dDXw== X-Gm-Message-State: AOJu0YziqurOu4C7Vget3Xxw+aA5ckKNCTs7sIg66hwp1CpfBpuFrTKu LuDOLJlrw6RacCHxgfSlePs= X-Google-Smtp-Source: AGHT+IH973wFt6bqHW7cDZN0wKW+UkKsLKCaRg36hSJokndjWn786idIO5cQuLHCEfTXF8UIDskt1w== X-Received: by 2002:a17:906:eec3:b0:9b2:b153:925 with SMTP id wu3-20020a170906eec300b009b2b1530925mr3895676ejb.21.1698932509891; Thu, 02 Nov 2023 06:41:49 -0700 (PDT) Received: from [192.168.2.1] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id hb9-20020a170906b88900b009adcb6c0f0esm1157638ejb.193.2023.11.02.06.41.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Nov 2023 06:41:49 -0700 (PDT) Message-ID: <5649ac03-db92-42a9-d86a-76dfa1af7c64@gmail.com> Date: Thu, 2 Nov 2023 14:41:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 From: Johan Jonker Subject: [PATCH v1 1/4] drm/rockchip: rk3066_hdmi: Remove useless mode_fixup To: hjc@rock-chips.com, heiko@sntech.de Cc: airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: Content-Language: en-US In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231102_064153_882487_8862051E X-CRM114-Status: UNSURE ( 9.90 ) X-CRM114-Notice: Please train this message. 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 The mode_fixup implementation doesn't do anything, so we can simply remove it. Signed-off-by: Johan Jonker --- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 9 --------- 1 file changed, 9 deletions(-) -- 2.39.2 diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index fa6e592e0276..5c269081c691 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -434,14 +434,6 @@ static void rk3066_hdmi_encoder_disable(struct drm_encoder *encoder) rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_A); } -static bool -rk3066_hdmi_encoder_mode_fixup(struct drm_encoder *encoder, - const struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) -{ - return true; -} - static int rk3066_hdmi_encoder_atomic_check(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, @@ -459,7 +451,6 @@ static const struct drm_encoder_helper_funcs rk3066_hdmi_encoder_helper_funcs = { .enable = rk3066_hdmi_encoder_enable, .disable = rk3066_hdmi_encoder_disable, - .mode_fixup = rk3066_hdmi_encoder_mode_fixup, .mode_set = rk3066_hdmi_encoder_mode_set, .atomic_check = rk3066_hdmi_encoder_atomic_check, }; From patchwork Thu Nov 2 13:42:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13443773 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 A4A31C4167B for ; Thu, 2 Nov 2023 13:42:44 +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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=p3Q+hxJ2RBvaKg22fIhmDDe21UnaXZZYdRuNE4a+5N8=; b=DNMI0WG/yLLGPJ w4E0lgFzh324Q2KqS0BCsHSrdyHfHl4WGjfK8CMPMVbKdhmWZFFqif3/k6DprRiDKfdvczjRymBte BKaxl8MHVjOvtvYRKq1oWL2ug5v7rlZjlSRtFGrKBIU6RsSF29jQ9F93Juxf6piV7zrGm19xwX3U+ phRrV9j7y4ZNWmZEVzTdUFdCzit3cJj70Hf5eflL9OrnYmWs7gZcO7KSv100KPIj7PgF7K+JbJrFA u1LnpjtsPWco7pWIzNKx0N/rxaTAu0E4et07V03EweunPOVuVtg8E/wP8fhL2lAk5iLB8Oc84Ds48 gcGhxN4JFIEYe8Ut9VSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qyXxc-009YSB-0Y; Thu, 02 Nov 2023 13:42:12 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qyXxZ-009YQr-1M; Thu, 02 Nov 2023 13:42:10 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53e2dc8fa02so1558630a12.2; Thu, 02 Nov 2023 06:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698932526; x=1699537326; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=lK/vWnmM0KVaM6vCg3VvvClqSJH14OWzepShm2ndJ8I=; b=c+f2Q5kBUzN+BSJ18IDlgFn3+5iWS6bnuz5Zv82ra/EUGDvaYs/N2qMOUFYto5FFYa 6pGLDuzpEJSBdIJEVUUaYjktlx91c5hpcz9vBAf4BFoadxyWBs6LLVHaCJkIsLz4JgAp FYNSrte5Hpn/BbYwAj3UkTUAd0RwZaRyJ4Hd6204avAVRUMAe62hfJI9vKiTcTXOTaUK 2ntm/r0fkg7gik9ih9nK4dcCdLx7TE62kfA0aUplbl7zMGEsfcNVFJ0RRq5GtiYRgwXh QL02gduU/2eAXmZmOvh7ZQ5/YsuU+UB7s8mfw35covbmltYqD/25DOGtdb05UwMeYV/G pNLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698932526; x=1699537326; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lK/vWnmM0KVaM6vCg3VvvClqSJH14OWzepShm2ndJ8I=; b=imOSD5P1SczqlPe456H3ZLZJM88z0PL05XOvVtrmsCZfcGWXe2MJdWMzOLowyhqIZx ySRuLCPhO7uSnSYyoYUb4P3bpmW2vXodBVro3SqgMrPGzmH0sCEtlQ3bOEwutHZ1JV00 8dq+K1bzwRAe0pBO0yRT/jsvXCaSMeancXh+4GfC/98mn0YLv88NgX6qei/NTXXtc+EV NL+gG2hz6qED7uJzODVDWrc2bG4spMYgTLL6LqWKU0KkIIXqx3oTDAGx69E+dOQrSNua ScxSQ8BdAjgj0mUBpJJ9FPub+KXWTWgePshD9S4YOEuI83bRp7Ydjq2Dm5J8t1ZnlaSe Jmmg== X-Gm-Message-State: AOJu0YyoPgqlfygg9ohCc8KAdxNsj+8wJ9VVlsWCOr63uZ+KHhomnwuz RLJC2q26cmNp/ytoXTGG01E= X-Google-Smtp-Source: AGHT+IGV7tL5vnuqy+ywj5JlmDgSzOHEisn1VYUrvxqfFveF+L1CIsGQpPMLlZCZMZDql2U/Dza06A== X-Received: by 2002:a50:9544:0:b0:543:595a:8280 with SMTP id v4-20020a509544000000b00543595a8280mr7749934eda.37.1698932526017; Thu, 02 Nov 2023 06:42:06 -0700 (PDT) Received: from [192.168.2.1] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id q32-20020a05640224a000b0054130b1bc77sm2347915eda.51.2023.11.02.06.42.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Nov 2023 06:42:05 -0700 (PDT) Message-ID: <034c3446-d619-f4c3-3aaa-ab51dc19d07f@gmail.com> Date: Thu, 2 Nov 2023 14:42:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 From: Johan Jonker Subject: [PATCH v1 2/4] drm/rockchip: rk3066_hdmi: Switch encoder hooks to atomic To: hjc@rock-chips.com, heiko@sntech.de Cc: airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: Content-Language: en-US In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231102_064209_463670_AF81BC9D X-CRM114-Status: GOOD ( 13.62 ) 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 The rk3066_hdmi encoder still uses the non atomic variants of enable and disable. Convert to their atomic equivalents. In atomic mode there is no need to save the adjusted mode, so remove the mode_set function. Signed-off-by: Johan Jonker --- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 35 +++++++++++++------------- 1 file changed, 17 insertions(+), 18 deletions(-) -- 2.39.2 diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index 5c269081c691..0e7aae341960 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -55,7 +55,6 @@ struct rk3066_hdmi { unsigned int tmdsclk; struct hdmi_data_info hdmi_data; - struct drm_display_mode previous_mode; }; static struct rk3066_hdmi *encoder_to_rk3066_hdmi(struct drm_encoder *encoder) @@ -387,21 +386,21 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi, return 0; } -static void -rk3066_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) +static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder); + struct drm_connector_state *conn_state; + struct drm_crtc_state *crtc_state; + int mux, val; - /* Store the display mode for plugin/DPMS poweron events. */ - drm_mode_copy(&hdmi->previous_mode, adj_mode); -} + conn_state = drm_atomic_get_new_connector_state(state, &hdmi->connector); + if (WARN_ON(!conn_state)) + return; -static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder) -{ - struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder); - int mux, val; + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); + if (WARN_ON(!crtc_state)) + return; mux = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder); if (mux) @@ -414,10 +413,11 @@ static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder) DRM_DEV_DEBUG(hdmi->dev, "hdmi encoder enable select: vop%s\n", (mux) ? "1" : "0"); - rk3066_hdmi_setup(hdmi, &hdmi->previous_mode); + rk3066_hdmi_setup(hdmi, &crtc_state->adjusted_mode); } -static void rk3066_hdmi_encoder_disable(struct drm_encoder *encoder) +static void rk3066_hdmi_encoder_disable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder); @@ -449,10 +449,9 @@ rk3066_hdmi_encoder_atomic_check(struct drm_encoder *encoder, static const struct drm_encoder_helper_funcs rk3066_hdmi_encoder_helper_funcs = { - .enable = rk3066_hdmi_encoder_enable, - .disable = rk3066_hdmi_encoder_disable, - .mode_set = rk3066_hdmi_encoder_mode_set, - .atomic_check = rk3066_hdmi_encoder_atomic_check, + .atomic_check = rk3066_hdmi_encoder_atomic_check, + .atomic_enable = rk3066_hdmi_encoder_enable, + .atomic_disable = rk3066_hdmi_encoder_disable, }; static enum drm_connector_status From patchwork Thu Nov 2 13:42:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13443774 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 6CF74C0018C for ; Thu, 2 Nov 2023 13:42:58 +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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lPiqVGM6aFuUS1qjO5z0/FNlD0FQMIP2NNpMCNji3vU=; b=V4j1EIScsAjAhO aANqMHj02mGlJL9p0LR3nbtGSUyHEg78+aPbpHBxQgDI/+JPwGbH3dsF0lP8rc79KU+Gs+UMx2wP7 inTuiCIJ4ygT/IG1cX2dSsmwUDfcamSp+kYWMtcokAguTBG5ZnQrveHMDHYOVkiy1NHdzj44IQIFU iJUBV8/vi/EmFmn2CACQs+OZB7usUvoDqjfCg32YTsJ9JUODqg/5m29kZIMfOTCqp1XROvr6iObhu FTl6uVfR5jvdL46/GQ98MGQeNiyyRBqgo+4ypXl5YJUz/9TRERYU+TL5ML7ZHeGSUIgxTJPlBEAEl UBRq5KR1sQLyO/bKED0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qyXxr-009YXd-1X; Thu, 02 Nov 2023 13:42:27 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qyXxo-009YVV-0w; Thu, 02 Nov 2023 13:42:25 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9d274222b5dso152100566b.3; Thu, 02 Nov 2023 06:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698932540; x=1699537340; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=5ij4W2R7Rk89TAWTRo2Z11H1sJFKrF9K18A1hdSCONQ=; b=SWTfWDKOvMfUPTvGKxvlGHRwxQ8vr00Z7j/6EzGbKB7uKrabufpRyVTEPsYkJUjQxy 9CYTmNie/M+N9uc5VXZGD2c72zJ038WitUuB5iAy3dAHMp1pwIn1kP8JQ/TSQizfxEBF NVdfRiyIs2uSKqQb5wLKfkd6/WbmGJ98scOP3bDHgdSmg25ucKciII+AoAPesHMiuTzh OgXgKCTIUIzKMXhaE0NysxLfnbOA/xuJnkyOrhU4gnA6Rp7ay4W76mU4zIUJNKSYv960 C2oAX5fK1+vaasQ24XHb3gS83RgSt2DStSC7NeHyl+zSOA1th4xHu9E1tMHV+G6/nK0p lU/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698932540; x=1699537340; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5ij4W2R7Rk89TAWTRo2Z11H1sJFKrF9K18A1hdSCONQ=; b=HLezOx6T0e+1km0s10OaCaUOYo6qlb4RjxdNQwRrds/Z9QTFH9xr5ZRsct1YNdxVc2 LvQzR1PY+TJIQtGRwrSBCgAPBjUf9uV3YDBAH95z2CeL+igpi349LLgmjkmJ/48lWEot Qf/CnwZJUYbjXkuEyvsB+lFVUbCS1ktOZjZqIWoCzwp7zXI6tAp4p8YRK5h05VtzVAO7 5R1qh0v38OcX/mZr50ORprTyU4bzPPGJYE/UVdn6c4lpQn0ogMbQEznqAYzzHU93PBtO vTWUdaYeDdK6kowQu9clPj17Nq3NkA1XSwVvMtjo8+pxfsBAFLRhQvjmCR4vznEMP6oz Chdw== X-Gm-Message-State: AOJu0Yyk7KpbOvwww8VRLguNmhrF+5nq/bCw7d31OvCTphFpWNXAlqqU 2s73NrTo0IyTIwBsmYKPOVg= X-Google-Smtp-Source: AGHT+IF6LP+ml1ogEFi5qh8KFdD9Bqg3MegxZWCzvRijCiVmpR9CqHGHL0atdCUWnRBs0neVN5QPqg== X-Received: by 2002:a17:907:60ca:b0:9c7:4d51:af08 with SMTP id hv10-20020a17090760ca00b009c74d51af08mr4508255ejc.43.1698932540595; Thu, 02 Nov 2023 06:42:20 -0700 (PDT) Received: from [192.168.2.1] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id j8-20020a170906278800b009be14e5cd54sm1153220ejc.57.2023.11.02.06.42.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Nov 2023 06:42:20 -0700 (PDT) Message-ID: Date: Thu, 2 Nov 2023 14:42:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 From: Johan Jonker Subject: [PATCH v1 3/4] drm/rockchip: rk3066_hdmi: Remove useless output format To: hjc@rock-chips.com, heiko@sntech.de Cc: airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: Content-Language: en-US In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231102_064224_331576_93C45F07 X-CRM114-Status: GOOD ( 11.13 ) 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 The Rk3066 hdmi output format is hard coded to RGB. Remove all useless code related to colorimetry and enc_out_format. Signed-off-by: Johan Jonker --- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) -- 2.39.2 diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index 0e7aae341960..f2b1b2faa096 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -23,8 +23,6 @@ struct hdmi_data_info { int vic; /* The CEA Video ID (VIC) of the current drm display mode. */ - unsigned int enc_out_format; - unsigned int colorimetry; }; struct rk3066_hdmi_i2c { @@ -200,14 +198,7 @@ static int rk3066_hdmi_config_avi(struct rk3066_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.colorimetry = hdmi->hdmi_data.colorimetry; + frame.avi.colorspace = HDMI_COLORSPACE_RGB; frame.avi.scan_mode = HDMI_SCAN_MODE_NONE; return rk3066_hdmi_upload_frame(hdmi, rc, &frame, @@ -329,15 +320,6 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi, struct drm_display_info *display = &hdmi->connector.display_info; hdmi->hdmi_data.vic = drm_match_cea_mode(mode); - hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; - - if (hdmi->hdmi_data.vic == 6 || hdmi->hdmi_data.vic == 7 || - hdmi->hdmi_data.vic == 21 || hdmi->hdmi_data.vic == 22 || - hdmi->hdmi_data.vic == 2 || hdmi->hdmi_data.vic == 3 || - hdmi->hdmi_data.vic == 17 || hdmi->hdmi_data.vic == 18) - hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; - else - hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; hdmi->tmdsclk = mode->clock * 1000; From patchwork Thu Nov 2 13:42:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13443775 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 8521AC4332F for ; Thu, 2 Nov 2023 13:43:13 +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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aA9P0G5HB2H0JOy0QocGuXdINnLCBiJOEMLm3cWHTrc=; b=c1P3zZqitkYw63 6WcsAj3MU5XgbgtcdU0V//cGRwwcNIPgMM0tDYyLmkWFZCZLnldsILp0mKHM4NhoFx9mZu+2Mmjcm UAw36t7Skex6tg7oXJ2J2intiUbQJeqdc0t8zfyV0Ls4gpHGg4oqARG+PPESkblH5YoAGPufQVkP5 N+nq74arCr2ZZw6JN0tBSOliGVxwC/Ye8JhBgA7QR7lPw9ka2tAk+IxVq8LXf6aOZB6KsbBlW0Qm4 TkKgPF/M8ActpGHBu9mW+lrfDMs7TK18ve9r4oIPR8YJ6VXqyCAuKfwKEMrOiDH0u2jBkHm0vgKzl OHoWwEpbaWQj0Rc57trw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qyXy3-009Ybl-2e; Thu, 02 Nov 2023 13:42:39 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qyXy0-009Ya8-1V; Thu, 02 Nov 2023 13:42:37 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-53e2dc8fa02so1559650a12.2; Thu, 02 Nov 2023 06:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698932554; x=1699537354; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=mtT6nxgsYYS4sdsaY7t86FYZfBLOlduBaZpsVAIl6mA=; b=GK4SHirQJ3UKo0/2yQZ5WWvfFpcpdnTL3xPIGtd1fOgmCf0YbtI7zY7bfMzc5DCw3v Lu5efuRoy7xjpOGhgErGMBXdbLAnntoO08vDdHaQaMCz+dectIaLE0AzRFTA0PHNUw8r 7RdVZtudJaxYSowyim7Eqga9cLbAQXQk53gZ13LUYsLRwC3HlREAFfV0Nhj2y6A05iOi EKuTqJFdm0uxMvnmwkAgmPoQV+G4tH+Nqbw9dq8gw79QXaqUNIe/zW/SSoezz7FJjnVS 8B3wNGi0f3onJzZZ5IZSl8a1lQRunICNzYfHsopHT68Hp5KKZPmeteKuXeb5NS8LPNpv 0m6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698932554; x=1699537354; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mtT6nxgsYYS4sdsaY7t86FYZfBLOlduBaZpsVAIl6mA=; b=rl6qoghZ0VuIZBVIbLxGcn+1utsLe1Q1EUgAzvkxi8QjXCwieAahKlXjFEFURvy7Hj AOCVW7OrGAqa2xTCAKNY+hurZfUXcecZgpxeNI0pETpkefO/yM1zgiBAJbScjAA1yE+e Y0ZOk97B0tvARpW96MwJL9/Gew0pSCd9ahh0WGVXuKCt1t2CGHsj6IfIcc3yfYZX4CkP TBs0hyCCDVrRUhzegbrPNaG3eYs4gQriXNbunrqal+t0/VGZPJvPknrnilolfk08A0PZ dUOkZWUW7zb0Ms1nM997QwS2TDFyg/cpB1hQstfEV0PI1uzNMy3NNbKYVEfpEDuL4/Gy XsqQ== X-Gm-Message-State: AOJu0YwZ3NCzUxODZZ+2gtMruPYBTygkDUhhBCC7n3nyiZ9V1LRanlZk w6l2+k7xgStb6LV72toeQLk= X-Google-Smtp-Source: AGHT+IGhrHVKX8Mcwu1ULzEU38/CACnkgTDqYLqxetznwQ5sVClFv+wxqUtm2VH+CqBwnOqPQHgfDw== X-Received: by 2002:a05:6402:2029:b0:53d:a7d9:5149 with SMTP id ay9-20020a056402202900b0053da7d95149mr14483614edb.6.1698932554131; Thu, 02 Nov 2023 06:42:34 -0700 (PDT) Received: from [192.168.2.1] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id v3-20020a50d583000000b0053e89721d4esm2378618edi.68.2023.11.02.06.42.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Nov 2023 06:42:33 -0700 (PDT) Message-ID: <813a0e30-a61d-7fc9-9ca6-11bf9c6fbe52@gmail.com> Date: Thu, 2 Nov 2023 14:42:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 From: Johan Jonker Subject: [PATCH v1 4/4] drm/rockchip: rk3066_hdmi: Remove unused drm device pointer To: hjc@rock-chips.com, heiko@sntech.de Cc: airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: Content-Language: en-US In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231102_064236_505194_5A6ADCE0 X-CRM114-Status: GOOD ( 12.62 ) 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 The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM device but is never used anywhere in the driver. Let's remove it. Signed-off-by: Johan Jonker --- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 -- 1 file changed, 2 deletions(-) -- 2.39.2 diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index f2b1b2faa096..c51520ec58d2 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -38,7 +38,6 @@ struct rk3066_hdmi_i2c { struct rk3066_hdmi { struct device *dev; - struct drm_device *drm_dev; struct regmap *grf_regmap; int irq; struct clk *hclk; @@ -734,7 +733,6 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master, return -ENOMEM; hdmi->dev = dev; - hdmi->drm_dev = drm; hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) return PTR_ERR(hdmi->regs);