Support private objects for stolen memory in psb_gem_create() and convert users to psb_gem_create(). For stolen memory, psb_gem_create() now initializes the GEM object via drm_gem_private_object_init(). In the fbdev setup, replace the open-coded initialization of struct gtt_range with a call to psb_gem_create(). Use drm_gem_object_put() for release. In the cursor setup, use psb_gem_create() and get a real GEM object. Previously the allocated instance of struct gtt_range was only partially initialized. Release the cursor GEM object in gma_crtc_destroy(). The release was missing from the original code. With the conversion of all callers to psb_gem_create(), the extern declarations of psb_gtt_alloc_range, psb_gtt_free_range and psb_gem_object_func are not required any longer. Declare them as static. 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-5-tzimmermann@suse.de
22 lines
542 B
C
22 lines
542 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/**************************************************************************
|
|
* Copyright (c) 2014 Patrik Jakobsson
|
|
* All Rights Reserved.
|
|
*
|
|
**************************************************************************/
|
|
|
|
#ifndef _GEM_H
|
|
#define _GEM_H
|
|
|
|
#include <drm/drm_gem.h>
|
|
|
|
struct drm_device;
|
|
|
|
struct gtt_range *
|
|
psb_gem_create(struct drm_device *dev, u64 size, const char *name, bool stolen, u32 align);
|
|
|
|
int psb_gtt_pin(struct gtt_range *gt);
|
|
void psb_gtt_unpin(struct gtt_range *gt);
|
|
|
|
#endif
|