...
 
Commits (42)
......@@ -130,11 +130,13 @@ endif
with_gallium = false
with_gallium_pl111 = false
with_gallium_rockchip = false
with_gallium_radeonsi = false
with_gallium_r300 = false
with_gallium_r600 = false
with_gallium_nouveau = false
with_gallium_freedreno = false
with_gallium_panfrost = false
with_gallium_softpipe = false
with_gallium_vc4 = false
with_gallium_vc5 = false
......@@ -156,7 +158,7 @@ if _drivers.contains('auto')
elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
_drivers = [
'pl111', 'vc4', 'vc5', 'freedreno', 'etnaviv', 'imx', 'nouveau',
'tegra', 'virgl', 'swrast',
'tegra', 'virgl', 'swrast', 'panfrost', 'rockchip'
]
else
error('Unknown architecture. Please pass -Dgallium-drivers to set driver options. Patches gladly accepted to fix this.')
......@@ -169,6 +171,7 @@ if _drivers.contains('auto')
endif
if _drivers != ['']
with_gallium_pl111 = _drivers.contains('pl111')
with_gallium_rockchip = _drivers.contains('rockchip')
with_gallium_radeonsi = _drivers.contains('radeonsi')
with_gallium_r300 = _drivers.contains('r300')
with_gallium_r600 = _drivers.contains('r600')
......@@ -177,6 +180,7 @@ if _drivers != ['']
with_gallium_softpipe = _drivers.contains('swrast')
with_gallium_vc4 = _drivers.contains('vc4')
with_gallium_vc5 = _drivers.contains('vc5')
with_gallium_panfrost = _drivers.contains('panfrost')
with_gallium_etnaviv = _drivers.contains('etnaviv')
with_gallium_imx = _drivers.contains('imx')
with_gallium_tegra = _drivers.contains('tegra')
......@@ -233,6 +237,9 @@ endif
if with_gallium_tegra and not with_gallium_nouveau
error('tegra driver requires nouveau driver')
endif
if with_gallium_rockchip and not with_gallium_panfrost
error('rockchip driver requires panfrost driver')
endif
if host_machine.system() == 'darwin'
with_dri_platform = 'apple'
......
......@@ -60,7 +60,7 @@ option(
choices : [
'', 'auto', 'pl111', 'radeonsi', 'r300', 'r600', 'nouveau', 'freedreno',
'swrast', 'vc4', 'vc5', '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'
)
......
......@@ -1894,6 +1894,9 @@ typedef struct nir_shader_compiler_options {
/** enables rules to lower idiv by power-of-two: */
bool lower_idiv;
/* lower b2f to iand */
bool lower_b2f;
/* Does the native fdot instruction replicate its result for four
* components? If so, then opt_algebraic_late will turn all fdotN
* instructions into fdot_replicatedN instructions.
......
......@@ -321,7 +321,8 @@ optimizations = [
(('imul', ('b2i', a), ('b2i', b)), ('b2i', ('iand', a, b))),
(('fmul', ('b2f', a), ('b2f', b)), ('b2f', ('iand', a, b))),
(('fsat', ('fadd', ('b2f', a), ('b2f', b))), ('b2f', ('ior', a, b))),
(('iand', 'a@bool', 1.0), ('b2f', a)),
(('iand', 'a@bool', 1.0), ('b2f', a), '!options->lower_b2f'),
(('b2f@32', a), ('iand', a, 1.0), 'options->lower_b2f'),
# True/False are ~0 and 0 in NIR. b2i of True is 1, and -1 is ~0 (True).
(('ineg', ('b2i@32', a)), a),
(('flt', ('fneg', ('b2f', a)), 0), a), # Generated by TGSI KILL_IF.
......
......@@ -1246,7 +1246,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;
......
......@@ -110,6 +110,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,
......@@ -125,6 +130,11 @@ static const struct drm_driver_descriptor driver_descriptors[] = {
.create_screen = pipe_vc5_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_vc4_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
pipe_vc5_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
......
/home/alyssa/panfrost/
\ No newline at end of file
......@@ -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_vc5
subdir('winsys/vc5/drm')
subdir('drivers/vc5')
......
......@@ -58,11 +58,12 @@ libgallium_dri = shared_library(
driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
driver_pl111, driver_vc4, driver_vc5, 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_vc4, 'vc4_dri.so'],
[with_gallium_vc5, 'vc5_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)
DEFINE_LOADER_DRM_ENTRYPOINT(vc5)
#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)
......
# Copyright (C) 2014 Emil Velikov <emil.l.velikov@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
LOCAL_PATH := $(call my-dir)
# get C_SOURCES
include $(LOCAL_PATH)/Makefile.sources
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(C_SOURCES)
LOCAL_MODULE := libmesa_winsys_vc4
include $(GALLIUM_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)
# Copyright © 2014 Broadcom
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
$(GALLIUM_WINSYS_CFLAGS)
noinst_LTLIBRARIES = libvc4drm.la
libvc4drm_la_SOURCES = $(C_SOURCES)
EXTRA_DIST = meson.build
C_SOURCES := \
vc4_drm_public.h \
vc4_drm_winsys.c
# Copyright © 2017 Broadcom
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
libpanfrostwinsys = static_library(
'panfrostwinsys',
files('panfrost_drm_winsys.c'),
include_directories : [
inc_src, inc_include,
inc_gallium, inc_gallium_aux, inc_gallium_drivers,
],
c_args : [c_vis_args],
)
/*
* Copyright © 2014 Broadcom
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef __PAN_DRM_PUBLIC_H__
#define __PAN_DRM_PUBLIC_H__
struct pipe_screen;
struct renderonly;
struct pipe_screen *panfrost_drm_screen_create(int drmFD);
struct pipe_screen *panfrost_drm_screen_create_renderonly(struct renderonly *ro);
#endif /* __PAN_DRM_PUBLIC_H__ */
/*
* Copyright © 2014 Broadcom
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include <unistd.h>
#include <fcntl.h>
#include "renderonly/renderonly.h"
#include "panfrost_drm_public.h"
#include "panfrost/pan_public.h"
struct pipe_screen *
panfrost_drm_screen_create(int fd)
{
return panfrost_create_screen(fcntl(fd, F_DUPFD_CLOEXEC, 3), NULL);
}
struct pipe_screen *
panfrost_drm_screen_create_renderonly(struct renderonly *ro)
{
return panfrost_create_screen(fcntl(ro->gpu_fd, F_DUPFD_CLOEXEC, 3), ro);
}
# Copyright (C) 2014 Emil Velikov <emil.l.velikov@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
LOCAL_PATH := $(call my-dir)
# get C_SOURCES
include $(LOCAL_PATH)/Makefile.sources
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(C_SOURCES)
LOCAL_MODULE := libmesa_winsys_pl111
include $(GALLIUM_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)
# Copyright © 2012 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/src/gallium/winsys \
$(GALLIUM_WINSYS_CFLAGS) \
$(LIBDRM_CFLAGS)
noinst_LTLIBRARIES = libpl111drm.la
libpl111drm_la_SOURCES = $(C_SOURCES)
EXTRA_DIST = meson.build
C_SOURCES := \
pl111_drm_public.h \
pl111_drm_winsys.c
# Copyright © 2017 Broadcom
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
librockchipwinsys = static_library(
'rockchipwinsys',
files('rockchip_drm_winsys.c'),
include_directories : [
inc_src, inc_include,
inc_gallium, inc_gallium_aux, inc_gallium_winsys,
],
c_args : [c_vis_args],
dependencies: dep_libdrm,
link_with : libpanfrostwinsys,
)
driver_rockchip = declare_dependency(
compile_args : '-DGALLIUM_ROCKCHIP',
link_with : librockchipwinsys,
)
/*
* Copyright (C) 2016 Christian Gmeiner <christian.gmeiner@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Christian Gmeiner <christian.gmeiner@gmail.com>
*/
#ifndef __ROCKCHIP_DRM_PUBLIC_H__
#define __ROCKCHIP_DRM_PUBLIC_H__
struct pipe_screen;
struct pipe_screen *rockchip_drm_screen_create(int fd);
#endif /* __ROCKCHIP_DRM_PUBLIC_H__ */
/*
* Copyright (C) 2016 Christian Gmeiner <christian.gmeiner@gmail.com>
* Copyright (C) 2017 Broadcom
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <fcntl.h>
#include <unistd.h>
#include "rockchip_drm_public.h"
#include "panfrost/drm/panfrost_drm_public.h"
#include "xf86drm.h"
#include "pipe/p_screen.h"
#include "renderonly/renderonly.h"
struct pipe_screen *rockchip_drm_screen_create(int fd)
{
struct renderonly ro = {
/* Passes the panfrost-allocated BO through to the rockchip DRM device using
* PRIME buffer sharing. The VC4 BO must be linear, which the SCANOUT
* flag on allocation will have ensured.
*/
.create_for_resource = renderonly_create_gpu_import_for_resource,
.kms_fd = fd,
.gpu_fd = drmOpenWithType("panfrost", NULL, DRM_NODE_RENDER),
};
if (ro.gpu_fd < 0)
return NULL;
struct pipe_screen *screen = panfrost_drm_screen_create_renderonly(&ro);
if (!screen)
close(ro.gpu_fd);
return screen;
}
......@@ -598,7 +598,7 @@ driswDestroyScreen(struct glx_screen *base)
free(psc);
}
#define SWRAST_DRIVER_NAME "swrast"
#define SWRAST_DRIVER_NAME "panfrost"
static void *
driOpenSwrast(void)
......