Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp74188pxb; Mon, 8 Feb 2021 15:42:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxY0xMUt67skHc31g5h9D7oB76km1pFzTeiqMycIYvjyA6d+CEmUqZmmELsGYsbVp/SYvs X-Received: by 2002:a05:6402:61a:: with SMTP id n26mr19500957edv.51.1612827759664; Mon, 08 Feb 2021 15:42:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612827759; cv=none; d=google.com; s=arc-20160816; b=h3GERWQmIIbNdLBn+b/MLfOBSMqUFi4+MCOkgaG8UuhcpjjZYCL+G/oI4pljMwY6xj NQH+wTFZCPuQS7PNwtbpKAzhCwCBxxDylz335Yb48eJDhR6h3j1m47c9yxezaijan7aE CkmjG15gxi2nZFWraZnllHnPF88ckM5X46PT7iG6hXncJTdVXvHVCNV6v7OJbbqWmLTK 06MgzgmtYK7swEecNmyaqj1qwtYrWt6yJQAxsxUsUNkRwP7ZbVQpmyyfkiQDeDa/Z4tB HdsKbW/16MUuLd2VFLek0shh762co4KTWM28mknY++OKycgors14qrYnxf5v81eG0s2o GG8g== 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=vhBX8GM+m/DtD9FKlAWyWCTWmDeNh7x5vL1LH8zHnJ0=; b=OVUkNeLuNXFnL2Fuzkt4S3/VOopqvhpLlbSXcfX6oUnxrKBk5YgAiW2DiAXwaP4jB4 OBouu0o/c3lBduao+L3HiZFdtZZ1c5M6kgYouosL1sSeVRL9UwQPsefc/C9EiGScmAjC bzOi73CI0D25cbwZ91k35GIWdFjZ/l68b/ZHvFdI2ekfEZ1ztxQZKDQUxciLyWxUE+/H cAYbFvENyQw9jrdxADCEM7I1CPIHvHqwQtzclkPw27CmsNEH3P7F9wHucYxlOUc142FE mrIvzsSSfUjwfJzpnixrVuIDcvNBLK1oLw5U6mfTuCfBeXIqz9/xIk46LGwbEFdEqdH/ qz2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aATXOHnX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si13989202ejd.122.2021.02.08.15.42.15; Mon, 08 Feb 2021 15:42:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aATXOHnX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbhBHXlK (ORCPT + 99 others); Mon, 8 Feb 2021 18:41:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20882 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231403AbhBHXky (ORCPT ); Mon, 8 Feb 2021 18:40:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612827566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vhBX8GM+m/DtD9FKlAWyWCTWmDeNh7x5vL1LH8zHnJ0=; b=aATXOHnXiOWW10v2um2rV7tWlf4se/oQWO8sQPTVK4G1QCfIcV60NLUtvqBGaxmddrcUlh vlJKjSWa9TgppUrHg1Vns5U25klmFnH7tPjK2zKDxLsGSXUGLwOx6DicL4REWFE2MLCf64 slYV9PAXg5QATmso0fXIbLCDpq1EI/Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-469-RPSy_GTIPN2eHqN7tlktyA-1; Mon, 08 Feb 2021 18:39:22 -0500 X-MC-Unique: RPSy_GTIPN2eHqN7tlktyA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DCD90107ACC7; Mon, 8 Feb 2021 23:39:20 +0000 (UTC) Received: from Whitewolf.redhat.com (ovpn-114-219.rdu2.redhat.com [10.10.114.219]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0996608DB; Mon, 8 Feb 2021 23:39:19 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Sean Paul , linux-kernel@vger.kernel.org (open list) Subject: [RFC v4 05/11] drm/i915/dpcd_bl: Cleanup intel_dp_aux_vesa_enable_backlight() a bit Date: Mon, 8 Feb 2021 18:38:55 -0500 Message-Id: <20210208233902.1289693-6-lyude@redhat.com> In-Reply-To: <20210208233902.1289693-1-lyude@redhat.com> References: <20210208233902.1289693-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Get rid of the extraneous switch case in here, and just open code edp_backlight_mode as we only ever use it once. v4: * Check that backlight mode is DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD, not DP_EDP_BACKLIGHT_CONTROL_MODE_MASK - imirkin Signed-off-by: Lyude Paul --- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c index c37ccc8538cb..57218faed4a3 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c @@ -382,7 +382,7 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state, struct intel_dp *intel_dp = intel_attached_dp(connector); struct drm_i915_private *i915 = dp_to_i915(intel_dp); struct intel_panel *panel = &connector->panel; - u8 dpcd_buf, new_dpcd_buf, edp_backlight_mode; + u8 dpcd_buf, new_dpcd_buf; u8 pwmgen_bit_count = panel->backlight.edp.vesa.pwmgen_bit_count; if (drm_dp_dpcd_readb(&intel_dp->aux, @@ -393,12 +393,8 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state, } new_dpcd_buf = dpcd_buf; - edp_backlight_mode = dpcd_buf & DP_EDP_BACKLIGHT_CONTROL_MODE_MASK; - switch (edp_backlight_mode) { - case DP_EDP_BACKLIGHT_CONTROL_MODE_PWM: - case DP_EDP_BACKLIGHT_CONTROL_MODE_PRESET: - case DP_EDP_BACKLIGHT_CONTROL_MODE_PRODUCT: + if ((dpcd_buf & DP_EDP_BACKLIGHT_CONTROL_MODE_MASK) != DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD) { new_dpcd_buf &= ~DP_EDP_BACKLIGHT_CONTROL_MODE_MASK; new_dpcd_buf |= DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD; @@ -406,13 +402,6 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state, pwmgen_bit_count) != 1) drm_dbg_kms(&i915->drm, "Failed to write aux pwmgen bit count\n"); - - break; - - /* Do nothing when it is already DPCD mode */ - case DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD: - default: - break; } if (panel->backlight.edp.vesa.pwm_freq_pre_divider) { -- 2.29.2