Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5460398imm; Tue, 19 Jun 2018 10:41:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLq6VT7i3gGuiHeN9vbNTyBaxyqkqGqdS8Rf7gX4mqnVaKx9rCkfL73b2yPk383icxXiffl X-Received: by 2002:a62:121a:: with SMTP id a26-v6mr19172930pfj.104.1529430105769; Tue, 19 Jun 2018 10:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529430105; cv=none; d=google.com; s=arc-20160816; b=ZZUeCgb+nCmw9rALGQpBID/3VMnSOBiHsJTjL2PWie3SYueD5Gzd3izdabez3qR51z rX0SEZ8tNP2VaByVw/GjkIWaMGA99djnv6uhfuwG+fb+KbN9vwpKa7Xq84ysYIgLmnbY j339tFzsYjMBMwcQj0g/WXYlRh1s7WgesFcY1dMaM/e3qSg4PYI0PPZBMTuOhM8jLLZC pQy66BTGzByda8wvSZuNWbZt8lCFYQ5uqu93OQlLwqVIOhZl714fcaWuxj7S0IhpIhd2 gCDVqRctaNkcgWJMvutJyKSNcny7O/sXHjYMM8Xvt/6w12hrJDGhb1hBscrFpEyfx6Mn AYUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Z9HCxUod5o3haaZtriFOXfv6gtd4Lk0dWnLWlGRf5rI=; b=IAn3/qONmmzhe23Dl0pY/e/1sdyweMExk4JgnK7OIORg/KJPXkXn4J/aGkAFWxksNg 1xSR0VNS9z8S4c33q9zLUHv/qx8MAC12hpR8kBIQCZldcE+5BiatfwQck1LRdG/H13Ue H55Ow7l1/Nvbh8VujFHCpQaKrXg14lLYjN2eIM+o47gxlDmwurG/nMJW0poNjoSQIlXm B6/zsVFcVmfVF0appYLi40fZQFoWK74o8egTMzTP1devF0Mqt7wlLPjR26JMCUTTFaM2 LxI0eDRjtCuTAy3RmFUDQEMlV0h7gjtZtz+waKICHcCs6dFzHFYtw3QoZcb+W4yVtPfY Oa6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=Gj5HlgZr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s36-v6si125041pld.278.2018.06.19.10.41.31; Tue, 19 Jun 2018 10:41:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=Gj5HlgZr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030313AbeFSRkp (ORCPT + 99 others); Tue, 19 Jun 2018 13:40:45 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:52610 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966650AbeFSRkn (ORCPT ); Tue, 19 Jun 2018 13:40:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Z9HCxUod5o3haaZtriFOXfv6gtd4Lk0dWnLWlGRf5rI=; b=Gj5HlgZrT3e8RsjbvYujfMBju TjOxWcFMutDuNxb3zHhUaei6ltMqIGt2h414V/3mouAlPU0H7iuY+pVC3JyvIgrDNueBYP7vNQAde 6Owwyn6iJAUBhL6IQPnhbs2BQ82oKFhbx1Wt+Q/ZN0QFegbYOVo8TZPbtwzm4CcgKwUYc=; Received: from n2100.armlinux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:53852) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1fVKc9-0002Fu-4u; Tue, 19 Jun 2018 18:40:21 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1fVKc3-0004FB-Rl; Tue, 19 Jun 2018 18:40:16 +0100 Date: Tue, 19 Jun 2018 18:40:12 +0100 From: Russell King - ARM Linux To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: Dmitry Osipenko , Laurent Pinchart , Thierry Reding , Neil Armstrong , Maxime Ripard , dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Alexandru Gheorghe , Ben Skeggs , Sinclair Yeh , Thomas Hellstrom , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 1/2] drm: Add generic colorkey properties Message-ID: <20180619174011.GJ17671@n2100.armlinux.org.uk> References: <20180526155623.12610-1-digetx@gmail.com> <20180526155623.12610-2-digetx@gmail.com> <20180528131501.GK23723@intel.com> <20180529071103.GL23723@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180529071103.GL23723@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 29, 2018 at 10:11:03AM +0300, Ville Syrj?l? wrote: > On Tue, May 29, 2018 at 02:48:22AM +0300, Dmitry Osipenko wrote: > > Though maybe "color components replacement" and "replacement with a complete > > transparency" could be factored out into a specific color keying modes. > > Yes. I've never seen those in any hardware. In fact I'm wondering where > is the userspace for all these complex modes? Ie. should we even bother > with them at this time? Such hardware does exist - here's what Armada 510 supports (and is supported via armada-drm): Color Key Mode 0 = Disable: Disable color key function. 1 = EnableY: Video Y color key is enabled. 2 = EnableU: Video U color key is enabled. 3 = EnableRGB: Graphic RGB color key is enabled. 4 = EnableV: Video V color key is enabled. 5 = EnableR: Graphic R color key is enabled. 6 = EnableG: Graphic G color key is enabled. 7 = EnableB: Graphic B color key is enabled. The description of how the colour keying works isn't particularly good, which is rather unfortunate, but basically, there's three 32-bit registers named LCD_SPU_COLORKEY_Y, LCD_SPU_COLORKEY_U and LCD_SPU_COLORKEY_V. When a graphic mode is selected, then: LCD_SPU_COLORKEY_Y is the R or B component depending on the red/blue swap LCD_SPU_COLORKEY_U is the G component LCD_SPU_COLORKEY_V is the B or R component according to the swap 31:24 is the high bound for the component (inclusive) 23:16 is the low bound for the component (inclusive) 15:8 is the replacement value for the component 7:0 is the alpha value - seems to only be for LCD_SPU_COLORKEY_Y and ignored in the other registers when in RGB mode, but I've not fully tested this. I suspect it's used with the single-channel colour keying modes. The colour key stage provides an alpha value to the next stage - which is alpha blending between the graphic (primary) plane and video (overlay) plane. Zero gives overlay only, 255 gives graphic only. So, it's possible to use an 0x0101fe (RGB) colour key, and have it appear as "black" on the screen if you disable the overlay plane, rather than the unsightly bright blue. One point to make though is about what userspace expects _today_ from overlay. VLC, for example, expects overlay to be colour keyed, so it can display its full-screen controller when the user moves the mouse. I don't believe it explicitly sets up colour keying, but just expects it to be there and functional. It _is_ rather necessary when you consider that overlay via the Xvideo extension is supposed to be "drawn" into the specified drawable, which may be a mapped window partially obscured by other mapped windows. Maybe if the kernel DRM components doesn't want to do that, it'd be something that an Xorg DDX would have to default-enable to ensure that existing applications and expected Xorg behaviour doesn't break. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up