drivers/gpu/drm/imagination/pvr_free_list.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imagination/pvr_free_list.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/imagination/pvr_free_list.h
Extension
.h
Size
5377 bytes
Lines
196
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct pvr_free_list_node {
	/** @node: List node for &pvr_free_list.mem_block_list. */
	struct list_head node;

	/** @free_list: Pointer to owning free list. */
	struct pvr_free_list *free_list;

	/** @num_pages: Number of pages in this node. */
	u32 num_pages;

	/** @mem_obj: GEM object representing the pages in this node. */
	struct pvr_gem_object *mem_obj;
};

/**
 * struct pvr_free_list - structure representing a free list
 */
struct pvr_free_list {
	/** @ref_count: Reference count of object. */
	struct kref ref_count;

	/** @pvr_dev: Pointer to device that owns this object. */
	struct pvr_device *pvr_dev;

	/** @obj: GEM object representing the free list. */
	struct pvr_gem_object *obj;

	/** @fw_obj: FW object representing the FW-side structure. */
	struct pvr_fw_object *fw_obj;

	/** @fw_data: Pointer to CPU mapping of the FW-side structure. */
	struct rogue_fwif_freelist *fw_data;

	/**
	 * @lock: Mutex protecting modification of the free list. Must be held when accessing any
	 *        of the members below.
	 */
	struct mutex lock;

	/** @fw_id: Firmware ID for this object. */
	u32 fw_id;

	/** @current_pages: Current number of pages in free list. */
	u32 current_pages;

	/** @max_pages: Maximum number of pages in free list. */
	u32 max_pages;

	/** @grow_pages: Pages to grow free list by per request. */
	u32 grow_pages;

	/**
	 * @grow_threshold: Percentage of FL memory used that should trigger a
	 *                  new grow request.
	 */
	u32 grow_threshold;

	/**
	 * @ready_pages: Number of pages reserved for FW to use while a grow
	 *               request is being processed.
	 */
	u32 ready_pages;

	/** @mem_block_list: List of memory blocks in this free list. */
	struct list_head mem_block_list;

	/** @hwrt_list: List of HWRTs using this free list. */
	struct list_head hwrt_list;

	/** @initial_num_pages: Initial number of pages in free list. */
	u32 initial_num_pages;

	/** @free_list_gpu_addr: Address of free list in GPU address space. */
	u64 free_list_gpu_addr;
};

struct pvr_free_list *
pvr_free_list_create(struct pvr_file *pvr_file,
		     struct drm_pvr_ioctl_create_free_list_args *args);

void
pvr_destroy_free_lists_for_file(struct pvr_file *pvr_file);

u32
pvr_get_free_list_min_pages(struct pvr_device *pvr_dev);

static __always_inline struct pvr_free_list *
pvr_free_list_get(struct pvr_free_list *free_list)
{
	if (free_list)

Annotation

Implementation Notes