Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp308873rdb; Thu, 22 Feb 2024 04:40:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVN9547AglDP5vE5VU5fQcioJ2cIviaUNANrpLjwCgClOyGoW5MYQUW53AEkRHOJZElYEJh1JudZpLMr99cQWc0twhrLAZLw6hArNyJrg== X-Google-Smtp-Source: AGHT+IHW34FT2NO0gwkortkJS/u7ksQpEludEoDCagRCSjX3AaaFr01wR/sxamph1eKNih/YvwYh X-Received: by 2002:a05:6a00:d5a:b0:6e4:76cf:5f1 with SMTP id n26-20020a056a000d5a00b006e476cf05f1mr7152859pfv.7.1708605611485; Thu, 22 Feb 2024 04:40:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708605611; cv=pass; d=google.com; s=arc-20160816; b=0KiNjtLWv8pgCO57EPFjUwRLbeob/eAvAnceTmgm42upZi6VTcWp8UzTnzTw3aAuAu C5ufffOTDiDWc7PvaAh9G5VIa4ArKv5BlRLlIpTMWPOuM+icuBZYr1lQuB5d0uFoeloh QTgek9uJVIfIu30wX8aYRFc9bJRZgPGp8KNTjpopSbuqK2fpOVeIs58JLerdr5kfm6rf JoSvFDo6pIDjaeYvGmIfKHvF0Wuxerhf3hbIp/pnzJFzOj17AM+kyAyRu3+bImi7jDAY G68qXirlcUXqa8Veg4qTjHQjpsNN9O/uumOqJyz6sCOq1fD7qihd2lXN5+3DGcNf1Paa lrSQ== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=BERBpKjH6+/bGhkBw+85S7JQ5x9o2AKS4RztDXQg4B4=; fh=0uRDjx3Z9OviUI320aR5GpNa3u/X8VZrxk+2yco6qpM=; b=snJrTsEHEXLhFKDDi1mjVPBtnxNPL7kjPHPlDiYh+JlfRARYs9qEYO//1Joblwr6ou 0aGy/iA9GuW07nGZRbvSx0sNZmlkeoG4zzJdfFL1tden7YJCnd+gYmcb1tHZM1syJRbz YmBb/dPsbyI2GkQLAVIPKvyWRuA4o21czXWBxchESdMIQPvheS6MDKDo0ok9Os/k5ObQ V5XDykaWQHeLDJS+tBVB8P+b7D0fvxtPuzpfekJZ4h90xg0GFkBwTgBCAG0DAoMUpeIP xS4082FBq8kpYoCAVnBdpqJ5Y81BRnpyLnLZpdN19CrL4lmFFfPgxVnfyDVguWJGN6jN Gc2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BeJWNPbz; 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-76523-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76523-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fh27-20020a056a00391b00b006e02c3f028csi10061385pfb.239.2024.02.22.04.40.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 04:40:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76523-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BeJWNPbz; 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-76523-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76523-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9283FB25B59 for ; Thu, 22 Feb 2024 12:39:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E95D12DD98; Thu, 22 Feb 2024 12:39:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BeJWNPbz" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 BAE3512D756 for ; Thu, 22 Feb 2024 12:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708605553; cv=none; b=UlFgqhkIcYQw7ukAYiyIRCyLpKHEpWF4E1zlnUWQqzezcRodMgC3JuzUdQjYNUEeWB003v0XfESLARB2rXP1FmT98GKsipz+vgrDOpy0IqLU7hfIsvI7bq7bhSYSEmJart6HnA8xFh04KXfDQEhdzowKOpw0U6xZplVrtvWDdLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708605553; c=relaxed/simple; bh=A9/2Z2e/Wolvr+TkJMMv6W92q5TwTKl5h3cwWrEQIqw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aEeE7vpMx7fY+muy+F/T6hBGHA2s7LRCK6PC0WJ+yiObSCj31t/QEl2ohO7hGo8LsQv4ejPJgO6nsLwSq3Obx2VC4fI1aZk8xHJatK2Us78kJKl+keH389B4GGvORTE88s9J1UzqnWib2Z/avqN7izUyvqjH6nVFAhbI6sCFnoA= 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=BeJWNPbz; arc=none smtp.client-ip=170.10.129.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=1708605550; 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=BERBpKjH6+/bGhkBw+85S7JQ5x9o2AKS4RztDXQg4B4=; b=BeJWNPbzDCebiWi6zA4I760T2e+nFaJbnHkzkkMXDKAyEx7tA4p+FPSWlaHcdVjseliyuL kUX0giCkY8LucPYLbDUlhV8+urqOvB/47OBYWsnJIBPjhK7vlfefHTxj+obw0S/VrAQRrQ UrV4xFyaoolBee/DwVukMoUVeFmcb4k= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-443-guD2SgfiM6y5fBebnaMrnQ-1; Thu, 22 Feb 2024 07:39:09 -0500 X-MC-Unique: guD2SgfiM6y5fBebnaMrnQ-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a3ee69976dfso154110066b.3 for ; Thu, 22 Feb 2024 04:39:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708605548; x=1709210348; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BERBpKjH6+/bGhkBw+85S7JQ5x9o2AKS4RztDXQg4B4=; b=tlI9d/4NC/oXfogNHVx4AYnV6CE6e3u26EmmpqMUv36OglnR5NyFCOBHlEp5r4xGcC pp6PDVfcNxfH2vY0AjBTDs0MNK5OwPH+66OcAh0cSkzPEN9Xq7mKMT7djnAQ0EhVvYqB j1Rdc5l/eJcjOE1uBuDriKlcbxHNlk+rvV5S9uLwe7IjurK84KPk8EP5Oz/r6F/6zqkJ +/eZHoPfQJXWfIkmWUU73dgoRivgSkfcrT0lk3hw6yBLXJj4hHcTGSQf1p830LKbGlOK M1GwwHlD8jbooQAIgImhzjlnDcjuUcpf1YFSiGX9SK1jWc5zFpVGll5QrAfMhK2dFl9Z jgVw== X-Forwarded-Encrypted: i=1; AJvYcCV9JVYHSjhH36tOeLSrB/GwkXq5GMuWp+5aAM+SOSKMkGB8uikA5v7IdUMTgt5HW7z71vKg4husu0F2yG3I22uSHl4ZY4mC4JEEsEEG X-Gm-Message-State: AOJu0YzKH8yVR2D49vINRj+ElvSzdp64JIrtaavbJi8CkARm7xMCi76d e+MynQumPV47owQsUYNK+I3enFTrABtFMyoa+hdq3oiOtu3g5nYqUSHRXBSScRCjWPZ7ArOmhNk DdEbbMNs1j/epuOLGOwTsnwXAte4AZUT/5IB0eekfcjrfXM+YGTOO/kWDOORgloL0Lv40OA== X-Received: by 2002:a17:906:407:b0:a3e:a3dc:45c9 with SMTP id d7-20020a170906040700b00a3ea3dc45c9mr7716004eja.72.1708605548117; Thu, 22 Feb 2024 04:39:08 -0800 (PST) X-Received: by 2002:a17:906:407:b0:a3e:a3dc:45c9 with SMTP id d7-20020a170906040700b00a3ea3dc45c9mr7715991eja.72.1708605547809; Thu, 22 Feb 2024 04:39:07 -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 lu16-20020a170906fad000b00a3d5efc65e0sm4599899ejb.91.2024.02.22.04.39.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Feb 2024 04:39:07 -0800 (PST) Message-ID: <825129ea-d389-4c6c-8a23-39f05572e4b4@redhat.com> Date: Thu, 22 Feb 2024 13:39:06 +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: Future handling of complex RGB devices on Linux v2 To: Gregor Riepl , Werner Sembach Cc: Lee Jones , jikos@kernel.org, linux-kernel@vger.kernel.org, Jelle van der Waa , Miguel Ojeda , "dri-devel@lists.freedesktop.org" , linux-input@vger.kernel.org, ojeda@kernel.org, linux-leds@vger.kernel.org, Pavel Machek References: <0cdb78b1-7763-4bb6-9582-d70577781e61@tuxedocomputers.com> <7228f2c6-fbdd-4e19-b703-103b8535d77d@redhat.com> <730bead8-6e1d-4d21-90d2-4ee73155887a@tuxedocomputers.com> <952409e1-2f0e-4d7a-a7a9-3b78f2eafec7@redhat.com> <9851a06d-956e-4b57-be63-e10ff1fce8b4@tuxedocomputers.com> <1bc6d6f0-a13d-4148-80cb-9c13dec7ed32@redhat.com> <477d30ee-247e-47e6-bc74-515fd87fdc13@redhat.com> <247b5dcd-fda8-45a7-9896-eabc46568281@tuxedocomputers.com> Content-Language: en-US, nl From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On 2/22/24 12:38, Gregor Riepl wrote: >> This certainly is the most KISS approach. This proposal >> in essence is just an arbitrary command multiplexer / >> demultiplexer and ioctls already are exactly that. >> >> With the added advantage of being able to directly use >> pass the vendor-cmd-specific struct to the ioctl instead >> of having to first embed it in some other struct. > > There's also the question of how much complexity needs to remain in the kernel, if vendor-specific ioctls are made available. > > Does every vendor driver implement a complex mapping to hardware registers? What about drivers that basically implement no mapping at all and simply forward all data to the hardware without any checking? The latter case would match Pavel's concerns, although I don't see how this is any different from the situation today, where userspace talks directly to the hardware via libusb etc. This whole discussion got started by embedded-controller driven keyboards in laptops with per key RGB lighting. We cannot just allow userspace raw-access to the embedded-controller. So these per vendor ioctl commands will need to do the minimum to make sure userspace cannot do bad things. But yes complex stuff like figuring out which LED(s) maps to say the enter key should be left to userspace. Especially since this can differ per keyboardlayout. > To be honest, I think the kernel shouldn't include too much high-level complexity. If there is a desire to implement a generic display device on top of the RGB device, this should be a configurable service running in user space. The kernel should provide an interface to expose this emulated display as a "real" display to applications - unless this can also be done entirely in user space in a generic way. We really need to stop seeing per key addressable RGB keyboards as displays: 1. Some "pixels" are non square 2. Not all "pixels" have the same width-height ratio 3. Not all rows have the same amount of pixels 4. There are holes in the rows like between the enter key and then numpad 5. Some "pixels" have multiple LEDs beneath them. These might be addressable per LEDs are the sub-pixels ? What about a 2 key wide backspace key vs the 1 key wide + another key (some non US layouts) in place of the backspace? This will be "2 pixels" in some layout and 1 pixel with maybe / maybe-not 2 subpixels where the sub-pixels may/may not be individually addressable ? For all these reasons the display analogy really is a bit fit for these keyboards we tried to come up with a universal coordinate system for these at the beginning of the thread and we failed ... Regards, Hans