|
Jetson Linux API Reference
|
32.7.6 Release
|
Go to the documentation of this file.
17 #ifndef __NV_DRM_RENDERER_H__
18 #define __NV_DRM_RENDERER_H__
24 #include <unordered_map>
87 uint32_t height, uint32_t w_x, uint32_t w_y,
88 uint32_t connector, uint32_t crtc,
89 struct drm_tegra_hdr_metadata_smpte_2086 metadata,
239 int32_t* plane_index);
271 struct timespec last_render_time;
275 uint32_t width, height;
276 uint32_t drm_conn_id;
278 uint32_t drm_crtc_id;
283 bool renderingStarted;
289 std::queue<int> freeBuffers;
290 std::queue<int> pendingBuffers;
291 std::unordered_map <int, int> map_list;
295 pthread_t render_thread;
297 pthread_mutex_t render_lock;
298 pthread_cond_t render_cond;
299 pthread_mutex_t enqueue_lock;
300 pthread_cond_t enqueue_cond;
301 pthread_mutex_t dequeue_lock;
302 pthread_cond_t dequeue_cond;
305 uint64_t render_time_sec;
307 uint64_t render_time_nsec;
326 NvDrmRenderer(
const char *name, uint32_t width, uint32_t height,
327 uint32_t w_x, uint32_t w_y, uint32_t connector, uint32_t crtc,
328 struct drm_tegra_hdr_metadata_smpte_2086 metadata,
bool streamHDR);
339 static void * renderThread(
void *arg);
345 static void page_flip_handler(
int fd,
unsigned int frame,
346 unsigned int sec,
unsigned int usec,
void *data);
354 int renderInternal(
int fd);
365 int createDumbBO(
int w,
int h,
int bpp,
NvDrmBO *bo);
bool enableUniversalPlanes(int enable)
Enables/disables DRM universal planes client caps, such as DRM_CLIENT_CAP_UNIVERSAL_PLANES.
int removeFB(uint32_t fb_id)
Destroys (frees) a framebuffer previously allocated by createDumbFB().
int format
Holds frame format, such as DRM_FORMAT_RGB332.
Helper class for rendering using LibDRM.
bool hdrSupported()
Checks whether HDR mode is supported on the DRM renderer.
Holds a buffer object handle.
Every element has a unique name that can be used for identifying the element in debug logs.
Holds information about the frame.
int getPlaneCount()
Gets total number of planes available.
int height
Holds height of the DRM buffer in pixels.
uint32_t createDumbFB(uint32_t width, uint32_t height, uint32_t drm_format, NvDrmFB *fb)
Allocates a framebuffer of size (w, h).
uint32_t bo_handle
Holds DRM buffer index.
int getCrtcCount()
Gets count of available CRTCs.
int dequeBuffer()
Dequeues a previously rendered buffer.
int getPlaneIndex(uint32_t crtc_index, int32_t *plane_index)
Gets the plane indexes supported by the given crtc index.
int width
Holds width of the DRM buffer in pixels.
int num_buffers
Holds the number of DRM buffers, which depends on the buffer format.
int drmUtilCloseGemBo(int fd, uint32_t bo_handle)
Close GEM (Graphics Execution Manager) handles.
int enqueBuffer(int fd)
Enqueues a buffer file descriptor for rendering.
static const ProfilerField PROFILER_FIELD_LATE_UNITS
uint8_t * data
Holds mapped CPU accessible address.
uint32_t fb_id
Holds the frame ID.
static const ProfilerField PROFILER_FIELD_TOTAL_UNITS
static const ProfilerField PROFILER_FIELD_FPS
int setFPS(float fps)
Sets the rendering rate.
int height
Holds height of the frame in pixels.
int pitch
Holds stride/pitch of the DRM buffer.
int getEncoderCount()
Gets count of available encoders.
static NvDrmRenderer * createDrmRenderer(const char *name, uint32_t width, uint32_t height, uint32_t w_x, uint32_t w_y, uint32_t connector, uint32_t crtc, struct drm_tegra_hdr_metadata_smpte_2086 metadata, bool streamHDR)
Creates a new DRM based renderer named name.
struct _NvDrmFB NvDrmFB
Holds information about the frame.
struct _NvDrmBO NvDrmBO
Holds a buffer object handle.
int width
Holds width of the frame in pixels.
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.
NvDrmBO bo[4]
Holds DRM buffer handles.
int setHDRMetadataSmpte2086(struct drm_tegra_hdr_metadata_smpte_2086)
Sets the HDR metadata retrieved from the decoder.