aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core/include/subdev/fb.h
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-11-27 09:46:56 +1000
committerBen Skeggs <bskeggs@redhat.com>2014-01-07 13:37:36 +1000
commit61b365a505d625734be9ac54066fe4700672abc9 (patch)
treee2c56d6757a32426b79e37869bf553551a096738 /drivers/gpu/drm/nouveau/core/include/subdev/fb.h
parentdrm/nv50/disp: min/max are reversed in nv50_crtc_gamma_set() (diff)
downloadlinux-dev-61b365a505d625734be9ac54066fe4700672abc9.tar.xz
linux-dev-61b365a505d625734be9ac54066fe4700672abc9.zip
drm/nouveau: populate master subdev pointer only when fully constructed
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/nouveau/core/include/subdev/fb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/fb.h b/drivers/gpu/drm/nouveau/core/include/subdev/fb.h
index 8541aa382ff2..d89dbdf39b0d 100644
--- a/drivers/gpu/drm/nouveau/core/include/subdev/fb.h
+++ b/drivers/gpu/drm/nouveau/core/include/subdev/fb.h
@@ -75,6 +75,11 @@ struct nouveau_fb {
static inline struct nouveau_fb *
nouveau_fb(void *obj)
{
+ /* fbram uses this before device subdev pointer is valid */
+ if (nv_iclass(obj, NV_SUBDEV_CLASS) &&
+ nv_subidx(obj) == NVDEV_SUBDEV_FB)
+ return obj;
+
return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB];
}