diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-10-12 16:48:48 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-12-21 19:01:39 +1000 |
commit | f9f9f536312d4c3ca39502ccf6a3af60cfe38ff4 (patch) | |
tree | 8dc47e17532e708f9bcea5bf307ce83f585ebe72 /drivers/gpu/drm/nouveau/nouveau_bios.h | |
parent | 816af2f2d6bf3191988ecaf2340452ebc46025fc (diff) |
drm/nouveau/bios: pass drm_device to ROMPTR, rather than nvbios
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bios.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h index dff121d8896f..5f1258834ec1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.h +++ b/drivers/gpu/drm/nouveau/nouveau_bios.h @@ -34,9 +34,14 @@ #define DCB_LOC_ON_CHIP 0 -#define ROM16(x) le16_to_cpu(*(uint16_t *)&(x)) -#define ROM32(x) le32_to_cpu(*(uint32_t *)&(x)) -#define ROMPTR(bios, x) (ROM16(x) ? &(bios)->data[ROM16(x)] : NULL) +#define ROM16(x) le16_to_cpu(*(u16 *)&(x)) +#define ROM32(x) le32_to_cpu(*(u32 *)&(x)) +#define ROM48(x) ({ u8 *p = &(x); (u64)ROM16(p[4]) << 32 | ROM32(p[0]); }) +#define ROM64(x) le64_to_cpu(*(u64 *)&(x)) +#define ROMPTR(d,x) ({ \ + struct drm_nouveau_private *dev_priv = (d)->dev_private; \ + ROM16(x) ? &dev_priv->vbios.data[ROM16(x)] : NULL; \ +}) struct bit_entry { uint8_t id; |