From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 4394E35CB81 for ; Tue, 27 Jan 2026 14:45:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769525140; cv=none; b=nFOCa/Mow2TVl/IgJbIppOrs0rPE+Qc76RZJcHd7L1olG/zuYcSrm8F8TMr+Fe7PRBCrFUUPjh8UHP5ALxRht4eSP0rkhS0e45A6uV82m55AFZOx2oh4dxdF/tvcuNWtOpK6846upRieqEuJ/mh5u2g18K00xb4QtrQQOHTMZDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769525140; c=relaxed/simple; bh=e1sWwSv80OatEESHNX0DybuhSsd7eY41H0DFmX4oGeo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GTVih5o/nPuj4reYqzw8+32HKoPojrLi4lEy++dwaY0IUqGNXSpn5G528Dvev8bZhYmTZRRY2Y0FbQX42XdVeSPz/W8hDVT/j4XXBt9NYJeig3IE7GRSuJvSAVdGFzs+sF8pmXy13JgGZNQQT6y89VhzP+CpNAo1qzzgrvW7jVs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=b0aFPsLv; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="b0aFPsLv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1769525138; x=1801061138; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=e1sWwSv80OatEESHNX0DybuhSsd7eY41H0DFmX4oGeo=; b=b0aFPsLvasahFv0P+yfMS8BXfDoQ40MFoJ+L8H7Ef3P7ymAI5FzViqRh Oyz04i9094dbyg2SMAcFgkl5I3Gj08Ci7QCgOFVJ7GaoK1rfdm5hfKITQ 1vQm0rWvCNR1CdXvmFffq5x6LG1Nu4/6JzWfmGYTNpEvj86oKOQdYulax s8IZAiNe3AWHvpFORfmihfkDCzJuFAsSp7S7qTGf4leAH5vow7fX78zFx oFFucxwyeGPmvfcuc3gxYIfh+AxRYQpkOhXAaKWzZReGLx5bu1dgcQRlZ OCkpGVk5SrAt/yD4O4VpGWSLhZyed0fxQJndjVys+KldoNL1VoRd8ADiA g==; X-CSE-ConnectionGUID: 0Z1ozGT4Sxm5k1mrpOJ1Pw== X-CSE-MsgGUID: axSsCor0QkKLnxpre1T0jQ== X-IronPort-AV: E=McAfee;i="6800,10657,11684"; a="69920666" X-IronPort-AV: E=Sophos;i="6.21,257,1763452800"; d="scan'208";a="69920666" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2026 06:45:37 -0800 X-CSE-ConnectionGUID: J6ERCFuqSGG9Zp1yKjVwXg== X-CSE-MsgGUID: 4JRLfM6FRGK/0g5JZKD6kQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,257,1763452800"; d="scan'208";a="230944425" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa002.fm.intel.com with ESMTP; 27 Jan 2026 06:45:34 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id D20FC98; Tue, 27 Jan 2026 15:45:32 +0100 (CET) Date: Tue, 27 Jan 2026 15:45:32 +0100 From: Andy Shevchenko To: Cristian Ciocaltea Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Sandy Huang , Heiko =?iso-8859-1?Q?St=FCbner?= , Andy Yan , Louis Chauvet , Haneen Mohammed , Melissa Wen , Robert Mader , kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Diederik de Haas Subject: Re: [PATCH v5 4/4] drm/rockchip: vop2: Support setting custom background color Message-ID: References: <20260127-rk3588-bgcolor-v5-0-b25aa8613211@collabora.com> <20260127-rk3588-bgcolor-v5-4-b25aa8613211@collabora.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=us-ascii Content-Disposition: inline In-Reply-To: <20260127-rk3588-bgcolor-v5-4-b25aa8613211@collabora.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Tue, Jan 27, 2026 at 10:45:36AM +0200, Cristian Ciocaltea wrote: > The Rockchip VOP2 display controller allows configuring the background > color of each video output port. > > Since a previous patch introduced the BACKGROUND_COLOR CRTC property, > which defaults to solid black, make use of it when programming the > hardware. > > Note the maximum precision allowed by the display controller is 10bpc, > while the alpha component is not supported, hence ignored. ... > + /* > + * Background color is programmed with 10 bits of precision. > + * Since performance is more important than accuracy here, > + * do *not* make use of the DRM_ARGB64_GET*_BPC() helpers. > + */ > + val = FIELD_PREP(RK3568_VP_DSP_BG__DSP_BG_RED, DRM_ARGB64_GETR(bgcolor) >> 6); > + val |= FIELD_PREP(RK3568_VP_DSP_BG__DSP_BG_GREEN, DRM_ARGB64_GETG(bgcolor) >> 6); > + val |= FIELD_PREP(RK3568_VP_DSP_BG__DSP_BG_BLUE, DRM_ARGB64_GETB(bgcolor) >> 6); There is FIELD_MODIFY() for a few cycles already. But here it probably makes no much difference. ... > + seq_printf(s, "\tbackground color (10bpc): r=0x%x g=0x%x b=0x%x\n", > + DRM_ARGB64_GETR(cstate->background_color) >> 6, > + DRM_ARGB64_GETG(cstate->background_color) >> 6, > + DRM_ARGB64_GETB(cstate->background_color) >> 6); Probably you want to have the alternative to the DRM_ARGB64_GETx() macros which incorporates a right-shift. But it all in regard to DRM style and preferences. -- With Best Regards, Andy Shevchenko