From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Lu Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: restore backlight precision when converting from opregion Date: Mon, 05 May 2014 09:40:00 +0800 Message-ID: <5366EBF0.8090607@intel.com> References: <535DC8C1.5090407@intel.com> <20140428134147.GB32404@phenom.ffwll.local> <5365E935.4020703@intel.com> <20140504072232.GA22557@nuc-i3427.alporthouse.com> <5365ECB5.5070003@intel.com> <20140504104109.GB22557@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140504104109.GB22557@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Chris Wilson , Daniel Vetter , Nico Schottelius , "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org On 05/04/2014 06:41 PM, Chris Wilson wrote: > On Sun, May 04, 2014 at 03:31:01PM +0800, Aaron Lu wrote: >> On 05/04/2014 03:22 PM, Chris Wilson wrote: >>> Also this still has the same rounding error as before. >> >> I didn't get this, care to explain? > > The calculation you use, truncates, rather than say round to nearest, > would is the same discrepancy in your changelog. This patch is meant to fix the problem that when user specify the max backlight level in acpi_video interface, we will get the hardware max level too in i915. With this patch, the hardware level we will get is: level * freq / max = 255 * 937 / 255 = 937, which is correct. For other values, the truncates is OK: 254 * 937 / 255 = 933 253 * 937 / 255 = 929 ... ...