From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE0E8C433EF for ; Tue, 12 Oct 2021 20:50:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6A4060C4B for ; Tue, 12 Oct 2021 20:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235069AbhJLUwe (ORCPT ); Tue, 12 Oct 2021 16:52:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234047AbhJLUwd (ORCPT ); Tue, 12 Oct 2021 16:52:33 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37029C061570 for ; Tue, 12 Oct 2021 13:50:31 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id pf6-20020a17090b1d8600b0019fa884ab85so2789601pjb.5 for ; Tue, 12 Oct 2021 13:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=niP7v3xFwLnCjLXmT0nzm06tTYa6qI3k7igZv8TEJsc=; b=MrnlfgVEgsrzhHRtZFc5utknl/ytW5WjQcYfTv2HnZ6fS9lKKuW+F42Nrbx+gHripS Xc2RIA6gaKDSc/bn3xBmR20a0BtY+7gzFpyZmggMd//w3Ub3xZ+2jCun1uq9tVGlgJIT sVMI8bJ+eODJIFrgH34toluuVDOHJLd8ha9UY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=niP7v3xFwLnCjLXmT0nzm06tTYa6qI3k7igZv8TEJsc=; b=EzYH18vnTAtxEZmBKQbf+m4f37QvT7OCNdcCJhRhmL0WIFZQhFYNRjfsN4ADlDW9P/ VjjNheNABOKHIjJ1aIPzc5qrtpdFilV/7vLTTZC+nzwJFsVyE46Eyh4b607Wt6qCkxwZ ULiOUdl/lrrh10e9a6k+IP9MKwtLBAo8EFQhHAprtgOs4QPQeH78qAIxyLN8S9vxfZ27 gDc10WtHmYWdfTk3YjD2EoXFI8ORWQCJwIjFcAXOleSycWEnw2r/DqVKZK5Ij2LAXM5d LtbfMrlrZThEUv/RTDUDPuFsWHI3H68S2M45oeSel5GkGbRb3oNj1ffPPkJR82I8glKY mymw== X-Gm-Message-State: AOAM533l7N2tBbA4Q06D++GSzoYMUa9fAd01J+HotfnW3X7nDc/iIM1r C+6zWJnPDfdj+vEgoyl32q5yXVAPAh/g/g== X-Google-Smtp-Source: ABdhPJwMrNZVf/uCIGNke+KhPOuFe2TfzE2YxhhhBLQHGfz84Sz3avFPR0sXDjQkafDtZXBlu7WWGw== X-Received: by 2002:a17:90a:7d05:: with SMTP id g5mr8568637pjl.14.1634071830488; Tue, 12 Oct 2021 13:50:30 -0700 (PDT) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com. [209.85.215.176]) by smtp.gmail.com with ESMTPSA id s20sm12294899pgq.85.2021.10.12.13.50.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Oct 2021 13:50:30 -0700 (PDT) Received: by mail-pg1-f176.google.com with SMTP id r2so231242pgl.10 for ; Tue, 12 Oct 2021 13:50:30 -0700 (PDT) X-Received: by 2002:a6b:f915:: with SMTP id j21mr25937447iog.98.1634071515111; Tue, 12 Oct 2021 13:45:15 -0700 (PDT) MIME-Version: 1.0 References: <20211006024018.320394-1-lyude@redhat.com> <20211006024018.320394-5-lyude@redhat.com> In-Reply-To: <20211006024018.320394-5-lyude@redhat.com> From: Doug Anderson Date: Tue, 12 Oct 2021 13:45:04 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 4/5] drm/dp, drm/i915: Add support for VESA backlights using PWM for brightness control To: Lyude Paul Cc: Intel Graphics , dri-devel , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , Rajeev Nandan , Satadru Pramanik , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Sean Paul , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Oct 5, 2021 at 7:41 PM Lyude Paul wrote: > > @@ -1859,8 +1859,7 @@ drm_dp_sink_can_do_video_without_timing_msa(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) > static inline bool > drm_edp_backlight_supported(const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE]) > { > - return (edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP) && > - (edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP); > + return !!(edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP); > } nit: I don't believe that the "!!" is needed in the above. C should automatically handle this since the return type of the function is "bool". I've reviewed the generic (non-intel) code and it looks like a reasonable approach to me. Reviewed-by: Douglas Anderson From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C1F5C433EF for ; Tue, 12 Oct 2021 20:53:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F132B60F3A for ; Tue, 12 Oct 2021 20:53:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F132B60F3A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6145389F19; Tue, 12 Oct 2021 20:53:30 +0000 (UTC) Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by gabe.freedesktop.org (Postfix) with ESMTPS id 34D5689EB4 for ; Tue, 12 Oct 2021 20:53:29 +0000 (UTC) Received: by mail-pg1-x529.google.com with SMTP id m21so226609pgu.13 for ; Tue, 12 Oct 2021 13:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=niP7v3xFwLnCjLXmT0nzm06tTYa6qI3k7igZv8TEJsc=; b=MrnlfgVEgsrzhHRtZFc5utknl/ytW5WjQcYfTv2HnZ6fS9lKKuW+F42Nrbx+gHripS Xc2RIA6gaKDSc/bn3xBmR20a0BtY+7gzFpyZmggMd//w3Ub3xZ+2jCun1uq9tVGlgJIT sVMI8bJ+eODJIFrgH34toluuVDOHJLd8ha9UY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=niP7v3xFwLnCjLXmT0nzm06tTYa6qI3k7igZv8TEJsc=; b=qmwchODHm2eD6Ya7APWv3RF3hnzsZk42zvDLrpw9e6/iA9fR+pIdyEMAFzA5Dhq559 Pfw7QeWsof/4o9XfFaxwBMsTH2JvJjyHpVM5Uk7g29RVg+83GrMpm1RRyD5w5wqRe2Hq /M/c6FauTsHn0rZSjwRYfYi+R8xN39X074HK9AxHIaaBavfTj5YezlfODCZIZV3zMV8v YV3xq/4yxkoAIkZZhcmThspY++lNCGJjh2f2ra6ce8Vr5qEFQOmV9B/zwtdyZFmj6M3X snDRf65q1yqs0CffhT0LZ/hGuXNVLLL8/n6TNXJIWJTgVOjfvDGK6rSHPHN326ioBcBV MPXA== X-Gm-Message-State: AOAM533ipzWeAFQxiskceDqmlsD6zVpmxxjjQOGEGJWfqxTJoTyS7SMl MHUi2eNeFZ81iYgYckqUUFoS1IzHVtbQiQ== X-Google-Smtp-Source: ABdhPJxXLDCh6V1BDhkPDb3Qdtq3mHNY43b9aJyuGdSphhL5fcJS6LG+z/ZL/pOdQ5Ej6xYPUaxTaQ== X-Received: by 2002:a63:f05:: with SMTP id e5mr24310323pgl.226.1634072008545; Tue, 12 Oct 2021 13:53:28 -0700 (PDT) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com. [209.85.210.179]) by smtp.gmail.com with ESMTPSA id w19sm3782988pjy.9.2021.10.12.13.53.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Oct 2021 13:53:28 -0700 (PDT) Received: by mail-pf1-f179.google.com with SMTP id w6so541241pfd.11 for ; Tue, 12 Oct 2021 13:53:28 -0700 (PDT) X-Received: by 2002:a6b:f915:: with SMTP id j21mr25937447iog.98.1634071515111; Tue, 12 Oct 2021 13:45:15 -0700 (PDT) MIME-Version: 1.0 References: <20211006024018.320394-1-lyude@redhat.com> <20211006024018.320394-5-lyude@redhat.com> In-Reply-To: <20211006024018.320394-5-lyude@redhat.com> From: Doug Anderson Date: Tue, 12 Oct 2021 13:45:04 -0700 X-Gmail-Original-Message-ID: Message-ID: To: Lyude Paul Cc: Intel Graphics , dri-devel , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , Rajeev Nandan , Satadru Pramanik , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Sean Paul , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , open list Content-Type: text/plain; charset="UTF-8" Subject: Re: [Intel-gfx] [PATCH v3 4/5] drm/dp, drm/i915: Add support for VESA backlights using PWM for brightness control X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hi, On Tue, Oct 5, 2021 at 7:41 PM Lyude Paul wrote: > > @@ -1859,8 +1859,7 @@ drm_dp_sink_can_do_video_without_timing_msa(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) > static inline bool > drm_edp_backlight_supported(const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE]) > { > - return (edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP) && > - (edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP); > + return !!(edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP); > } nit: I don't believe that the "!!" is needed in the above. C should automatically handle this since the return type of the function is "bool". I've reviewed the generic (non-intel) code and it looks like a reasonable approach to me. Reviewed-by: Douglas Anderson From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E5AEC433F5 for ; Mon, 18 Oct 2021 17:19:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03ADE6103B for ; Mon, 18 Oct 2021 17:19:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 03ADE6103B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C6B06EA93; Mon, 18 Oct 2021 17:18:35 +0000 (UTC) Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E70D89D67 for ; Tue, 12 Oct 2021 20:45:18 +0000 (UTC) Received: by mail-il1-x132.google.com with SMTP id x1so425351ilv.4 for ; Tue, 12 Oct 2021 13:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=niP7v3xFwLnCjLXmT0nzm06tTYa6qI3k7igZv8TEJsc=; b=MrnlfgVEgsrzhHRtZFc5utknl/ytW5WjQcYfTv2HnZ6fS9lKKuW+F42Nrbx+gHripS Xc2RIA6gaKDSc/bn3xBmR20a0BtY+7gzFpyZmggMd//w3Ub3xZ+2jCun1uq9tVGlgJIT sVMI8bJ+eODJIFrgH34toluuVDOHJLd8ha9UY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=niP7v3xFwLnCjLXmT0nzm06tTYa6qI3k7igZv8TEJsc=; b=OmD1E3F+wMkCUGK5F6SyMpPMZ94pMOl11qsAi6Np5v9zwD1PtMDKZL4JWlh5DesN3/ 8kz53KV/hGXEHjKuxd38Xtkn/QoqgWS63Zv0lw6jb1wwbnOcbE0Fn1UHqoLmAOQ0NaKJ QKM2Jtux9JegxDeApRStwaSAuMjGLrYQUZAOP40BsesLesWH/7HVUFBq5EIFXaCIeGEW tJcT1Ja+GVKGZto+5vMdcWZduyoIe68oAIQT0QnXpPggFPv9HKkjoB7cMw1Fg6rNpNI9 Xl41vLTgVTTuUjcCjZE0kifmasuFh1X8GfZlhoOGE/nY90uMu+5HTIL470RM7XJ1N+W/ kVqg== X-Gm-Message-State: AOAM532wNkud7Ed+Cc1dvkR3iftbl3SrUheiaeuizSHy667DT302RoJF uWAuVj1l8+qnMgC+BdKOG8NoLkzGylh4Qg== X-Google-Smtp-Source: ABdhPJz8CvClB0ChZ53x12h90qoyg1ERUK+tZ627EW/KoOs7WF4UhfjIKWLee4I28FuH8BZJYQXilA== X-Received: by 2002:a05:6e02:1646:: with SMTP id v6mr15080516ilu.140.1634071517224; Tue, 12 Oct 2021 13:45:17 -0700 (PDT) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com. [209.85.166.49]) by smtp.gmail.com with ESMTPSA id y30sm6280692iox.54.2021.10.12.13.45.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Oct 2021 13:45:15 -0700 (PDT) Received: by mail-io1-f49.google.com with SMTP id e144so379025iof.3 for ; Tue, 12 Oct 2021 13:45:15 -0700 (PDT) X-Received: by 2002:a6b:f915:: with SMTP id j21mr25937447iog.98.1634071515111; Tue, 12 Oct 2021 13:45:15 -0700 (PDT) MIME-Version: 1.0 References: <20211006024018.320394-1-lyude@redhat.com> <20211006024018.320394-5-lyude@redhat.com> In-Reply-To: <20211006024018.320394-5-lyude@redhat.com> From: Doug Anderson Date: Tue, 12 Oct 2021 13:45:04 -0700 X-Gmail-Original-Message-ID: Message-ID: To: Lyude Paul Cc: Intel Graphics , dri-devel , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , Rajeev Nandan , Satadru Pramanik , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Sean Paul , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , open list Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Mon, 18 Oct 2021 17:18:27 +0000 Subject: Re: [Nouveau] [PATCH v3 4/5] drm/dp, drm/i915: Add support for VESA backlights using PWM for brightness control X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" Hi, On Tue, Oct 5, 2021 at 7:41 PM Lyude Paul wrote: > > @@ -1859,8 +1859,7 @@ drm_dp_sink_can_do_video_without_timing_msa(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) > static inline bool > drm_edp_backlight_supported(const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE]) > { > - return (edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP) && > - (edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP); > + return !!(edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP); > } nit: I don't believe that the "!!" is needed in the above. C should automatically handle this since the return type of the function is "bool". I've reviewed the generic (non-intel) code and it looks like a reasonable approach to me. Reviewed-by: Douglas Anderson