From mboxrd@z Thu Jan 1 00:00:00 1970 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 7FAEA2D8796 for ; Thu, 30 Jul 2026 08:01:54 +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=1785398516; cv=none; b=edT/N555aulofMH7awWao8wSrcHoBPbHZQ5CpslC5IK6KMjsC8tLuuYQVCRZmSaA4jYQW1O7n+c+yqkeiuBFf4Kc7F+6ctKeJYilTDLomvFNfdy6nivr65iCNaHRlbekfKuLE973nGenS54PQ6/neHsgW/d5TkLowjg1YJv59ko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785398516; c=relaxed/simple; bh=J8kiMKjGyYvBIgDr/030CFd2UP+2ztxPnBOdrpWLj00=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=NO1uDVyeinaH1s+sZn1ZEZlXn+mS5bqwBAJZgBhLII6ujO585/UUou7fs6Gad9CWnBSwh/xm/3Hdq1ne5T/ZW01my70eW/KsnAnw1LA1xfWXPh+D986zHKha5HZ3+9L9slS5bOkOGcQ1fRHoCbjEhX9mzWTHVPP89oF1wslgZfY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=GSL41a4X; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=uElu6zsh; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GSL41a4X"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="uElu6zsh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785398513; 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: in-reply-to:in-reply-to:references:references; bh=ZRhh55uRwcmRO5vd0NulUAwd0U4XXcDtVd9jnzUnDak=; b=GSL41a4XgdiCoGHE2TBf/c+l51X9mYqjovgzwbCPt20MMZfErDNmDrIH9FuXtenWRqdvDQ K6QawZwYlQVn+AmgvEl4oq5RLP3Z/UWficsk9wp9RdAvr0FxmgYzSdz4XMyJUG2xt7olv7 J4iP1sgm4jTFqhp8TB0AkjZBHLrUzl4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-ytxVxT6xMQu3gVdPoxzsLA-1; Thu, 30 Jul 2026 04:01:51 -0400 X-MC-Unique: ytxVxT6xMQu3gVdPoxzsLA-1 X-Mimecast-MFC-AGG-ID: ytxVxT6xMQu3gVdPoxzsLA_1785398510 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4955fd77c18so11967855e9.2 for ; Thu, 30 Jul 2026 01:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1785398510; x=1786003310; darn=vger.kernel.org; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ZRhh55uRwcmRO5vd0NulUAwd0U4XXcDtVd9jnzUnDak=; b=uElu6zshLa9EDQOYTQ1qO41TA51Utj/dNOnO16zIUDrrjyVh2txAR0SkEKDjZ+YXEd blkYBy/KopfSDFrT0TesUrZecLZpB1Bpux0uizc8QzRAufH9O6QSqHXgVMzD/e2DmqFs 7IebS08YZxOHHoIuEHoDOHNC/Zm5//UlGCezWjQ1AopBYPFkSQ8/FFBFOgiWV5zo9INg Mb9TDJvLJtVn4EpMwrL2f24/4ppeXaf1UzZIswLxpW6Tf6/hmbHiXneROI7N+EoRP78A siyDPlpMXPlgpLTh6hGBsd8GqghRZhvyMmfZySuV3XmhoNFngVwkKjXlslPiXicMSNuO 052w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785398510; x=1786003310; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ZRhh55uRwcmRO5vd0NulUAwd0U4XXcDtVd9jnzUnDak=; b=j0YIiQb/ax0fbE3FdM03JoSla4GBkyKnOqa5DTVZpNBeDGZtk90NQAGrnWauwmI+ND qG7zslnTVsAaXMpcTOd4kuWsZ2Hz0GkpwxL3+7QAs3kA6y6brwYY9xH37zipq8rT1YE0 hLHo7pG1THPHD/2VPOVPXvTkmimmz7TKnDrvt2JoEexSuMpdJDJ7ZSfP5bX17ylgF4rB yBJ27UEhS73bWk/j0itHKPDOLgEUqfXO5xH6vQ1kJY59lhPBrSKdb7xUm58isuqLeqFL zG7Jf6PbKyFVHRBDfaiDfe1NCzZ1wQLKtpdul6LgCCcRNFvHDeX81dSpZfar4q/3swsH gzLQ== X-Forwarded-Encrypted: i=1; AHgh+RqrZptKTgGNzFvCTiseIHE1oHMdiXmBx0MpRP1U5It7tx1Vrrw3B9bscX7lKi7g2CHR7uM3Xe7vWm9g938=@vger.kernel.org X-Gm-Message-State: AOJu0YzxnXYV97o9QW+kpN1SA4ubFgYCVJo3QiqwuMht6Qznk/wIXiWU qMKkUP2u7VA0q1SP1qmTcZZD9jPpv6fFrmYf7mrWJkFdVFazg+nTqsdBGLdj3tdc+HPAgGkzVS2 Fp2Iw3kwulNXRRTsoJ2peaO3nuAAymPBHUNxXj+RxlQzgWfkR47zcsMDMzOtBCU5z2ZzyvWgt7g == X-Gm-Gg: AR+sD12YA7DsIigrFacnHdDkY8pgU0IsYd9JD8LJP0WonsPV33HnoWKB4shc249xU+u 5qk+hiV+LlfO6tgXV0d2yQc7XHHdJPh8MbzUOpRIqh4FNF5EPl5V7arQBOOiNklgKIDrmdgAwdX VZE/WUKWSI1QUnq1UxoTo27hdYpoSGNt7kY7z2wmX4AX9lTgiKuZCdK9W0niZURZN3YBt8AdN6O uaoUVZ9LMTlPkVrmKyrDy0ohYfYXYkolqnHfjDh9z6CRWdE9VUSHWybgXmyT9EPwY2j4gJnMzi2 c2qMPZku0D5cnHCqIwsKM3WpCkroJLBR/fQ2NcjtLD/q7+JdLrvDsuRMq5kfCj8OwzpGKzOpL25 h3rs6iBhIK+x1ugoURCgwPoJs7uuPKe9UQmlgbuelLoimgHbOKGFcg3JYXZQ= X-Received: by 2002:a05:600c:5248:b0:495:5e86:4e59 with SMTP id 5b1f17b1804b1-49800ead9c0mr18856365e9.22.1785398509887; Thu, 30 Jul 2026 01:01:49 -0700 (PDT) X-Received: by 2002:a05:600c:5248:b0:495:5e86:4e59 with SMTP id 5b1f17b1804b1-49800ead9c0mr18854415e9.22.1785398507984; Thu, 30 Jul 2026 01:01:47 -0700 (PDT) Received: from localhost (62-151-111-63.jazzfree.ya.com. [62.151.111.63]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-498010bb0e7sm37393845e9.15.2026.07.30.01.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 01:01:46 -0700 (PDT) From: Javier Martinez Canillas To: Amit Barzilai , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Amit Barzilai Subject: Re: [PATCH 1/2] drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init In-Reply-To: <20260729053054.29374-2-amit.barzilai22@gmail.com> References: <20260729053054.29374-1-amit.barzilai22@gmail.com> <20260729053054.29374-2-amit.barzilai22@gmail.com> Date: Thu, 30 Jul 2026 10:01:45 +0200 Message-ID: <87a4r8ewie.fsf@ocarina.mail-host-address-is-not-set> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Amit Barzilai writes: Hello Amit, Thanks for your patch. > ssd133x_init() wrote the SSD133X_CONTRAST_A/B/C commands with magic hex > values (0x91/0x50/0x7d). These are a per-channel white-balance > calibration: the A/B/C channels drive sub-pixels whose OLED materials > differ in luminous efficiency, so the values set the white point at full > brightness. > > Extract them into ssd133x_set_contrast(), which scales each channel by a > requested brightness via ssd130x_scale_contrast(), instead of writing the > calibration unconditionally. This makes the sequence readable, avoids > repetition, and is a prerequisite for wiring up an ssd133x backlight > controller that dims while preserving the white point. > > Note this changes the ssd133x power-on brightness. Previously the init > wrote the calibration unscaled and ignored ssd130x->contrast, so the > panel always booted at full brightness. It now scales by the shared > default contrast of 127, i.e. half of MAX_CONTRAST (255). This is > intentional and matches ssd130x, whose contrast register also defaults > to 127 (mid-scale), so all families now power on at ~50% and report > props.brightness = 127 / max_brightness = 255 to userspace. > > Assisted-by: Claude:claude-fable-5 > Signed-off-by: Amit Barzilai > --- Looks good to me. Reviewed-by: Javier Martinez Canillas -- Best regards, Javier Martinez Canillas Core Platforms Red Hat