mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 01:38:06 +02:00
kmsro: Add etnaviv renderonly support
Enable using etnaviv for KMS renderonly. This still needs KMS driver name mapping to kmsro to be used automatically. Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
parent
272b6cf58f
commit
827e0d6654
5 changed files with 52 additions and 19 deletions
|
|
@ -213,8 +213,8 @@ endif
|
||||||
if with_gallium_imx and not with_gallium_etnaviv
|
if with_gallium_imx and not with_gallium_etnaviv
|
||||||
error('IMX driver requires etnaviv driver')
|
error('IMX driver requires etnaviv driver')
|
||||||
endif
|
endif
|
||||||
if with_gallium_kmsro and not with_gallium_vc4
|
if with_gallium_kmsro and not (with_gallium_vc4 or with_gallium_etnaviv)
|
||||||
error('kmsro driver requires vc4 driver')
|
error('kmsro driver requires one or more renderonly drivers (vc4, etnaviv)')
|
||||||
endif
|
endif
|
||||||
if with_gallium_tegra and not with_gallium_nouveau
|
if with_gallium_tegra and not with_gallium_nouveau
|
||||||
error('tegra driver requires nouveau driver')
|
error('tegra driver requires nouveau driver')
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,12 @@ if with_gallium_vc4
|
||||||
else
|
else
|
||||||
driver_vc4 = declare_dependency()
|
driver_vc4 = declare_dependency()
|
||||||
endif
|
endif
|
||||||
|
if with_gallium_etnaviv
|
||||||
|
subdir('winsys/etnaviv/drm')
|
||||||
|
subdir('drivers/etnaviv')
|
||||||
|
else
|
||||||
|
driver_etnaviv = declare_dependency()
|
||||||
|
endif
|
||||||
if with_gallium_kmsro
|
if with_gallium_kmsro
|
||||||
subdir('winsys/kmsro/drm')
|
subdir('winsys/kmsro/drm')
|
||||||
else
|
else
|
||||||
|
|
@ -100,12 +106,6 @@ if with_gallium_v3d
|
||||||
else
|
else
|
||||||
driver_v3d = declare_dependency()
|
driver_v3d = declare_dependency()
|
||||||
endif
|
endif
|
||||||
if with_gallium_etnaviv
|
|
||||||
subdir('winsys/etnaviv/drm')
|
|
||||||
subdir('drivers/etnaviv')
|
|
||||||
else
|
|
||||||
driver_etnaviv = declare_dependency()
|
|
||||||
endif
|
|
||||||
if with_gallium_imx
|
if with_gallium_imx
|
||||||
subdir('winsys/imx/drm')
|
subdir('winsys/imx/drm')
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,14 @@ AM_CFLAGS = \
|
||||||
$(GALLIUM_WINSYS_CFLAGS) \
|
$(GALLIUM_WINSYS_CFLAGS) \
|
||||||
$(LIBDRM_CFLAGS)
|
$(LIBDRM_CFLAGS)
|
||||||
|
|
||||||
|
if HAVE_GALLIUM_ETNAVIV
|
||||||
|
AM_CFLAGS += -DGALLIUM_ETNAVIV
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_GALLIUM_VC4
|
||||||
|
AM_CFLAGS += -DGALLIUM_VC4
|
||||||
|
endif
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libkmsrodrm.la
|
noinst_LTLIBRARIES = libkmsrodrm.la
|
||||||
|
|
||||||
libkmsrodrm_la_SOURCES = $(C_SOURCES)
|
libkmsrodrm_la_SOURCES = $(C_SOURCES)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include "kmsro_drm_public.h"
|
#include "kmsro_drm_public.h"
|
||||||
#include "vc4/drm/vc4_drm_public.h"
|
#include "vc4/drm/vc4_drm_public.h"
|
||||||
|
#include "etnaviv/drm/etnaviv_drm_public.h"
|
||||||
#include "xf86drm.h"
|
#include "xf86drm.h"
|
||||||
|
|
||||||
#include "pipe/p_screen.h"
|
#include "pipe/p_screen.h"
|
||||||
|
|
@ -34,22 +35,39 @@
|
||||||
|
|
||||||
struct pipe_screen *kmsro_drm_screen_create(int fd)
|
struct pipe_screen *kmsro_drm_screen_create(int fd)
|
||||||
{
|
{
|
||||||
|
struct pipe_screen *screen = NULL;
|
||||||
struct renderonly ro = {
|
struct renderonly ro = {
|
||||||
|
.kms_fd = fd,
|
||||||
|
.gpu_fd = -1,
|
||||||
|
};
|
||||||
|
|
||||||
|
#if defined(GALLIUM_VC4)
|
||||||
|
ro.gpu_fd = drmOpenWithType("vc4", NULL, DRM_NODE_RENDER);
|
||||||
|
if (ro.gpu_fd >= 0) {
|
||||||
/* Passes the vc4-allocated BO through to the KMS-only DRM device using
|
/* Passes the vc4-allocated BO through to the KMS-only DRM device using
|
||||||
* PRIME buffer sharing. The VC4 BO must be linear, which the SCANOUT
|
* PRIME buffer sharing. The VC4 BO must be linear, which the SCANOUT
|
||||||
* flag on allocation will have ensured.
|
* flag on allocation will have ensured.
|
||||||
*/
|
*/
|
||||||
.create_for_resource = renderonly_create_gpu_import_for_resource,
|
ro.create_for_resource = renderonly_create_gpu_import_for_resource,
|
||||||
.kms_fd = fd,
|
screen = vc4_drm_screen_create_renderonly(&ro);
|
||||||
.gpu_fd = drmOpenWithType("vc4", NULL, DRM_NODE_RENDER),
|
if (!screen)
|
||||||
};
|
close(ro.gpu_fd);
|
||||||
|
|
||||||
if (ro.gpu_fd < 0)
|
return screen;
|
||||||
return NULL;
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct pipe_screen *screen = vc4_drm_screen_create_renderonly(&ro);
|
#if defined(GALLIUM_ETNAVIV)
|
||||||
if (!screen)
|
ro.gpu_fd = drmOpenWithType("etnaviv", NULL, DRM_NODE_RENDER);
|
||||||
close(ro.gpu_fd);
|
if (ro.gpu_fd >= 0) {
|
||||||
|
ro.create_for_resource = renderonly_create_kms_dumb_buffer_for_resource,
|
||||||
|
screen = etna_drm_screen_create_renderonly(&ro);
|
||||||
|
if (!screen)
|
||||||
|
close(ro.gpu_fd);
|
||||||
|
|
||||||
|
return screen;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return screen;
|
return screen;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,14 @@
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
|
kmsro_c_args = []
|
||||||
|
if with_gallium_etnaviv
|
||||||
|
kmsro_c_args += '-DGALLIUM_ETNAVIV'
|
||||||
|
endif
|
||||||
|
if with_gallium_vc4
|
||||||
|
kmsro_c_args += '-DGALLIUM_VC4'
|
||||||
|
endif
|
||||||
|
|
||||||
libkmsrowinsys = static_library(
|
libkmsrowinsys = static_library(
|
||||||
'kmsrowinsys',
|
'kmsrowinsys',
|
||||||
files('kmsro_drm_winsys.c'),
|
files('kmsro_drm_winsys.c'),
|
||||||
|
|
@ -25,9 +33,8 @@ libkmsrowinsys = static_library(
|
||||||
inc_src, inc_include,
|
inc_src, inc_include,
|
||||||
inc_gallium, inc_gallium_aux, inc_gallium_winsys,
|
inc_gallium, inc_gallium_aux, inc_gallium_winsys,
|
||||||
],
|
],
|
||||||
c_args : [c_vis_args],
|
c_args : [c_vis_args, kmsro_c_args],
|
||||||
dependencies: dep_libdrm,
|
dependencies: dep_libdrm,
|
||||||
link_with : libvc4winsys,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
driver_kmsro = declare_dependency(
|
driver_kmsro = declare_dependency(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue