#ifndef _EVDI_CURSOR_H_
#define _EVDI_CURSOR_H_
#include <linux/version.h>
#include <linux/module.h>
#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8)
#else
#include <drm/drmP.h>
#endif
#include <drm/drm_crtc.h>
struct evdi_cursor;
struct evdi_framebuffer;
struct evdi_gem_object;
int evdi_cursor_init(struct evdi_cursor **cursor);
void evdi_cursor_free(struct evdi_cursor *cursor);
void evdi_cursor_lock(struct evdi_cursor *cursor);
void evdi_cursor_unlock(struct evdi_cursor *cursor);
bool evdi_cursor_enabled(struct evdi_cursor *cursor);
void evdi_cursor_enable(struct evdi_cursor *cursor, bool enabled);
void evdi_cursor_set(struct evdi_cursor *cursor,
struct evdi_gem_object *obj,
uint32_t width, uint32_t height,
int32_t hot_x, int32_t hot_y,
uint32_t pixel_format, uint32_t stride);
void evdi_cursor_move(struct evdi_cursor *cursor, int32_t x, int32_t y);
void evdi_cursor_position(struct evdi_cursor *cursor, int32_t *x, int32_t *y);
void evdi_cursor_hotpoint(struct evdi_cursor *cursor,
int32_t *hot_x, int32_t *hot_y);
void evdi_cursor_size(struct evdi_cursor *cursor,
uint32_t *width, uint32_t *height);
void evdi_cursor_format(struct evdi_cursor *cursor, uint32_t *format);
void evdi_cursor_stride(struct evdi_cursor *cursor, uint32_t *stride);
struct evdi_gem_object *evdi_cursor_gem(struct evdi_cursor *cursor);
int evdi_cursor_compose_and_copy(struct evdi_cursor *cursor,
struct evdi_framebuffer *efb,
char __user *buffer,
int buf_byte_stride);
#endif