From patchwork Wed Feb 16 02:45:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 565501 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1G2k8pj017375 for ; Wed, 16 Feb 2011 02:46:28 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30C189E838 for ; Tue, 15 Feb 2011 18:46:08 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f49.google.com (mail-yw0-f49.google.com [209.85.213.49]) by gabe.freedesktop.org (Postfix) with ESMTP id BCC159E709 for ; Tue, 15 Feb 2011 18:45:59 -0800 (PST) Received: by ywf7 with SMTP id 7so398358ywf.36 for ; Tue, 15 Feb 2011 18:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer; bh=5bKBT7pUGDmNBUknA3mqrFm/SCXb4AWlfvZVIxZOs8Q=; b=ht3vR7F0LeDF/+zCK94TP9EfqerYbZiBYgNAImBXDceOIweKBr+p0Wr9RUb4tVQOF1 hMuPkQ3Cci11Lhn8hv5SkAYB7JCAmKDXN8zHOTIt0kk/cGk5A+y4fJtvTKgE0Wl4/ht/ Vff3bDlTGI/L/vA9+USosWyjyRifvN+tYYpkI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=K1p4+Lncwhso5+majtYdkKiem8G8sPLlYaouw/qEgtBS1Y3gSIdVTYmUmiZZyUyg46 IbOaxkK+fS7orxWT4Pk1Ni8NxmJYDfAbruSkkfbO0YQbs3g6u+Rcm86BTiWdq1BZrpkU Bu1eSe2npwGKKGOoAEXNy4veqvh+AHraj9aTU= Received: by 10.150.150.3 with SMTP id x3mr44265ybd.336.1297824358930; Tue, 15 Feb 2011 18:45:58 -0800 (PST) Received: from localhost (ppp-70-253-156-11.dsl.rcsntx.swbell.net [70.253.156.11]) by mx.google.com with ESMTPS id i18sm2801038yhd.22.2011.02.15.18.45.56 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Feb 2011 18:45:57 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: psuedocolor support for ARGB modes Date: Tue, 15 Feb 2011 20:45:51 -0600 Message-Id: <1297824351-24422-1-git-send-email-rob@ti.com> X-Mailer: git-send-email 1.7.1 Cc: Rob Clark X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 16 Feb 2011 02:46:29 +0000 (UTC) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 7196620..9190011 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -526,6 +526,11 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, value = (red << info->var.red.offset) | (green << info->var.green.offset) | (blue << info->var.blue.offset); + if (info->var.transp.length > 0) { + u32 mask = (1 << info->var.transp.length) - 1; + mask <<= info->var.transp.offset; + value |= mask; + } palette[regno] = value; return 0; }