|
|
Jetson Linux API Reference
|
39.2 Release
|
Go to the documentation of this file.
38 #ifndef __NV_DRM_RENDERER_H__
39 #define __NV_DRM_RENDERER_H__
45 #include <unordered_map>
113 uint32_t height, uint32_t w_x, uint32_t w_y,
114 uint32_t connector, uint32_t crtc);
264 int32_t* plane_index);
282 struct timespec last_render_time;
288 uint32_t width, height;
289 uint32_t offset_x, offset_y;
290 uint32_t drm_conn_id;
292 uint32_t drm_crtc_id;
297 bool renderingStarted;
304 std::queue<int> freeBuffers;
305 std::queue<int> pendingBuffers;
306 std::unordered_map <int, int> map_list;
310 pthread_t render_thread;
312 pthread_mutex_t render_lock;
313 pthread_cond_t render_cond;
314 pthread_mutex_t enqueue_lock;
315 pthread_cond_t enqueue_cond;
316 pthread_mutex_t dequeue_lock;
317 pthread_cond_t dequeue_cond;
320 uint64_t render_time_sec;
322 uint64_t render_time_nsec;
339 NvDrmRenderer(
int adrm_fd,
const char *name, uint32_t width, uint32_t height,
340 uint32_t w_x, uint32_t w_y, uint32_t connector, uint32_t crtc);
351 static void * renderThread(
void *arg);
352 static void * renderThreadOrin(
void *arg);
358 static void page_flip_handler(
int fd,
unsigned int frame,
359 unsigned int sec,
unsigned int usec,
void *data);
367 int renderInternal(
int fd);
378 int createDumbBO(
int w,
int h,
int bpp,
NvDrmBO *bo);
int width
Holds width of the DRM buffer, in pixels.
static const ProfilerField PROFILER_FIELD_LATE_UNITS
int pitch
Holds stride/pitch of the DRM buffer.
int dequeBuffer()
Dequeues a previously rendered buffer.
int num_buffers
Holds the number of DRM buffers, which depends on the buffer format.
int height
Holds height of the frame, in pixels.
uint8_t * data
Holds mapped CPU accessible address.
int width
Holds width of the frame, in pixels.
bool enableUniversalPlanes(int enable)
Enables/disables DRM universal planes client caps, such as DRM_CLIENT_CAP_UNIVERSAL_PLANES.
int height
Holds height of the DRM buffer, in pixels.
struct _NvDrmFB NvDrmFB
Holds information about the frame.
NvDrmBO bo[4]
Holds DRM buffer handles.
int setFPS(float fps)
Sets the rendering rate in terms of frames per second.
uint32_t createDumbFB(uint32_t width, uint32_t height, uint32_t drm_format, NvDrmFB *fb)
Allocates a framebuffer of size (w, h).
int format
Holds frame format, such as DRM_FORMAT_RGB332.
int getPlaneCount()
Gets total number of planes available.
int getEncoderCount()
Gets count of available encoders.
static NvDrmRenderer * createDrmRenderer(int adrm_fd, const char *name, uint32_t width, uint32_t height, uint32_t w_x, uint32_t w_y, uint32_t connector, uint32_t crtc)
Creates a new DRM based renderer named name.
int drmUtilCloseGemBo(int fd, uint32_t bo_handle)
Close GEM (Graphics Execution Manager) handles.
Holds information about the frame.
Holds a buffer object handle.
static const ProfilerField PROFILER_FIELD_FPS
int setPlane(uint32_t pl_index, uint32_t fb_id, uint32_t crtc_x, uint32_t crtc_y, uint32_t crtc_w, uint32_t crtc_h, uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h)
Changes a plane's framebuffer and position.
Every element has a unique name that can be used for identifying the element in debug logs.
uint32_t bo_handle
Holds DRM buffer index.
static const ProfilerField PROFILER_FIELD_TOTAL_UNITS
struct _NvDrmBO NvDrmBO
Holds a buffer object handle.
int removeFB(uint32_t fb_id)
Destroys (frees) a framebuffer previously allocated by createDumbFB().
int getPlaneIndex(uint32_t crtc_index, int32_t *plane_index)
Gets the plane indexes supported by the given crtc index.
Helper class for rendering using LibDRM.
uint32_t fb_id
Holds the frame ID.
int enqueBuffer(int fd)
Enqueues a buffer file descriptor for rendering.
int getCrtcCount()
Gets count of available CRTCs.