aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-09-14 12:40:18 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-09-24 06:09:26 -0400
commit5ee932d049a4e6e1e134f521dbb98fdd3993a8e9 (patch)
tree6f9338f91f2a526adfb0d3110f3806d3f78c64ec
parent918b7ed423ab7c423efe0e71f7670ff9139d3ee0 (diff)
drm/nouveau: use container_of to resolve nouveau_plane from drm_plane
Use container_of instead of casting first structure member. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/nouveau/dispnv04/overlay.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
index b36afcbbc83f..1e9056a8df94 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
@@ -97,7 +97,8 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
97 uint32_t src_w, uint32_t src_h) 97 uint32_t src_w, uint32_t src_h)
98{ 98{
99 struct nvif_device *dev = &nouveau_drm(plane->dev)->device; 99 struct nvif_device *dev = &nouveau_drm(plane->dev)->device;
100 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 100 struct nouveau_plane *nv_plane =
101 container_of(plane, struct nouveau_plane, base);
101 struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb); 102 struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb);
102 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 103 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
103 struct nouveau_bo *cur = nv_plane->cur; 104 struct nouveau_bo *cur = nv_plane->cur;
@@ -173,7 +174,8 @@ static int
173nv10_disable_plane(struct drm_plane *plane) 174nv10_disable_plane(struct drm_plane *plane)
174{ 175{
175 struct nvif_device *dev = &nouveau_drm(plane->dev)->device; 176 struct nvif_device *dev = &nouveau_drm(plane->dev)->device;
176 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 177 struct nouveau_plane *nv_plane =
178 container_of(plane, struct nouveau_plane, base);
177 179
178 nvif_wr32(dev, NV_PVIDEO_STOP, 1); 180 nvif_wr32(dev, NV_PVIDEO_STOP, 1);
179 if (nv_plane->cur) { 181 if (nv_plane->cur) {
@@ -224,7 +226,8 @@ nv_set_property(struct drm_plane *plane,
224 struct drm_property *property, 226 struct drm_property *property,
225 uint64_t value) 227 uint64_t value)
226{ 228{
227 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 229 struct nouveau_plane *nv_plane =
230 container_of(plane, struct nouveau_plane, base);
228 231
229 if (property == nv_plane->props.colorkey) 232 if (property == nv_plane->props.colorkey)
230 nv_plane->colorkey = value; 233 nv_plane->colorkey = value;
@@ -344,7 +347,8 @@ nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
344 uint32_t src_w, uint32_t src_h) 347 uint32_t src_w, uint32_t src_h)
345{ 348{
346 struct nvif_device *dev = &nouveau_drm(plane->dev)->device; 349 struct nvif_device *dev = &nouveau_drm(plane->dev)->device;
347 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 350 struct nouveau_plane *nv_plane =
351 container_of(plane, struct nouveau_plane, base);
348 struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb); 352 struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb);
349 struct nouveau_bo *cur = nv_plane->cur; 353 struct nouveau_bo *cur = nv_plane->cur;
350 uint32_t overlay = 1; 354 uint32_t overlay = 1;
@@ -423,7 +427,8 @@ static int
423nv04_disable_plane(struct drm_plane *plane) 427nv04_disable_plane(struct drm_plane *plane)
424{ 428{
425 struct nvif_device *dev = &nouveau_drm(plane->dev)->device; 429 struct nvif_device *dev = &nouveau_drm(plane->dev)->device;
426 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 430 struct nouveau_plane *nv_plane =
431 container_of(plane, struct nouveau_plane, base);
427 432
428 nvif_mask(dev, NV_PVIDEO_OVERLAY, 1, 0); 433 nvif_mask(dev, NV_PVIDEO_OVERLAY, 1, 0);
429 nvif_wr32(dev, NV_PVIDEO_OE_STATE, 0); 434 nvif_wr32(dev, NV_PVIDEO_OE_STATE, 0);