Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp383046rdb; Mon, 29 Jan 2024 05:25:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkdRD6KgfDjARvsgqCCWVoOpSRxESOiiyycAWe0GMOh9PPmBsxqBuoAVoyKTdsIURSGInF X-Received: by 2002:a05:6402:40d4:b0:55d:3b94:a1c6 with SMTP id z20-20020a05640240d400b0055d3b94a1c6mr4124275edb.0.1706534701408; Mon, 29 Jan 2024 05:25:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706534701; cv=pass; d=google.com; s=arc-20160816; b=guV/GaD0dTX+74c+alJp95P3z6rKWUQcbWLG5S1eSKMl7q5kMQZhn9xMXbBRFYSKFA iyhQdUyV7U8gmezFtMc4yp7DheOTeWwVzIebVMpH6aIlE/lR4Ds5AGwarzV30ZjCYlkI T6ZEwiZd6ZhRZwHM1/XaYmMaPogB8CRbxscDH0MN5o/imG9IT5bm8uercLER0i36ErsK w+sQrclVAtWk6OzJU4EADs0dfW6q/oogHHgcIk6Y7nj+SInQktZqi6ygMBVUOMwvQZHo zeqAB1qR/NemH0M4Eq8DrczaODHLW5CxcIjG1R/P3gEB0b+MVkffOmFXO3fJ8IU3h+B6 t0fQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=BGlFJrp2hLINa9F8XlDW2FVIbAYnTd96Mns8ZAb4VDE=; fh=I80qXc/iera7wa09Idg7OQzvPORritXFfb2S7WWdgXE=; b=yv/Nr7IpLrMr9uXBR5bxuvHUfg0eSD6pEYsZ0m31B+vXzuZd8/FMEDfX8X1R+BGLNg aR8YJcshMq2h2Lds5VlHVYnSGXxyUS7IY7I6WXuJBWPkvirh7s2OzBE6elF5/R74CZ+I 2qLFkz7DT9nTL83cN72NgFd5954ErfG02bker5AxL35Z4+5Cict2n11K80j9ZVpPVgap h7ByDLua5h3Lq9GAATRjxTuntLuLRrkxpO8AFNJbxCpVPDWbGje0LM4V2/cx9km02Nld LnsFOqnx9VWf1zr145tyJyyQvAoCy6wAqCuwVYnDiEVm3ITz7UdSka5wY7qPz78AgRSQ DC6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LE9nM9Qb; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-42788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id eo15-20020a056402530f00b0055a808e5d09si3504970edb.526.2024.01.29.05.25.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 05:25:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42788-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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LE9nM9Qb; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-42788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 07CB61F266A3 for ; Mon, 29 Jan 2024 13:25:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BFB0763416; Mon, 29 Jan 2024 13:24:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LE9nM9Qb" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AF2B6312A for ; Mon, 29 Jan 2024 13:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706534683; cv=none; b=Ng7oJBbgSQaZMudAvGPjU32/ft9OxEq/5sap5xCiSjmpgM+bSxFAmOFxeKFGUZCaIpmA9cHTTOVBAlYxs3uvE+UIfQnDt6GsG7tEY48Sl7T7R1VhYuUvbKBtouEv46y5eIMSKC7ZHhqqHhspFa6DycYMkYZR/3O2EooI3xOzRh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706534683; c=relaxed/simple; bh=XFRkpCkjwF0wDR3+g+hgQk3lmDL24IjFiHznsNLd29M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MW1fDl3zdK2JyN0eoBbaHfCBeTrnZlOWQNvZw5VNvjjk7EonTUAvUsQj/mzkQP+sXXlyZkuMpF4IF5aDGUmEZumMdVgOic4sQPqz7bBVmra/UcSElu0WLKTSa3FiVR1BJlhLk36+Ljq62njyoIa1XuaQGokXxDDKB2S0xMep2Jk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=LE9nM9Qb; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706534681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BGlFJrp2hLINa9F8XlDW2FVIbAYnTd96Mns8ZAb4VDE=; b=LE9nM9QbBArryu1EWIwiRCBlcVlfpyYBDhT87Vc8GWB2EwFZhbEpps1wvCGtG/tf4Jlv4/ ZbbWFebuZR7YTzp7kkKjpWUeqyAxKlYnQS0ryAcoplqh09AmWBns9EEiauVoK15eQNcboN J7R7vXJgejGXUEAQ79EN7b4OYmzcyIg= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-660-4x98DNUsOwCMF_Ox-ezcjQ-1; Mon, 29 Jan 2024 08:24:39 -0500 X-MC-Unique: 4x98DNUsOwCMF_Ox-ezcjQ-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-5101e82696bso1941962e87.0 for ; Mon, 29 Jan 2024 05:24:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706534678; x=1707139478; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BGlFJrp2hLINa9F8XlDW2FVIbAYnTd96Mns8ZAb4VDE=; b=h/EmvY2xAsUSayrKDDgGOKHHwKU0n93b1TBikcj122ObIRoNvYxI/2PMeh4aWViIt1 X1c+barm+JD3HfYZKUXp+WPd8kr5o2RNMrXYqMxsgHLyNIRhlf90QDS9xbrqOrRwTliy XU/fKX1A5FYB8PXLyErUKz7X4dIsYCXXUcBMThPG+h5VDC542yFBwCx83nsF1tzcgRFu 0yW6x7TREdDOM9SVtqAQZXD4yFLEdskE14Ely/4K5VihEK6kImQyrJB6td+Q8o6jukrb 6XMJol2V5X+qf7oBbMLzV+e7oJ2g4t2bn0p88S+7d73Dg7NW/f65mPgfOnmozn9Qmm8O 9MoQ== X-Gm-Message-State: AOJu0YyxgavOgEpKzeJ1XtkjcF9Y7lN6GwKc0gx7FEVE9b5dmWi/tsRv RYTjLPeOKYmJFmMaukva+tA2lhG8oZ0KHtlgKj0jXdPVrOz0EQXEW+b0C4ClQgym3QgsghBZUoI z1QxGZR7C0Ri39hKv6jfMp9txU5JWErcxqcW+Ijx5Z6C5oiCgi/k+mF/rGUY30w== X-Received: by 2002:a05:6512:2019:b0:510:d7e:4cbe with SMTP id a25-20020a056512201900b005100d7e4cbemr2856037lfb.63.1706534677948; Mon, 29 Jan 2024 05:24:37 -0800 (PST) X-Received: by 2002:a05:6512:2019:b0:510:d7e:4cbe with SMTP id a25-20020a056512201900b005100d7e4cbemr2856016lfb.63.1706534677633; Mon, 29 Jan 2024 05:24:37 -0800 (PST) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id vg10-20020a170907d30a00b00a356c0fdd2csm2164303ejc.26.2024.01.29.05.24.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 05:24:37 -0800 (PST) Message-ID: Date: Mon, 29 Jan 2024 14:24:36 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Implement per-key keyboard backlight as auxdisplay? Content-Language: en-US, nl To: Pavel Machek Cc: Werner Sembach , Jani Nikula , jikos@kernel.org, Jelle van der Waa , Miguel Ojeda , Lee Jones , linux-kernel@vger.kernel.org, "dri-devel@lists.freedesktop.org" , linux-input@vger.kernel.org, ojeda@kernel.org, linux-leds@vger.kernel.org References: <87sf61bm8t.fsf@intel.com> <8096a042-83bd-4b9f-b633-79e86995c9b8@redhat.com> <4222268b-ff44-4b7d-bf11-e350594bbe24@redhat.com> <6bbfdd62-e663-4a45-82f4-445069a8d690@redhat.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, On 1/19/24 21:15, Pavel Machek wrote: > Hi! > >>>> 2. Implement per-key keyboards as auxdisplay >>>> >>>>     - Pro: >>>> >>>>         - Already has a concept for led positions >>>> >>>>         - Is conceptually closer to "multiple leds forming a singular entity" >>>> >>>>     - Con: >>>> >>>>         - No preexisting UPower support >>>> >>>>         - No concept for special hardware lightning modes >>>> >>>>         - No support for arbitrary led outlines yet (e.g. ISO style enter-key) >>> >>> Please do this one. >> >> Ok, so based on the discussion so far and Pavel's feedback lets try to >> design a custom userspace API for this. I do not believe that auxdisplay >> is a good fit because: > > Ok, so lets call this a "display". These days, framebuffers and drm > handles displays. My proposal is to use similar API as other displays. > >> So my proposal would be an ioctl interface (ioctl only no r/w) >> using /dev/rgbkbd0 /dev/rgbkdb1, etc. registered as a misc chardev. >> >> For per key controllable rgb LEDs we need to discuss a coordinate >> system. I propose using a fixed size of 16 rows of 64 keys, >> so 64x16 in standard WxH notation. >> >> And then storing RGB in separate bytes, so userspace will then >> always send a buffer of 192 bytes per line (64x3) x 14 rows >> = 3072 bytes. With the kernel driver ignoring parts of >> the buffer where there are no actual keys. > > That's really really weird interface. If you are doing RGB888 64x14, > lets make it a ... display? :-). > > ioctl always sending 3072 bytes is really a hack. > > Small displays exist and are quite common, surely we'd handle this as > a display: > https://pajenicko.cz/displeje/graficky-oled-displej-0-66-64x48-i2c-bily-wemos-d1-mini > It is 64x48. This is indeed a display and should use display APIs > And then there's this: > https://pajenicko.cz/displeje/maticovy-8x8-led-displej-s-radicem-max7219 > and this: > https://pajenicko.cz/displeje/maticovy-8x32-led-displej-s-radicem-max7219 > > One of them is 8x8. > > Surely those should be displays, too? The 8x8 one not really, the other one could be used to scroll some text one but cannot display images, so not really displays IMHO. Anyways we are talking about keyboards here and those do not have a regular x-y grid like your example above, so they certainly do not count as displays. See the long discussion earlier in the thread. Regards, Hans