From patchwork Fri Nov 28 19:14:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurabindo Pillai X-Patchwork-Id: 5405841 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 83CF8BEECA for ; Fri, 28 Nov 2014 19:56:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 684E0201FA for ; Fri, 28 Nov 2014 19:56:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3D1F1201E4 for ; Fri, 28 Nov 2014 19:56:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEE3C6E43A; Fri, 28 Nov 2014 11:56:28 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by gabe.freedesktop.org (Postfix) with ESMTP id 65D486E376 for ; Fri, 28 Nov 2014 11:14:56 -0800 (PST) Received: by mail-pa0-f51.google.com with SMTP id ey11so7293819pad.38 for ; Fri, 28 Nov 2014 11:14:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-type; bh=yeQ1osxXlrq1chwRATvW7nXcQ6HMutOqaPnzCuDhasQ=; b=ZDRG5qgVqaQazKe2DI/0LJJTjNLNA1fWK1N34ayCZAuuxr7j01v1R9j9ZrUqZfrxcx LR6PhdKiYH6tXhBn/KAGVgwW6tyR1lp3tqFrt9ieOzbim0C6dnPpUy9kizw8gxeXdo46 bAt2929JR49Qo6PvA4nJIHgZwnVKBPJTm7Hn/ihdShoZozbYwXVYsqCSN3oqLoB4qxW0 VvaixHSf7/u+GZjCOD3BzQBkKe7CIGn6t8SIVfMls9+4E405BC6SWo11cBJH1BbrTzgc nFya67KNaE9kBPzlfDA4Kj+bX/q3Fa2iX4Ufzx6j8UtfT51t0vCd0cwsumjrybKgcZGf DAAw== X-Gm-Message-State: ALoCoQlh0xA8zuT6gQC0Uvffwl+i2yie7WPfM3bilxWTDrmLqyirffb5l6VgKeMi0/CfhkemCYyN X-Received: by 10.66.235.165 with SMTP id un5mr75748178pac.109.1417202096553; Fri, 28 Nov 2014 11:14:56 -0800 (PST) Received: from [192.168.1.103] ([117.198.107.67]) by mx.google.com with ESMTPSA id ez1sm10599261pdb.86.2014.11.28.11.14.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Nov 2014 11:14:55 -0800 (PST) Message-ID: <5478C9AA.2010600@aurabindo.in> Date: Sat, 29 Nov 2014 00:44:50 +0530 From: Jay Aurabind User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Daniel Vetter , Jani Nikula , David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/i915 Trouble with minimum brightness X-Mailman-Approved-At: Fri, 28 Nov 2014 11:56:24 -0800 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello all, I notice that some activity has been going on with the minimum value of display brightness recently (e1c412e7575). But the minimum value thats currently chosen is not at all acceptable for my eyes. My display is working perfectly without that restriction on minimum intensity. I tend to stare at the screen a lot and the current minimum settings is straining my eyes. Even if you say that it may not be good for the devices, I still insist, because I want my *display* to fail first, not my eyes. So please try providing a way for the needy users to override this minimum settings. I hope adding a module parameter would be easy fix. Something like this: ? (I dont call myself a kernel programmer yet, just scratching the surface) Provide provision for users to disable restriction on minimum brightness value introduced in: commit e1c412e75754ab7b7002f3e18a2652d999c40d4b Author: Jani Nikula Date: Wed Nov 5 14:46:31 2014 +0200 drm/i915: safeguard against too high minimum brightness There are systems which work reliably without restriction on minimum value of display brightness. Also the arbitrary value may be too high for many users as well. Signed-off-by: Aurabindo J --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_params.c | 6 ++++++ drivers/gpu/drm/i915/intel_panel.c | 14 ++++++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 16a6f6d..55d2ead 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2213,6 +2213,7 @@ struct i915_params { int disable_power_well; int enable_ips; int invert_brightness; + int restrict_min_brightness; int enable_cmd_parser; /* leave bools at the end to not create holes */ bool enable_hangcheck; diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c index c91cb20..0601c2a 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -46,6 +46,7 @@ struct i915_params i915 __read_mostly = { .prefault_disable = 0, .reset = true, .invert_brightness = 0, + .restrict_min_brightness = 1, .disable_display = 0, .enable_cmd_parser = 1, .disable_vtd_wa = 0, @@ -155,6 +156,11 @@ MODULE_PARM_DESC(invert_brightness, "to dri-devel@lists.freedesktop.org, if your machine needs it. " "It will then be included in an upcoming module version."); +module_param_named(restrict_min_brightness, i915.restrict_min_brightness, int, 0600); +MODULE_PARM_DESC(restrict_min_brightness, + "Restrict minimum brightness " + "(-1 disable restriction, 0 value from VBT, 1 arbitrary value )"); + module_param_named(disable_display, i915.disable_display, bool, 0600); MODULE_PARM_DESC(disable_display, "Disable display (default: false)"); diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 41b3be2..def9f4e 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -1109,10 +1109,16 @@ static u32 get_backlight_min_vbt(struct intel_connector *connector) * against this by letting the minimum be at most (arbitrarily chosen) * 25% of the max. */ - min = clamp_t(int, dev_priv->vbt.backlight.min_brightness, 0, 64); - if (min != dev_priv->vbt.backlight.min_brightness) { - DRM_DEBUG_KMS("clamping VBT min backlight %d/255 to %d/255\n", - dev_priv->vbt.backlight.min_brightness, min); + if (i915.restrict_min_brightness < 0) + min = 0; + else if (i915.restrict_min_brightness == 0) + min = dev_priv->vbt.backlight.min_brightness; + else { + min = clamp_t(int, dev_priv->vbt.backlight.min_brightness, 0, 64); + if (min != dev_priv->vbt.backlight.min_brightness) { + DRM_DEBUG_KMS("clamping VBT min backlight %d/255 to %d/255\n", + dev_priv->vbt.backlight.min_brightness, min); + } } /* vbt value is a coefficient in range [0..255] */