summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_drm2')
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h26
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c20
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c6
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c6
-rw-r--r--src/lib/ecore_drm2/meson.build10
5 files changed, 52 insertions, 16 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 5c43258177..4dde788355 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -92,6 +92,8 @@ typedef struct _Ecore_Drm2_Context
unsigned int tv_usec, void *user_data);
void (*page_flip_handler)(int fd, unsigned int sequence, unsigned int tv_sec,
unsigned int tv_usec, void *user_data);
+ void (*page_flip_handler2)(int fd, unsigned int sequence, unsigned int tv_sec,
+ unsigned int tv_usec, unsigned int crtc_id, void *user_data);
} Ecore_Drm2_Context;
EAPI extern int ECORE_DRM2_EVENT_OUTPUT_CHANGED;
@@ -148,7 +150,7 @@ EAPI int ecore_drm2_shutdown(void);
* Read and process pending Drm events
*
* @param dev drm device
- * @param ctx
+ * @param drmctx
*
* @return 0 on success, -1 otherwise
*
@@ -230,7 +232,7 @@ EAPI void ecore_drm2_device_pointer_xy_get(Ecore_Drm2_Device *device, int *x, in
/**
* Warp the pointer position to given coordinates
*
- * @param dev
+ * @param device
* @param x
* @param y
*
@@ -410,6 +412,18 @@ EAPI Eina_Bool ecore_drm2_device_vt_set(Ecore_Drm2_Device *device, int vt);
EAPI Eina_Bool ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device);
/**
+ * Get the default depth & bpp from a given device
+ *
+ * @param device
+ * @param depth
+ * @param bpp
+ *
+ * @ingroup Ecore_Drm2_Device_Group
+ * @since 1.25
+ */
+EAPI void ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *device, int *depth, int *bpp);
+
+/**
* @defgroup Ecore_Drm2_Output_Group Drm output functions
*
* Functions that deal with setup of outputs
@@ -807,7 +821,7 @@ EAPI int ecore_drm2_output_rotation_get(Ecore_Drm2_Output *output);
/**
* Set the user data for the output's page flip handler
*
- * @param output The output to update user data for
+ * @param o The output to update user data for
* @param data The new user data pointer
*
* @ingroup Ecore_Drm2_Output_Group
@@ -840,7 +854,7 @@ EAPI unsigned int ecore_drm2_output_subpixel_get(const Ecore_Drm2_Output *output
* Set the relative mode for an output
*
* @param output The output to set relative mode
- * @param relative The relative mode to set
+ * @param mode The relative mode to set
*
* @ingroup Ecore_Drm2_Output_Group
* @since 1.21
@@ -1005,7 +1019,7 @@ EAPI Eina_Bool ecore_drm2_fb_busy_get(Ecore_Drm2_Fb *fb);
* Releasing buffers committed to scanout will potentially cause flicker,
* so this is only done when the panic flag is set.
*
- * @param output The output to force release
+ * @param o The output to force release
* @param panic Try to release even buffers committed to scanout
*
* @return EINA_TRUE if a buffer was released
@@ -1036,7 +1050,7 @@ EAPI void *ecore_drm2_fb_bo_get(Ecore_Drm2_Fb *fb);
* @param depth
* @param bpp
* @param format
- * @param stride
+ * @param strides
* @param dmabuf_fd
* @param dmabuf_fd_count
*
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 7602114453..77498d806e 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -1,5 +1,9 @@
#include "ecore_drm2_private.h"
+#ifndef DRM_CAP_DUMB_PREFERRED_DEPTH
+# define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
+#endif
+
#ifndef DRM_CAP_DUMB_PREFER_SHADOW
# define DRM_CAP_DUMB_PREFER_SHADOW 0x4
#endif
@@ -883,6 +887,22 @@ ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device)
return EINA_FALSE;
}
+EAPI void
+ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *device, int *depth, int *bpp)
+{
+ uint64_t caps;
+ int ret;
+
+ EINA_SAFETY_ON_NULL_RETURN(device);
+
+ ret = sym_drmGetCap(device->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &caps);
+ if (ret == 0)
+ {
+ if (depth) *depth = caps;
+ if (bpp) *bpp = caps;
+ }
+}
+
EAPI int
ecore_drm2_device_fd_get(Ecore_Drm2_Device *device)
{
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index e91cf67ec5..e2ef2e8a2f 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -1,6 +1,6 @@
#include "ecore_drm2_private.h"
-#define FLIP_TIMEOUT 0.05
+#define FLIP_TIMEOUT 1.0
static Eina_Bool
_fb2_create(Ecore_Drm2_Fb *fb)
@@ -137,10 +137,10 @@ _ecore_drm2_fb_destroy(Ecore_Drm2_Fb *fb)
{
EINA_SAFETY_ON_NULL_RETURN(fb);
- if (!fb->dead) ERR("Destroying an fb that hasn't been discarded");
+ if (!fb->dead) WRN("Destroying an fb that hasn't been discarded");
if (fb->scanout_count)
- ERR("Destroyed fb on scanout %d times.", fb->scanout_count);
+ WRN("Destroyed fb on scanout %d times.", fb->scanout_count);
if (fb->mmap) munmap(fb->mmap, fb->sizes[0]);
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 6fe3eb5770..77123c948a 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -250,7 +250,7 @@ _output_edid_find(Ecore_Drm2_Output *output, const drmModeConnector *conn)
}
static int
-_output_crtc_find(const drmModeRes *res, const drmModeConnector *conn, Ecore_Drm2_Device *dev)
+_output_crtc_find(const drmModeRes *res, const drmModeConnector *conn, int fd)
{
drmModeEncoder *enc;
uint32_t crtc;
@@ -267,7 +267,7 @@ _output_crtc_find(const drmModeRes *res, const drmModeConnector *conn, Ecore_Drm
for (j = 0; j < conn->count_encoders; j++)
{
- enc = sym_drmModeGetEncoder(dev->fd, conn->encoders[j]);
+ enc = sym_drmModeGetEncoder(fd, conn->encoders[j]);
if (!enc) continue;
crtc = enc->crtc_id;
@@ -678,7 +678,7 @@ _output_create(Ecore_Drm2_Device *dev, const drmModeRes *res, const drmModeConne
if (w) *w = 0;
- i = _output_crtc_find(res, conn, dev);
+ i = _output_crtc_find(res, conn, dev->fd);
if (i < 0) return EINA_FALSE;
output = calloc(1, sizeof(Ecore_Drm2_Output));
diff --git a/src/lib/ecore_drm2/meson.build b/src/lib/ecore_drm2/meson.build
index 1a36fbbede..212dd366c7 100644
--- a/src/lib/ecore_drm2/meson.build
+++ b/src/lib/ecore_drm2/meson.build
@@ -1,22 +1,24 @@
-ecore_drm2_deps = [eeze, elput, dl, libdrm]
+ecore_drm2_deps = [eeze, elput]
ecore_drm2_pub_deps = [ecore]
+ecore_drm2_ext_deps = [dl, libdrm]
ecore_drm2_header_src = [
'Ecore_Drm2.h'
]
-ecore_drm2_src = [
+ecore_drm2_src = files([
'ecore_drm2_plane.c',
'ecore_drm2_fb.c',
'ecore_drm2_outputs.c',
'ecore_drm2_device.c',
'ecore_drm2.c',
'ecore_drm2_private.h'
-]
+])
ecore_drm2_lib = library('ecore_drm2',
ecore_drm2_src, pub_eo_file_target,
- dependencies: ecore_drm2_pub_deps + ecore_drm2_deps,
+ c_args : package_c_args,
+ dependencies: ecore_drm2_pub_deps + ecore_drm2_deps + ecore_drm2_ext_deps,
include_directories : config_dir,
install: true,
version : meson.project_version()