/* The kernel-space BO cache. Tracks buffers that have been *unreferencedbyallotherusers(refcountsof0!)butnot *yetfreed,sowecandocheapallocations.
*/ struct vc4_bo_cache { /* Array of list heads for entries in the BO cache, *basedonnumberofpages,sowecandoO(1)lookups *inthecachewhenallocating.
*/ struct list_head *size_list;
uint32_t size_list_size;
/* List of all BOs in the cache, ordered by age, so we *candoO(1)lookupswhentryingtofreeold *buffers.
*/ struct list_head time_list; struct work_struct time_work; struct timer_list time_timer;
} bo_cache;
/* Protects bo_cache and bo_labels. */ struct mutex bo_lock;
/* Purgeable BO pool. All BOs in this pool can have their memory *reclaimedifthedriverisunabletoallocatenewBOs.Wealso *keepstatsrelatedtothepurgemechanismhere.
*/ struct { struct list_head list; unsignedint num;
size_t size; unsignedint purged_num;
size_t purged_size; struct mutex lock;
} purgeable;
uint64_t dma_fence_context;
/* Sequence number for the last job queued in bin_job_list. *Startsat0(nojobsemitted).
*/
uint64_t emit_seqno;
/* Sequence number for the last completed job on the GPU. *Startsat0(nojobscompleted).
*/
uint64_t finished_seqno;
/* List of all struct vc4_exec_info for jobs to be executed in *thebinner.Thefirstjobinthelististheonecurrently *programmedintoct0caforexecution.
*/ struct list_head bin_job_list;
/* List of all struct vc4_exec_info for jobs that have *completedbinningandarereadyforrendering.Thefirst *jobinthelististheonecurrentlyprogrammedintoct1ca *forexecution.
*/ struct list_head render_job_list;
/* List of the finished vc4_exec_infos waiting to be freed by *job_done_work.
*/ struct list_head job_done_list; /* Spinlock used to synchronize the job_list and seqno *accessesbetweentheIRQhandlerandGEMioctls.
*/
spinlock_t job_lock;
wait_queue_head_t job_wait_queue; struct work_struct job_done_work;
/* Used to track the active perfmon if any. Access to this field is *protectedbyjob_lock.
*/ struct vc4_perfmon *active_perfmon;
/* The memory used for storing binner tile alloc, tile state, *andoverflowmemoryallocations.ThisisfreedwhenV3D *powersdown.
*/ struct vc4_bo *bin_bo;
/* Size of blocks allocated within bin_bo. */
uint32_t bin_alloc_size;
/* Bitmask of the bin_alloc_size chunks in bin_bo that are *used.
*/
uint32_t bin_alloc_used;
/* Bitmask of the current bin_alloc used for overflow memory. */
uint32_t bin_alloc_overflow;
/* Incremented when an underrun error happened after an atomic commit. *Thisisparticularlyusefultodetectwhenaspecificmodesetistoo *demandingintermofmemoryorHVSbandwidthwhichishardtoguess *atatomicchecktime.
*/
atomic_t underrun;
struct work_struct overflow_mem_work;
int power_refcount;
/* Set to true when the load tracker is active. */ bool load_tracker_enabled;
/* Mutex controlling the power refcount. */ struct mutex power_lock;
/* List entry for the BO's position in either *vc4_exec_info->unref_listorvc4_dev->bo_cache.time_list
*/ struct list_head unref_head;
/* Time in jiffies when the BO was put in vc4->bo_cache. */ unsignedlong free_time;
/* List entry for the BO's position in vc4_dev->bo_cache.size_list */ struct list_head size_head;
/* Struct for shader validation state, if created by *DRM_IOCTL_VC4_CREATE_SHADER_BO.
*/ struct vc4_validated_shader_info *validated_shader;
/* One of enum vc4_kernel_bo_type, or VC4_BO_TYPE_COUNT + i *foruser-allocatedlabels.
*/ int label;
/* Count the number of active users. This is needed to determine *whetherwecanmovetheBOtothepurgeablelistornot(whentheBO *isusedbytheGPUorthedisplayenginewecan'tpurgeit).
*/
refcount_t usecnt;
/* Store purgeable/purged state here */
u32 madv; struct mutex madv_lock;
};
/* Memory manager for CRTCs to allocate space in the display *list.Unitsaredwords.
*/ struct drm_mm dlist_mm;
/* Memory manager for the LBM memory used by HVS scaling. */ struct drm_mm lbm_mm;
/* Memory manager for the UPM memory used for prefetching. */ struct drm_mm upm_mm; struct ida upm_handles; struct vc4_upm_refcounts upm_refcounts[VC4_NUM_UPM_HANDLES + 1];
struct vc4_plane_state { struct drm_plane_state base; /* System memory copy of the display list for this element, computed *atatomic_checktime.
*/
u32 *dlist;
u32 dlist_size; /* Number of dwords allocated for the display list */
u32 dlist_count; /* Number of used dwords in the display list. */
/* Offset in the dlist to various words, for pageflip or *cursorupdates.
*/
u32 pos0_offset;
u32 pos2_offset;
u32 ptr0_offset[DRM_FORMAT_MAX_PLANES];
u32 lbm_offset;
/* Offset where the plane's dlist was last stored in the *hardwareatvc4_crtc_atomic_flush()time.
*/
u32 __iomem *hw_dlist;
/* Clipped coordinates of the plane on the display. */ int crtc_x, crtc_y, crtc_w, crtc_h; /* Clipped area being scanned from in the FB in u16.16 format */
u32 src_x, src_y;
u32 src_w[2], src_h[2];
/* Scaling selection for the RGB/Y plane and the Cb/Cr planes. */ enum vc4_scaling_mode x_scaling[2], y_scaling[2]; bool is_unity; bool is_yuv;
/* Our allocation in LBM for temporary storage during scaling. */ struct drm_mm_node lbm;
/* The Unified Pre-Fetcher Handle */ unsignedint upm_handle[DRM_FORMAT_MAX_PLANES];
/* Number of lines to pre-fetch */ unsignedint upm_buffer_lines;
/* Set when the plane has per-pixel alpha content or does not cover *theentirescreen.ThisisahinttotheCRTCthatitmightneed *toenablebackgroundcolorfill.
*/ bool needs_bg_fill;
/* Mark the dlist as initialized. Useful to avoid initializing it twice *whenasyncupdateisnotpossible.
*/ bool dlist_initialized;
/* Load of this plane on the HVS block. The load is expressed in HVS *cycles/sec.
*/
u64 hvs_load;
/* Memory bandwidth needed for this plane. This is expressed in *bytes/sec.
*/
u64 membus_load;
};
#define V3D_READ(offset) \
({ \
kunit_fail_current_test("Accessing a register in a unit test!\n"); \
readl(vc4->v3d->regs + (offset)); \
})
#define V3D_WRITE(offset, val) \ do { \
kunit_fail_current_test("Accessing a register in a unit test!\n"); \
writel(val, vc4->v3d->regs + (offset)); \
} while (0)
#define HVS_READ(offset) \
({ \
kunit_fail_current_test("Accessing a register in a unit test!\n"); \
readl(hvs->regs + (offset)); \
})
#define HVS_WRITE(offset, val) \ do { \
kunit_fail_current_test("Accessing a register in a unit test!\n"); \
writel(val, hvs->regs + (offset)); \
} while (0)
/* Sequence number for this bin/render job. */
uint64_t seqno;
struct dma_fence *fence;
/* Last current addresses the hardware was processing when the *hangchecktimercheckedonus.
*/
uint32_t last_ct0ca, last_ct1ca;
/* Kernel-space copy of the ioctl arguments */ struct drm_vc4_submit_cl *args;
/* This is the array of BOs that were looked up at the start of exec. *Commandvalidationwilluseindicesintothisarray.
*/ struct drm_gem_object **bo;
uint32_t bo_count;
/* List of BOs that are being written by the RCL. Other than *thebinnertemporarystorage,thisisalltheBOswritten *bythejob.
*/ struct drm_gem_dma_object *rcl_write_bo[4];
uint32_t rcl_write_bo_count;
/* Pointers for our position in vc4->job_list */ struct list_head head;
/* List of other BOs used in the job that need to be released *oncethejobiscomplete.
*/ struct list_head unref_list;
/* Current unvalidated indices into @bo loaded by the non-hardware *VC4_PACKET_GEM_HANDLES.
*/
uint32_t bo_index[2];
/* This is the BO where we store the validated command lists, shader *records,anduniforms.
*/ struct drm_gem_dma_object *exec_bo;
/** *Thistrackstheper-shader-recordstate(packet64)that *determinesthelengthoftheshaderrecordandtheoffset *it'sexpectedtobefoundat.Itgetsreadinfromthe *commandlists.
*/ struct vc4_shader_state {
uint32_t addr; /* Maximum vertex index referenced by any primitive using this *shaderstate.
*/
uint32_t max_index;
} *shader_state;
/** How many shader states the user declared they were using. */
uint32_t shader_state_size; /** How many shader state records the validator has seen. */
uint32_t shader_state_count;
bool found_tile_binning_mode_config_packet; bool found_start_tile_binning_packet; bool found_increment_semaphore_packet; bool found_flush;
uint8_t bin_tiles_x, bin_tiles_y; /* Physical address of the start of the tile alloc array *(whereeachtile'sbinnedCLwillstart)
*/
uint32_t tile_alloc_offset; /* Bitmask of which binner slots are freed when this job completes. */
uint32_t bin_slots;
/* Pointer to the unvalidated bin CL (if present). */ void *bin_u;
/* Pointers to the shader recs. These paddr gets incremented as CL *packetsarerelocatedinvalidate_gl_shader_state,andthevaddrs *(uandv)getincrementedandsizedecrementedastheshaderrecs *themselvesarevalidated.
*/ void *shader_rec_u; void *shader_rec_v;
uint32_t shader_rec_p;
uint32_t shader_rec_size;
/* Pointers to the uniform data. These pointers are incremented, and *sizedecremented,aseachbatchofuniformsisuploaded.
*/ void *uniforms_u; void *uniforms_v;
uint32_t uniforms_p;
uint32_t uniforms_size;
/* Pointer to a performance monitor object if the user requested it, *NULLotherwise.
*/ struct vc4_perfmon *perfmon;
/* Whether the exec has taken a reference to the binner BO, which should *happenwithaVC4_PACKET_TILE_BINNING_MODE_CONFIGpacket.
*/ bool bin_bo_used;
};
/* Per-open file private data. Any driver-specific resource that has to be *releasedwhentheDRMfileisclosedshouldbeplacedhere.
*/ struct vc4_file { struct vc4_dev *dev;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.