Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3070591lqo; Tue, 14 May 2024 20:46:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTNBVCIIfshYuFRh/GnrqqK/7sKN5lyThyZkINM2zSzdV72d9RPyXa2pUbslDKgc6PSirs6iUDNc6HId+SsDlJrELI85E/Kt3/W+VO8Q== X-Google-Smtp-Source: AGHT+IGit7V+iKyQffm9ds5FA3OPtlyiNe8ypFsLeHK0q3QZo7SLoJv/lcps3Qpf+Arqiz/fQoHi X-Received: by 2002:a17:906:410b:b0:a59:ad76:b371 with SMTP id a640c23a62f3a-a5a2d292a8amr1232682166b.26.1715744770683; Tue, 14 May 2024 20:46:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715744770; cv=pass; d=google.com; s=arc-20160816; b=s2sF5iljPA7IZNbiTf2iwW7NFTOrO7F1u6Bq/P3xeqJJi6CLzjdlp5N5Q+UNiVRs1K XzsRNP14XlbR7mPoYr2KOb4MMn04Y6oLZ5W1FPBAT4HgPtp4TaDxlUmMJ5+hHZrCx268 2qoCS1osNskiyT7rYMfR3U34tNAb2EpBJHnsdjve/6ghhHiRXMAEYl1Zpo3nTw9/QaYF /IyBpcZWpWlluMwLEEDEoD0faV+xizAfwd5c/8jI3GhDsxssTpSf16HwA9C8RCwHFm36 Z986xWg0HRs8rw7R2GRpzirAPS8MxzFX5FCcaBAaOz+6/K4hl8v+d51oB4TrDYn4ydjg zMhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:in-reply-to:message-id:date :subject:cc:to:from; bh=IDfK+LWRw30DacTQwsm/ZBF/iaYFjjIQV8UXvUuTHVI=; fh=1FPmWCobOJhV8BtLDD7CbiLh7aZS1w5zEEvnyKmj2+Y=; b=kR0pjmluCn68efjExxlPWwX6RwvQPa6DMp/73n5c1KVGQxKxqRasvr3bIP+ZdjXzqO zfUYyRx/QEEHdd/3BfxiIUOaUkPQ7FwJlXl5QhV0jlgBlHShmWDYiLZi02dPYXiXLAuH RFAi3XlQQ5RPLuzYps60jSQAcI+bAoojrliICM7O/XOIMJkfecPphOoTWCLL04hvSax1 EXLXL678NBAS2B9nRY4V7Id5y51lax5d5KfoFLOkgIFh8mp7fn86mafxPNsnD2vz/9as YWzNz1LFMeYk6kNjPX0Kfew75P5Z67XduaZvfrC0ak3eKkzNcjeSNlDXlEHqZ0IYkhxw 8aEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=nfschina.com); spf=pass (google.com: domain of linux-kernel+bounces-179381-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179381-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba3b76si721780566b.631.2024.05.14.20.46.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 20:46:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179381-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=nfschina.com); spf=pass (google.com: domain of linux-kernel+bounces-179381-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179381-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6AF951F22833 for ; Wed, 15 May 2024 03:46:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EE513838A; Wed, 15 May 2024 03:46:04 +0000 (UTC) Received: from mail.nfschina.com (unknown [42.101.60.195]) by smtp.subspace.kernel.org (Postfix) with SMTP id 845B037142; Wed, 15 May 2024 03:45:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=42.101.60.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715744763; cv=none; b=Qa+oIUM/62tEf/h2HVH2FW3AjxCa0BEzO1j7QtgW84iFaJnelx9iN9mJ8xxl3McjEhpwpxwGqluRQPEtIpxqusZRZkQD6KKPcZ/uj2LFsZlXN9C6jRmck8jIzoXYa3szd0CeGnMKJZ2stX1nKeO3M2IxFWgUOE8lyB7tcCnF5NA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715744763; c=relaxed/simple; bh=bSk2pktMR0TCwUGzbqyIW1/sI5S2OHHcWRq8iKG2hfQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type; b=HX9aO3fK5Czk3D/F7NDr/8khAegzScD6+Pd8TqFn6oVxTcZIF94FZZHoaioUkJbIsq6ZA2Bir50f+CS6b6AgeIJAL8OTcBB6bwvTHaPblfdKR4XlhVXHbC8OlVflC2Blki23G0eydmaeNAkhVtITBpaK4Mdyc7+yhOlwElPFhxE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com; spf=pass smtp.mailfrom=nfschina.com; arc=none smtp.client-ip=42.101.60.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nfschina.com Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id CB660602637E5; Wed, 15 May 2024 11:45:20 +0800 (CST) X-MD-Sfrom: dengxiang@nfschina.com X-MD-SrcIP: 180.167.10.98 From: dengxiang To: hdegoede@redhat.com Cc: dengxiang@nfschina.com, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, prime.zeng@hisilicon.com, rafael@kernel.org, tony.luck@intel.com, wanghuiqiang@huawei.com Subject: Re: [PATCH] ACPI: video: Use vendor backlight on Lenovo X1 Carbon. Date: Wed, 15 May 2024 11:45:01 +0800 Message-Id: <20240515034501.12772-1-dengxiang@nfschina.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <2db5beba-500b-458e-9fc3-f05bb982172c@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Hans, > A couple of remarks / questions: > 1. Looking at the strings you match on this is not for a Lenovo X1 Carbon, > but rather for a Lenovo Kaitan model ? So it seems that the commit message > and the comment for the quirk need some work. ok, I will add DMI_PRODUCT_VERSION & DMI_BOARD_NAME to make a distinction between X1 Carbon and other kaitian models. > 2. I have never heard of a zx_backlight interface before and there certainly > is no upstream driver providing this. I believe you need to explain what > is going on in a bit more detail here and then we can see if this really is > the best way to fix this. It seems that these Lenovo Kaitan laptops are > using Zhaoxin Kaixian x86 processors with integrate graphics. I would expect > the zx_backlight interface to be provided by the driver for the Zhaoxin Kaixian > integrated graphics in this case. And if that is the case then the integrated > graphics driver should use BACKLIGHT_RAW (aka native) for the backlight type > and with that change this quirk should not be necessary . Yes, zx_backlight interface has been provided by the driver for the Zhaoxin Kaixian integrated graphics. Also use backlight_device_register("zx_backlight",...). Strangely enough, X1 Carbon laptops will generate two native acpi_video as belows: lrwxrwxrwx 1 root root 0 5月 14 16:20 acpi_video0 -> ../../devices/pci0000:00/0000:00:01.0/backlight/acpi_video0 lrwxrwxrwx 1 root root 0 5月 14 16:20 acpi_video1 -> ../../devices/pci0000:00/0000:00:01.0/backlight/acpi_video1 As you see, it will conflict with the same pci bus, then zx_blacklight interface can't be shown on the path /sys/class/backlight/. That is to say, zhaoxin driver contain key code as belows: #if DRM_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) if(acpi_video_get_backlight_type() != acpi_backlight_vendor) { return ret; } #endif If i remove the key code, this laptops will generate two native acpi_video and zx_backlight on the sys backlight patch. Once add acpi_backlight=vendor parameter into kernel cmdline, just zx_backlight interface has been left on the sys path, which mean that both acpi_video0 and acpi_video1 interface can not be found. > 3. Vendor specific backlight interfaces are normally only found on really > old laptops. Since Windows XP laptops typically use the ACPI backlight > interface and since Windows 8 they typically use the GPU's native > backlight driver. So adding a quirk to use a vendor interface in 2024 is > weird. Again can you explain in a lot more detail what is going on here, > but I guess the backlight class device is provided by the driver for the > integrated graphics and in that case the fix is to simply change the type > of the backlight device registered by the igfx driver to BACKLIGHT_RAW. As mentioned in 2 questions above zhaoxin drivers had used backlight_device_register("zx_backlight"...) as BACKLIGHT_RAW. > 4. You posted the same patch twice ? Sorry, i was wrong to think that before patch would be missed by you. also i forgot about the time zone difference. I am sorry for any inconvenience that I have brought to you. Best Regards, dengxiang