/* Please note that modifications to all structs defined here are *subjecttobackwards-compatibilityconstraints: *1)Donotusepointers,use__u64insteadfor32bit/64bit *user/kernelcompatibility *2)Keepfieldsalignedtotheirsize *3)Becauseofhowdrm_ioctl()works,wecanaddnewfieldsat *theendofanioctlifsomecareistaken:drm_ioctl()will *zerooutthenewfieldsatthetailoftheioctl,soazero *valueshouldhaveabackwardscompatiblemeaning.Andfor *outputparams,userspacewon'tseethenewlyaddedoutput *fields..sothathastobesomehowok.
*/
/* timeouts are specified in clock-monotonic absolute times (to simplify *restartinginterruptedioctls).Thefollowingstructislogicallythe *sameas'structtimespec'but32/64bABIsafe.
*/ struct drm_etnaviv_timespec {
__s64 tv_sec; /* seconds */
__s64 tv_nsec; /* nanoseconds */
};
struct drm_etnaviv_gem_cpu_prep {
__u32 handle; /* in */
__u32 op; /* in, mask of ETNA_PREP_x */ struct drm_etnaviv_timespec timeout; /* in */
};
struct drm_etnaviv_gem_cpu_fini {
__u32 handle; /* in */
__u32 flags; /* in, placeholder for now, no defined values */
};
/* *CmdstreamSubmission:
*/
/* The value written into the cmdstream is logically: *relocbuf->gpuaddr+reloc_offset * *NOTEthatreloc'smustbesortedbyorderofincreasingsubmit_offset, *otherwiseEINVAL.
*/ struct drm_etnaviv_gem_submit_reloc {
__u32 submit_offset; /* in, offset from submit_bo */
__u32 reloc_idx; /* in, index of reloc_bo buffer */
__u64 reloc_offset; /* in, offset from start of reloc_bo */
__u32 flags; /* in, placeholder for now, no defined values */
};
/* Each buffer referenced elsewhere in the cmdstream submit (ie. the *cmdstreambuffer(s)themselvesorrelocentries)hasone(andonly *one)entryinthesubmit->bos[]table. * *Asaoptimization,thecurrentbuffer(gpuvirtualaddress)canbe *passedbackthroughthe'presumed'field.Ifonasubsequentreloc, *userspacepassesbacka'presumed'addressthatisstillvalid, *thenpatchingthecmdstreamforthisentryisskipped.Thiscan *avoidkernelneedingtomap/accessthecmdstreambointhecommon *case. *Ifthesubmitisasoftpinsubmit(ETNA_SUBMIT_SOFTPIN)the'presumed' *fieldisinterpretedasthefixedlocationtomapthebointothegpu *virtualaddressspace.Ifthekernelisunabletomapthebufferat *thislocationthesubmitwillfail.Thismeansuserspaceisresponsible *forthewholegpuvirtualaddressmanagement.
*/ #define ETNA_SUBMIT_BO_READ 0x0001 #define ETNA_SUBMIT_BO_WRITE 0x0002 struct drm_etnaviv_gem_submit_bo {
__u32 flags; /* in, mask of ETNA_SUBMIT_BO_x */
__u32 handle; /* in, GEM handle */
__u64 presumed; /* in/out, presumed buffer address */
};
/* performance monitor request (pmr) */ #define ETNA_PM_PROCESS_PRE 0x0001 #define ETNA_PM_PROCESS_POST 0x0002 struct drm_etnaviv_gem_submit_pmr {
__u32 flags; /* in, when to process request (ETNA_PM_PROCESS_x) */
__u8 domain; /* in, pm domain */
__u8 pad;
__u16 signal; /* in, pm signal */
__u32 sequence; /* in, sequence number */
__u32 read_offset; /* in, offset from read_bo */
__u32 read_idx; /* in, index of read_bo buffer */
};
/* Each cmdstream submit consists of a table of buffers involved, and *oneormorecmdstreambuffers.Thisallowsforconditionalexecution *(context-restore),andIBbuffersneededforpertile/bindrawcmds.
*/ #define ETNA_SUBMIT_NO_IMPLICIT 0x0001 #define ETNA_SUBMIT_FENCE_FD_IN 0x0002 #define ETNA_SUBMIT_FENCE_FD_OUT 0x0004 #define ETNA_SUBMIT_SOFTPIN 0x0008 #define ETNA_SUBMIT_FLAGS (ETNA_SUBMIT_NO_IMPLICIT | \
ETNA_SUBMIT_FENCE_FD_IN | \
ETNA_SUBMIT_FENCE_FD_OUT| \
ETNA_SUBMIT_SOFTPIN) #define ETNA_PIPE_3D 0x00 #define ETNA_PIPE_2D 0x01 #define ETNA_PIPE_VG 0x02 struct drm_etnaviv_gem_submit {
__u32 fence; /* out */
__u32 pipe; /* in */
__u32 exec_state; /* in, initial execution state (ETNA_PIPE_x) */
__u32 nr_bos; /* in, number of submit_bo's */
__u32 nr_relocs; /* in, number of submit_reloc's */
__u32 stream_size; /* in, cmdstream size */
__u64 bos; /* in, ptr to array of submit_bo's */
__u64 relocs; /* in, ptr to array of submit_reloc's */
__u64 stream; /* in, ptr to cmdstream */
__u32 flags; /* in, mask of ETNA_SUBMIT_x */
__s32 fence_fd; /* in/out, fence fd (see ETNA_SUBMIT_FENCE_FD_x) */
__u64 pmrs; /* in, ptr to array of submit_pmr's */
__u32 nr_pmrs; /* in, number of submit_pmr's */
__u32 pad;
};
/* The normal way to synchronize with the GPU is just to CPU_PREP on *abufferifyouneedtoaccessitfromtheCPU(othercmdstream *submissionfromsameorothercontexts,PAGE_FLIPioctl,etc,all *handletherequiredsynchronizationunderthehood).Thisioctl *mainlyjustexistsasawaytoimplementthegalliumpipe_fence *APIswithoutrequiringadummybotosynchronizeon.
*/ #define ETNA_WAIT_NONBLOCK 0x01 struct drm_etnaviv_wait_fence {
__u32 pipe; /* in */
__u32 fence; /* in */
__u32 flags; /* in, mask of ETNA_WAIT_x */
__u32 pad; struct drm_etnaviv_timespec timeout; /* in */
};
#define ETNA_USERPTR_READ 0x01 #define ETNA_USERPTR_WRITE 0x02 struct drm_etnaviv_gem_userptr {
__u64 user_ptr; /* in, page aligned user pointer */
__u64 user_size; /* in, page aligned user size */
__u32 flags; /* in, flags */
__u32 handle; /* out, non-zero handle */
};
struct drm_etnaviv_gem_wait {
__u32 pipe; /* in */
__u32 handle; /* in, bo to be waited for */
__u32 flags; /* in, mask of ETNA_WAIT_x */
__u32 pad; struct drm_etnaviv_timespec timeout; /* in */
};
/* *PerformanceMonitor(PM):
*/
struct drm_etnaviv_pm_domain {
__u32 pipe; /* in */
__u8 iter; /* in/out, select pm domain at index iter */
__u8 id; /* out, id of domain */
__u16 nr_signals; /* out, how many signals does this domain provide */ char name[64]; /* out, name of domain */
};
struct drm_etnaviv_pm_signal {
__u32 pipe; /* in */
__u8 domain; /* in, pm domain index */
__u8 pad;
__u16 iter; /* in/out, select pm source at index iter */
__u16 id; /* out, id of signal */ char name[64]; /* out, name of domain */
};
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.