drm/gma500: Use to_gtt_range() everywhere
Convert upcasts from struct drm_gem_object to struct gtt_range to to_gtt_range(). Some places used container_of() directly. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-3-tzimmermann@suse.de
This commit is contained in:
parent
1f9f6790cc
commit
9f40dbd441
@ -117,7 +117,7 @@ static vm_fault_t psb_gem_fault(struct vm_fault *vmf);
|
|||||||
|
|
||||||
static void psb_gem_free_object(struct drm_gem_object *obj)
|
static void psb_gem_free_object(struct drm_gem_object *obj)
|
||||||
{
|
{
|
||||||
struct gtt_range *gtt = container_of(obj, struct gtt_range, gem);
|
struct gtt_range *gtt = to_gtt_range(obj);
|
||||||
|
|
||||||
/* Remove the list map if one is present */
|
/* Remove the list map if one is present */
|
||||||
drm_gem_free_mmap_offset(obj);
|
drm_gem_free_mmap_offset(obj);
|
||||||
@ -267,7 +267,7 @@ static vm_fault_t psb_gem_fault(struct vm_fault *vmf)
|
|||||||
dev = obj->dev;
|
dev = obj->dev;
|
||||||
dev_priv = to_drm_psb_private(dev);
|
dev_priv = to_drm_psb_private(dev);
|
||||||
|
|
||||||
r = container_of(obj, struct gtt_range, gem); /* Get the gtt range */
|
r = to_gtt_range(obj);
|
||||||
|
|
||||||
/* Make sure we don't parallel update on a fault, nor move or remove
|
/* Make sure we don't parallel update on a fault, nor move or remove
|
||||||
something from beneath our feet */
|
something from beneath our feet */
|
||||||
|
@ -349,8 +349,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
|
|||||||
|
|
||||||
/* Unpin the old GEM object */
|
/* Unpin the old GEM object */
|
||||||
if (gma_crtc->cursor_obj) {
|
if (gma_crtc->cursor_obj) {
|
||||||
gt = container_of(gma_crtc->cursor_obj,
|
gt = to_gtt_range(gma_crtc->cursor_obj);
|
||||||
struct gtt_range, gem);
|
|
||||||
psb_gtt_unpin(gt);
|
psb_gtt_unpin(gt);
|
||||||
drm_gem_object_put(gma_crtc->cursor_obj);
|
drm_gem_object_put(gma_crtc->cursor_obj);
|
||||||
gma_crtc->cursor_obj = NULL;
|
gma_crtc->cursor_obj = NULL;
|
||||||
@ -376,7 +375,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
|
|||||||
goto unref_cursor;
|
goto unref_cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
gt = container_of(obj, struct gtt_range, gem);
|
gt = to_gtt_range(obj);
|
||||||
|
|
||||||
/* Pin the memory into the GTT */
|
/* Pin the memory into the GTT */
|
||||||
ret = psb_gtt_pin(gt);
|
ret = psb_gtt_pin(gt);
|
||||||
@ -426,7 +425,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
|
|||||||
|
|
||||||
/* unpin the old bo */
|
/* unpin the old bo */
|
||||||
if (gma_crtc->cursor_obj) {
|
if (gma_crtc->cursor_obj) {
|
||||||
gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem);
|
gt = to_gtt_range(gma_crtc->cursor_obj);
|
||||||
psb_gtt_unpin(gt);
|
psb_gtt_unpin(gt);
|
||||||
drm_gem_object_put(gma_crtc->cursor_obj);
|
drm_gem_object_put(gma_crtc->cursor_obj);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user