dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm: etnaviv: add helper to extract bitfields
Date: Mon, 25 Jan 2016 12:03:33 +0100	[thread overview]
Message-ID: <1453719813.4368.8.camel@pengutronix.de> (raw)
In-Reply-To: <E1aNOZu-0004pS-A3@rmk-PC.arm.linux.org.uk>

Am Sonntag, den 24.01.2016, 17:35 +0000 schrieb Russell King:
> Add a helper to extract etnaviv bitfields from register values.
> 
> Acked-by: Christian Gmeiner <christian.gmeiner@gmail.com>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Applied with the following folded in. If you are not okay with this
please speak up.
------------------------------------->8----------------------------
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 1269b6316c51..5fd3110d9691 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -296,12 +296,10 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu)
 	chipIdentity = gpu_read(gpu, VIVS_HI_CHIP_IDENTITY);
 
 	/* Special case for older graphic cores. */
-	if (((chipIdentity & VIVS_HI_CHIP_IDENTITY_FAMILY__MASK)
-	     >> VIVS_HI_CHIP_IDENTITY_FAMILY__SHIFT) ==  0x01) {
+	if (etnaviv_field(chipIdentity, VIVS_HI_CHIP_IDENTITY_FAMILY) == 0x01) {
 		gpu->identity.model    = chipModel_GC500;
-		gpu->identity.revision =
-			(chipIdentity & VIVS_HI_CHIP_IDENTITY_REVISION__MASK)
-			>> VIVS_HI_CHIP_IDENTITY_REVISION__SHIFT;
+		gpu->identity.revision = etnaviv_field(chipIdentity,
+					 VIVS_HI_CHIP_IDENTITY_REVISION);
 	} else {
 
 		gpu->identity.model = gpu_read(gpu, VIVS_HI_CHIP_MODEL);


-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-01-25 11:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-24 17:35 [PATCH 0/5] Etnaviv updates Russell King - ARM Linux
2016-01-24 17:35 ` [PATCH 1/5] drm: etnaviv: update common and state_hi xml.h files Russell King
2016-01-24 17:35 ` [PATCH 2/5] drm: etnaviv: use defined constants for the chip model Russell King
2016-01-24 17:35 ` [PATCH 3/5] drm: etnaviv: add helper to extract bitfields Russell King
2016-01-25 11:03   ` Lucas Stach [this message]
2016-01-24 17:35 ` [PATCH 4/5] drm: etnaviv: add helper for comparing model/revision IDs Russell King
2016-01-24 17:36 ` [PATCH 5/5] drm: etnaviv: add further minor features and varyings count Russell King
     [not found] ` <20160124173516.GH10826-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2016-01-25 11:04   ` [PATCH 0/5] Etnaviv updates Lucas Stach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453719813.4368.8.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).