/* 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.
*/
/* The pipe-id just uses the lower bits, so can be OR'd with flags in *theupper16bits(whichcouldbeextendedfurther,ifneeded,maybe *weextend/overloadthepipe-idsomedaytodealwithmultiplerings, *buteventhenIdon'tthinkweneedthefulllower16bits).
*/ #define MSM_PIPE_ID_MASK 0xffff #define MSM_PIPE_ID(x) ((x) & MSM_PIPE_ID_MASK) #define MSM_PIPE_FLAGS(x) ((x) & ~MSM_PIPE_ID_MASK)
/* timeouts are specified in clock-monotonic absolute times (to simplify *restartinginterruptedioctls).Thefollowingstructislogicallythe *sameas'structtimespec'but32/64bABIsafe.
*/ struct drm_msm_timespec {
__s64 tv_sec; /* seconds */
__s64 tv_nsec; /* nanoseconds */
};
/* For backwards compat. The original support for preemption was based on *asingleringperprioritylevelso#ofprioritylevelsequalsthe# *ofrings.Withdrm/schedulerprovidingadditionallevelsofpriority, *thenumberofprioritiesisgreaterthanthe#ofrings.Theparamis *renamedtobetterreflectthis.
*/ #define MSM_PARAM_NR_RINGS MSM_PARAM_PRIORITIES
struct drm_msm_param {
__u32 pipe; /* in, MSM_PIPE_x */
__u32 param; /* in, MSM_PARAM_x */
__u64 value; /* out (get_param) or in (set_param) */
__u32 len; /* zero for non-pointer params */
__u32 pad; /* must be zero */
};
/* *GEMbuffers:
*/
#define MSM_BO_SCANOUT 0x00000001 /* scanout capable */ #define MSM_BO_GPU_READONLY 0x00000002 /* Private buffers do not need to be explicitly listed in the SUBMIT *ioctl,unlessreferencedbyadrm_msm_gem_submit_cmd.Private *buffersmayNOTbeimported/exportedorusedforscanout(orany *othersituationwherebufferscanbeindefinitelypinned,but *casesotherthanscanoutareallkernelownedBOswhicharenot *visibletouserspace). * *Inexchangeforthoseconstraints,allprivateBOsassociatedwith *asinglecontext(drm_file)shareasingledma_resv,andifthere *hasbeennoevictionsincethelastsubmit,therearenoper-BO *bookeepingtodo,significantlycuttingtheSUBMIToverhead.
*/ #define MSM_BO_NO_SHARE 0x00000004 #define MSM_BO_CACHE_MASK 0x000f0000 /* cache modes */ #define MSM_BO_CACHED 0x00010000 #define MSM_BO_WC 0x00020000 #define MSM_BO_UNCACHED 0x00040000 /* deprecated, use MSM_BO_WC */ #define MSM_BO_CACHED_COHERENT 0x080000
struct drm_msm_gem_new {
__u64 size; /* in */
__u32 flags; /* in, mask of MSM_BO_x */
__u32 handle; /* out */
};
/* Get or set GEM buffer info. The requested value can be passed *directlyin'value',orfordatalargerthan64b'value'isa *pointertouserspacebuffer,with'len'specifyingthenumberof *bytescopiedintothatbuffer.Forinforeturnedbypointer, *callingtheGEM_INFOioctlwithnull'value'willreturnthe *requiredbuffersizein'len'
*/ #define MSM_INFO_GET_OFFSET 0x00 /* get mmap() offset, returned by value */ #define MSM_INFO_GET_IOVA 0x01 /* get iova, returned by value */ #define MSM_INFO_SET_NAME 0x02 /* set the debug name (by pointer) */ #define MSM_INFO_GET_NAME 0x03 /* get debug name, returned by pointer */ #define MSM_INFO_SET_IOVA 0x04 /* set the iova, passed by value */ #define MSM_INFO_GET_FLAGS 0x05 /* get the MSM_BO_x flags */ #define MSM_INFO_SET_METADATA 0x06 /* set userspace metadata */ #define MSM_INFO_GET_METADATA 0x07 /* get userspace metadata */
struct drm_msm_gem_info {
__u32 handle; /* in */
__u32 info; /* in - one of MSM_INFO_* */
__u64 value; /* in or out */
__u32 len; /* in or out */
__u32 pad;
};
struct drm_msm_syncobj {
__u32 handle; /* in, syncobj handle. */
__u32 flags; /* in, from MSM_SUBMIT_SYNCOBJ_FLAGS */
__u64 point; /* in, timepoint for timeline syncobjs. */
};
/* The value written into the cmdstream is logically: * *((relocbuf->gpuaddr+reloc_offset)<<shift)|or * *WhenwehaveGPU'sw/>32bitptrs,itshouldbepossibletodeal *withthisbyemit'ingtworelocentrieswithappropriateshift *values.OranewMSM_SUBMIT_CMD_xtypewouldalsobeanoption. * *NOTEthatreloc'smustbesortedbyorderofincreasingsubmit_offset, *otherwiseEINVAL.
*/ struct drm_msm_gem_submit_reloc {
__u32 submit_offset; /* in, offset from submit_bo */ #ifdef __cplusplus
__u32 _or; /* in, value OR'd with result */ #else
__u32 or; /* in, value OR'd with result */ #endif
__s32 shift; /* in, amount of left shift (can be negative) */
__u32 reloc_idx; /* in, index of reloc_bo buffer */
__u64 reloc_offset; /* in, offset from start of reloc_bo */
};
/* submit-types: *BUF-thiscmdbufferisexecutednormally. *IB_TARGET_BUF-thiscmdbufferisanIBtarget.Reloc'sare *processednormally,butthekerneldoesnotsetupanIBto *thisbufferinthefirst-levelringbuffer *CTX_RESTORE_BUF-onlyexecutediftherehasbeenaGPUcontext *switchsincethelastSUBMITioctl
*/ #define MSM_SUBMIT_CMD_BUF 0x0001 #define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002 #define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003 struct drm_msm_gem_submit_cmd {
__u32 type; /* in, one of MSM_SUBMIT_CMD_x */
__u32 submit_idx; /* in, index of submit_bo cmdstream buffer */
__u32 submit_offset; /* in, offset into submit_bo */
__u32 size; /* in, cmdstream size */
__u32 pad;
__u32 nr_relocs; /* in, number of submit_reloc's */ union {
__u64 relocs; /* in, ptr to array of submit_reloc's */
__u64 iova; /* cmdstream address (for VM_BIND contexts) */
};
};
/* 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.
*/ #define MSM_SUBMIT_BO_READ 0x0001 #define MSM_SUBMIT_BO_WRITE 0x0002 #define MSM_SUBMIT_BO_DUMP 0x0004 #define MSM_SUBMIT_BO_NO_IMPLICIT 0x0008
/* Each cmdstream submit consists of a table of buffers involved, and *oneormorecmdstreambuffers.Thisallowsforconditionalexecution *(context-restore),andIBbuffersneededforpertile/bindrawcmds.
*/ struct drm_msm_gem_submit {
__u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */
__u32 fence; /* out (or in with MSM_SUBMIT_FENCE_SN_IN flag) */
__u32 nr_bos; /* in, number of submit_bo's */
__u32 nr_cmds; /* in, number of submit_cmd's */
__u64 bos; /* in, ptr to array of submit_bo's */
__u64 cmds; /* in, ptr to array of submit_cmd's */
__s32 fence_fd; /* in/out fence fd (see MSM_SUBMIT_FENCE_FD_IN/OUT) */
__u32 queueid; /* in, submitqueue id */
__u64 in_syncobjs; /* in, ptr to array of drm_msm_syncobj */
__u64 out_syncobjs; /* in, ptr to array of drm_msm_syncobj */
__u32 nr_in_syncobjs; /* in, number of entries in in_syncobj */
__u32 nr_out_syncobjs; /* in, number of entries in out_syncobj. */
__u32 syncobj_stride; /* in, stride of syncobj arrays. */
__u32 pad; /*in, reserved for future use, always 0. */
};
/** *structdrm_msm_vm_bind-Inputof&DRM_IOCTL_MSM_VM_BIND
*/ struct drm_msm_vm_bind { /** @flags: in, bitmask of MSM_VM_BIND_x */
__u32 flags; /** @nr_ops: the number of bind ops in this ioctl */
__u32 nr_ops; /** @fence_fd: in/out fence fd (see MSM_VM_BIND_FENCE_FD_IN/OUT) */
__s32 fence_fd; /** @queue_id: in, submitqueue id */
__u32 queue_id; /** @in_syncobjs: in, ptr to array of drm_msm_gem_syncobj */
__u64 in_syncobjs; /** @out_syncobjs: in, ptr to array of drm_msm_gem_syncobj */
__u64 out_syncobjs; /** @nr_in_syncobjs: in, number of entries in in_syncobj */
__u32 nr_in_syncobjs; /** @nr_out_syncobjs: in, number of entries in out_syncobj */
__u32 nr_out_syncobjs; /** @syncobj_stride: in, stride of syncobj arrays */
__u32 syncobj_stride; /** @op_stride: sizeof each struct drm_msm_vm_bind_op in @ops */
__u32 op_stride; union { /** @op: used if num_ops == 1 */ struct drm_msm_vm_bind_op op; /** @ops: userptr to array of drm_msm_vm_bind_op if num_ops > 1 */
__u64 ops;
};
};
/* 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.
*/ struct drm_msm_wait_fence {
__u32 fence; /* in */
__u32 flags; /* in, bitmask of MSM_WAIT_FENCE_x */ struct drm_msm_timespec timeout; /* in */
__u32 queueid; /* in, submitqueue id */
};
/* madvise provides a way to tell the kernel in case a buffers contents *canbediscardedundermemorypressure,whichisusefulforuserspace *bocachewherewewanttooptimisticallyholdontobufferallocate *andpotentialmmap,butallowthepagestobediscardedundermemory *pressure. * *Typicalusagewouldinvolvemadvise(DONTNEED)whenbufferentersBO *cache,andmadvise(WILLNEED)iftryingtorecyclebufferfromBOcache. *IntheWILLNEEDcase,'retained'indicatestouserspacewhetherthe *backingpagesstillexist.
*/ #define MSM_MADV_WILLNEED 0/* backing pages are needed, status returned in 'retained' */ #define MSM_MADV_DONTNEED 1/* backing pages not needed */ #define __MSM_MADV_PURGED 2/* internal state */
struct drm_msm_gem_madvise {
__u32 handle; /* in, GEM handle */
__u32 madv; /* in, MSM_MADV_x */
__u32 retained; /* out, whether backing store still exists */
};
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.23Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-30)
¤
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.