diff options
author | Emil Velikov <[email protected]> | 2015-10-14 16:24:55 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-11-21 12:52:18 +0000 |
commit | 33f1db1eb412382d2bd6552369e6f63bad52ca8d (patch) | |
tree | 66f7d12b4b8175a39463b96230287b6cf496e8fd /src | |
parent | be430726e2586e1c9932953325b45e0e6a39f301 (diff) |
pipe-loader: add pipe_loader_sw_probe_kms() implementation
Will be used as a counterpart for target-helpers'
kms_swrast_create_screen().
Signed-off-by: Emil Velikov <[email protected]>
Acked-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/Automake.inc | 5 | ||||
-rw-r--r-- | src/gallium/auxiliary/pipe-loader/pipe_loader.h | 10 | ||||
-rw-r--r-- | src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 24 |
3 files changed, 39 insertions, 0 deletions
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc index ee07ab6c8f9..095e6ec55fb 100644 --- a/src/gallium/Automake.inc +++ b/src/gallium/Automake.inc @@ -67,3 +67,8 @@ if HAVE_DRISW GALLIUM_PIPE_LOADER_WINSYS_LIBS += \ $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la endif + +if HAVE_DRISW_KMS +GALLIUM_PIPE_LOADER_WINSYS_LIBS += \ + $(top_builddir)/src/gallium/winsys/sw/kms-dri/libswkmsdri.la +endif diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h index 7aa9c67d504..8eba8a6f008 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h @@ -124,6 +124,16 @@ pipe_loader_sw_probe_dri(struct pipe_loader_device **devs, struct drisw_loader_funcs *drisw_lf); /** + * Initialize a kms backed sw device given an fd. + * + * This function is platform-specific. + * + * \sa pipe_loader_probe + */ +bool +pipe_loader_sw_probe_kms(struct pipe_loader_device **devs, int fd); + +/** * Initialize a null sw device. * * This function is platform-specific. diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c index 6794930193d..86039a35ef7 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c @@ -30,6 +30,7 @@ #include "util/u_memory.h" #include "util/u_dl.h" #include "sw/dri/dri_sw_winsys.h" +#include "sw/kms-dri/kms_dri_sw_winsys.h" #include "sw/null/null_sw_winsys.h" #include "sw/wrapper/wrapper_sw_winsys.h" #include "target-helpers/inline_sw_helper.h" @@ -72,6 +73,29 @@ pipe_loader_sw_probe_dri(struct pipe_loader_device **devs, struct drisw_loader_f } #endif +#ifdef HAVE_PIPE_LOADER_KMS +bool +pipe_loader_sw_probe_kms(struct pipe_loader_device **devs, int fd) +{ + struct pipe_loader_sw_device *sdev = CALLOC_STRUCT(pipe_loader_sw_device); + + if (!sdev) + return false; + + sdev->base.type = PIPE_LOADER_DEVICE_SOFTWARE; + sdev->base.driver_name = "swrast"; + sdev->base.ops = &pipe_loader_sw_ops; + sdev->ws = kms_dri_create_winsys(fd); + if (!sdev->ws) { + FREE(sdev); + return false; + } + *devs = &sdev->base; + + return true; +} +#endif + bool pipe_loader_sw_probe_null(struct pipe_loader_device **devs) { |