Commit 68fe2e60 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

panfrost: Upstream overlay

parent 1c140470
......@@ -134,7 +134,7 @@ if _drivers.contains('auto')
elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
_drivers = [
'pl111', 'v3d', 'vc4', 'freedreno', 'etnaviv', 'imx', 'nouveau',
'tegra', 'virgl', 'swrast',
'tegra', 'virgl', 'swrast', 'panfrost', 'rockchip'
]
else
error('Unknown architecture @0@. Please pass -Dgallium-drivers to set driver options. Patches gladly accepted to fix this.'.format(
......@@ -156,6 +156,8 @@ with_gallium_freedreno = _drivers.contains('freedreno')
with_gallium_softpipe = _drivers.contains('swrast')
with_gallium_vc4 = _drivers.contains('vc4')
with_gallium_v3d = _drivers.contains('v3d')
with_gallium_panfrost = _drivers.contains('panfrost')
with_gallium_rockchip = _drivers.contains('rockchip')
with_gallium_etnaviv = _drivers.contains('etnaviv')
with_gallium_imx = _drivers.contains('imx')
with_gallium_tegra = _drivers.contains('tegra')
......
......@@ -60,7 +60,7 @@ option(
choices : [
'', 'auto', 'pl111', 'radeonsi', 'r300', 'r600', 'nouveau', 'freedreno',
'swrast', 'v3d', 'vc4', 'etnaviv', 'imx', 'tegra', 'i915', 'svga', 'virgl',
'swr',
'swr', 'panfrost', 'rockchip'
],
description : 'List of gallium drivers to build. If this is set to auto all drivers applicable to the target OS/architecture will be built'
)
......
......@@ -1294,7 +1294,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
* Every hardware driver_name is set using strdup. Doing the same in
* here will allow is to simply free the memory at dri2_terminate().
*/
dri2_dpy->driver_name = strdup("swrast");
dri2_dpy->driver_name = strdup("panfrost");
if (!dri2_load_driver_swrast(disp))
goto cleanup;
......
......@@ -111,6 +111,11 @@ static const struct drm_driver_descriptor driver_descriptors[] = {
.create_screen = pipe_pl111_create_screen,
.configuration = pipe_default_configuration_query,
},
{
.driver_name = "rockchip",
.create_screen = pipe_rockchip_create_screen,
.configuration = pipe_default_configuration_query,
},
{
.driver_name = "virtio_gpu",
.create_screen = pipe_virgl_create_screen,
......@@ -126,6 +131,11 @@ static const struct drm_driver_descriptor driver_descriptors[] = {
.create_screen = pipe_vc4_create_screen,
.configuration = pipe_default_configuration_query,
},
{
.driver_name = "panfrost",
.create_screen = pipe_panfrost_create_screen,
.configuration = pipe_default_configuration_query,
},
{
.driver_name = "etnaviv",
.create_screen = pipe_etna_create_screen,
......
......@@ -106,6 +106,29 @@ pipe_pl111_create_screen(int fd, const struct pipe_screen_config *config)
#endif
#ifdef GALLIUM_ROCKCHIP
#include "rockchip/drm/rockchip_drm_public.h"
struct pipe_screen *
pipe_rockchip_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
screen = rockchip_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
pipe_rockchip_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "rockchip: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_R300
#include "radeon/radeon_winsys.h"
#include "radeon/drm/radeon_drm_public.h"
......@@ -356,6 +379,29 @@ pipe_etna_create_screen(int fd, const struct pipe_screen_config *config)
#endif
#if 0
#include "panfrost/drm/panfrost_drm_public.h"
struct pipe_screen *
pipe_panfrost_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
screen = panfrost_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
pipe_panfrost_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "panfrost: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_IMX
#include "imx/drm/imx_drm_public.h"
......
......@@ -42,6 +42,12 @@ pipe_v3d_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
pipe_vc4_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
pipe_rockchip_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
pipe_panfrost_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
pipe_pl111_create_screen(int fd, const struct pipe_screen_config *config);
......
......@@ -18,6 +18,10 @@
#include "softpipe/sp_public.h"
#endif
#ifdef GALLIUM_PANFROST
#include "panfrost/pan_public.h"
#endif
#ifdef GALLIUM_LLVMPIPE
#include "llvmpipe/lp_public.h"
#endif
......@@ -55,6 +59,11 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver)
screen = swr_create_screen(winsys);
#endif
#if defined(GALLIUM_PANFROST)
if (screen == NULL && strcmp(driver, "panfrost") == 0)
screen = panfrost_create_screen(winsys);
#endif
return screen;
}
......@@ -71,6 +80,8 @@ sw_screen_create(struct sw_winsys *winsys)
default_driver = "softpipe";
#elif defined(GALLIUM_SWR)
default_driver = "swr";
#elif defined(GALLIUM_PANFROST)
default_driver = "panfrost";
#else
default_driver = "";
#endif
......
......@@ -24,6 +24,10 @@
#include "swr/swr_public.h"
#endif
#ifdef GALLIUM_PANFROST
#include "panfrost/pan_public.h"
#endif
#ifdef GALLIUM_VIRGL
#include "virgl/virgl_public.h"
#include "virgl/vtest/virgl_vtest_public.h"
......@@ -57,6 +61,11 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver)
screen = swr_create_screen(winsys);
#endif
#if defined(GALLIUM_PANFROST)
if (screen == NULL && strcmp(driver, "panfrost") == 0)
screen = panfrost_create_screen(-1, (struct renderonly *) winsys);
#endif
return screen;
}
......@@ -73,6 +82,8 @@ sw_screen_create(struct sw_winsys *winsys)
default_driver = "softpipe";
#elif defined(GALLIUM_SWR)
default_driver = "swr";
#elif defined(GALLIUM_PANFROST)
default_driver = "panfrost";
#else
default_driver = "";
#endif
......
......@@ -83,6 +83,12 @@ if with_gallium_freedreno
else
driver_freedreno = declare_dependency()
endif
if with_gallium_panfrost
subdir('winsys/panfrost/drm')
subdir('drivers/panfrost')
else
driver_panfrost = declare_dependency()
endif
if with_gallium_vc4
subdir('winsys/vc4/drm')
subdir('drivers/vc4')
......@@ -94,6 +100,11 @@ if with_gallium_pl111
else
driver_pl111 = declare_dependency()
endif
if with_gallium_rockchip
subdir('winsys/rockchip/drm')
else
driver_rockchip = declare_dependency()
endif
if with_gallium_v3d
subdir('winsys/v3d/drm')
subdir('drivers/v3d')
......
......@@ -58,11 +58,12 @@ libgallium_dri = shared_library(
driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
driver_pl111, driver_v3d, driver_vc4, driver_freedreno, driver_etnaviv,
driver_imx, driver_tegra, driver_i915, driver_svga, driver_virgl,
driver_swr,
driver_swr, driver_panfrost, driver_rockchip
],
)
foreach d : [[with_gallium_pl111, 'pl111_dri.so'],
[with_gallium_rockchip, 'rockchip_dri.so'],
[with_gallium_radeonsi, 'radeonsi_dri.so'],
[with_gallium_nouveau, 'nouveau_dri.so'],
[with_gallium_freedreno, ['msm_dri.so', 'kgsl_dri.so']],
......@@ -70,6 +71,7 @@ foreach d : [[with_gallium_pl111, 'pl111_dri.so'],
[with_gallium_softpipe and with_gallium_drisw_kms, 'kms_swrast_dri.so'],
[with_gallium_v3d, 'v3d_dri.so'],
[with_gallium_vc4, 'vc4_dri.so'],
[with_gallium_panfrost, 'panfrost_dri.so'],
[with_gallium_etnaviv, 'etnaviv_dri.so'],
[with_gallium_imx, 'imx-drm_dri.so'],
[with_gallium_tegra, 'tegra_dri.so'],
......
......@@ -82,6 +82,16 @@ DEFINE_LOADER_DRM_ENTRYPOINT(pl111)
#endif
#endif
#if defined(GALLIUM_PANFROST)
const __DRIextension **__driDriverGetExtensions_panfrost(void);
PUBLIC const __DRIextension **__driDriverGetExtensions_panfrost(void)
{
globalDriverAPI = &galliumsw_driver_api;
return galliumsw_driver_extensions;
}
#endif
#if defined(GALLIUM_ETNAVIV)
DEFINE_LOADER_DRM_ENTRYPOINT(imx_drm)
DEFINE_LOADER_DRM_ENTRYPOINT(etnaviv)
......
......@@ -746,7 +746,7 @@ driswDestroyScreen(struct glx_screen *base)
free(psc);
}
#define SWRAST_DRIVER_NAME "swrast"
#define SWRAST_DRIVER_NAME "panfrost"
static void *
driOpenSwrast(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment