Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp979765ybe; Thu, 19 Sep 2019 06:56:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCR+yGzNAUOd6CjOf9jxumu47v8lVnvnTl8pe895rpPvN4euTQIt5bHtG01z5xxuUT3WKJ X-Received: by 2002:a17:906:1cc6:: with SMTP id i6mr14680111ejh.40.1568901372328; Thu, 19 Sep 2019 06:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568901372; cv=none; d=google.com; s=arc-20160816; b=aHHmBwOfBEOAH2RBZ3eiZ5D8yEZyY3m+yFwhR6I0g0ffZsHX6PmLFV6QLBgxzGOjHo 2v9SfKk7ig6LzxZl+X22ArgUrvBueakf0mYnWpsz+YTFoYUnKueBNvZe+O2s2Ui8+sLJ 7iMVEvLZjlWIrMvKvahhM39pcFRwvnRo46GCrrIfryTvNSYK2QE8RyjQrlV6opQosn8O Cka+71GmEGEThpgXX5jFISssnRAoRv2OHRaG6R52ghfroBkcPAWNf7gGj+TsZ2Ej/LUj T0zWrzAYiWgPJ3KEvkZcZLyoVo8ZitHqSefBoND86iWhFa7JdIec37irAfAvlm1AvUmu 852g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from; bh=f+3/Oae7pGwG3h9LRMCgkOeGj9KTM4ZU1NdyAOe8jTo=; b=0Bq7Fypc8qb8FqZSCth3NmC3tCrOWf17swT9s1/w2ur05Dg1qfRve6PwKA7tMHb8zu dJoJ+FxUExMXXAAX9O57yqBrwnEkbdqTB7aLp39dQ99/UdJDLgYyccAzA/QgEPpersa9 3YPuuhmrfEWjvKq1lcWdVWf+seUIqiTFsTdXQLaEZwaRrc1Vu8bMmk3cn093Ur/W2CY7 49iCdihC3yqoyR27+CXybx8YW+cAkocxB0mIpFv4UZo9YT8GW1RqdQo6dai2QQJ5+TuK lnQU4+yy91PWCz3CahkPa2+C6KC4h2n7B66pcVd0GmJpQIc0pIBmc/CqxkqhZeSr4YtW iieg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x51si5252390eda.272.2019.09.19.06.55.48; Thu, 19 Sep 2019 06:56:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389368AbfISMmP (ORCPT + 99 others); Thu, 19 Sep 2019 08:42:15 -0400 Received: from mga03.intel.com ([134.134.136.65]:19773 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387520AbfISMmP (ORCPT ); Thu, 19 Sep 2019 08:42:15 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 05:42:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,523,1559545200"; d="scan'208";a="188078303" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga007.fm.intel.com with ESMTP; 19 Sep 2019 05:42:10 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.164]) by IRSMSX101.ger.corp.intel.com ([169.254.1.129]) with mapi id 14.03.0439.000; Thu, 19 Sep 2019 13:42:09 +0100 From: "Lisovskiy, Stanislav" To: "daniel@ffwll.ch" , "Lee@google.com" , "furquan@google.com" , "Lee, Shawn C" , "airlied@linux.ie" , "joonas.lahtinen@linux.intel.com" , "jani.nikula@linux.intel.com" , "Vivi, Rodrigo" CC: "dri-devel@lists.freedesktop.org" , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "rajatja@google.com" , "marcheu@chromium.org" Subject: Re: [PATCH v2] i915: intel_dp_aux_backlight: Fix max backlight calculations Thread-Topic: [PATCH v2] i915: intel_dp_aux_backlight: Fix max backlight calculations Thread-Index: AQHVN7m50kn6eCuDw0iY+uDH/sgXWaczTncA Date: Thu, 19 Sep 2019 12:42:09 +0000 Message-ID: References: <20190711004312.248160-1-furquan@google.com> In-Reply-To: <20190711004312.248160-1-furquan@google.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.237.72.89] Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gV2VkLCAyMDE5LTA3LTEwIGF0IDE3OjQzIC0wNzAwLCBGdXJxdWFuIFNoYWlraCB3cm90ZToN Cj4gTWF4IGJhY2tsaWdodCB2YWx1ZSBmb3IgdGhlIHBhbmVsIHdhcyBiZWluZyBjYWxjdWxhdGVk IHVzaW5nIGJ5dGUNCj4gY291bnQgaS5lLiAweGZmZmYgaWYgMiBieXRlcyBhcmUgc3VwcG9ydGVk IGZvciBiYWNrbGlnaHQgYnJpZ2h0bmVzcw0KPiBhbmQgMHhmZiBpZiAxIGJ5dGUgaXMgc3VwcG9y dGVkLiBIb3dldmVyLCBFRFBfUFdNR0VOX0JJVF9DT1VOVA0KPiBkZXRlcm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