mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
parent
c1029dd556
commit
dbff692c86
2
repos/libports/lib/import/import-drm.mk
Normal file
2
repos/libports/lib/import/import-drm.mk
Normal file
@ -0,0 +1,2 @@
|
||||
DRM_DIR = $(call select_from_ports,drm)/src/lib/drm
|
||||
INC_DIR += $(DRM_DIR) $(addprefix $(DRM_DIR)/,intel include/drm)
|
26
repos/libports/lib/mk/drm.mk
Normal file
26
repos/libports/lib/mk/drm.mk
Normal file
@ -0,0 +1,26 @@
|
||||
SHARED_LIB = yes
|
||||
LIBS = libc
|
||||
DRM_SRC_DIR := $(call select_from_ports,drm)/src/lib/drm
|
||||
LIB_DIR = $(REP_DIR)/src/lib/drm
|
||||
|
||||
INC_DIR += $(DRM_SRC_DIR)/include/drm $(LIB_DIR)/include \
|
||||
$(DRM_SRC_DIR)
|
||||
|
||||
SRC_C = intel/intel_bufmgr.c \
|
||||
intel/intel_bufmgr_gem.c \
|
||||
intel/intel_decode.c \
|
||||
xf86drm.c xf86drmHash.c \
|
||||
xf86drmRandom.c
|
||||
|
||||
SRC_CC = dummies.cc ioctl.cc
|
||||
|
||||
CC_OPT = -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 -DO_CLOEXEC=0
|
||||
|
||||
#
|
||||
# We rename 'ioctl' calls to 'genode_ioctl' calls, this way we are not required
|
||||
# to write a libc plugin for libdrm.
|
||||
#
|
||||
CC_C_OPT += -Dioctl=genode_ioctl
|
||||
|
||||
vpath %.c $(DRM_SRC_DIR)
|
||||
vpath %.cc $(LIB_DIR)
|
1
repos/libports/ports/drm.hash
Normal file
1
repos/libports/ports/drm.hash
Normal file
@ -0,0 +1 @@
|
||||
97d3bb14d989f15d91f42b0cba901be5841bff4b
|
11
repos/libports/ports/drm.port
Normal file
11
repos/libports/ports/drm.port
Normal file
@ -0,0 +1,11 @@
|
||||
LICENSE := MIT
|
||||
VERSION := 2.4.65
|
||||
DOWNLOADS := drm.archive
|
||||
|
||||
URL(drm) := https://dri.freedesktop.org/libdrm/libdrm-$(VERSION).tar.bz2
|
||||
SHA(drm) := 74a6b2aa8c436e822e3ec5c52e463313c4e219d9
|
||||
DIR(drm) := src/lib/drm
|
||||
TAR_OPT(drm) := --strip-components=1 --files-from $(REP_DIR)/src/lib/drm/files.list
|
||||
HASH_INPUT += $(REP_DIR)/src/lib/mesa/files.list
|
||||
|
||||
|
55
repos/libports/src/lib/drm/dummies.cc
Normal file
55
repos/libports/src/lib/drm/dummies.cc
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* \brief DRM library dummies
|
||||
* \author Sebastian Sumpf
|
||||
* \date 2017-08-17
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
extern "C" {
|
||||
#include <pciaccess.h>
|
||||
}
|
||||
|
||||
#include <base/log.h>
|
||||
|
||||
#define TRACE Genode::log(__func__, "called not implemented");
|
||||
|
||||
int pci_system_init(void)
|
||||
{
|
||||
TRACE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void pci_system_cleanup(void)
|
||||
{
|
||||
TRACE;
|
||||
}
|
||||
|
||||
|
||||
struct pci_device *pci_device_find_by_slot(uint32_t domain, uint32_t bus,
|
||||
uint32_t dev, uint32_t func)
|
||||
{
|
||||
TRACE;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
int pci_device_probe(struct pci_device *dev)
|
||||
{
|
||||
TRACE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int posix_memalign(void **memptr, size_t alignment, size_t size)
|
||||
{
|
||||
TRACE;
|
||||
return -1;
|
||||
}
|
18
repos/libports/src/lib/drm/files.list
Normal file
18
repos/libports/src/lib/drm/files.list
Normal file
@ -0,0 +1,18 @@
|
||||
libdrm-2.4.65/libdrm_lists.h
|
||||
libdrm-2.4.65/xf86atomic.h
|
||||
libdrm-2.4.65/xf86drm.c
|
||||
libdrm-2.4.65/xf86drm.h
|
||||
libdrm-2.4.65/xf86drmHash.c
|
||||
libdrm-2.4.65/xf86drmHash.h
|
||||
libdrm-2.4.65/xf86drmRandom.c
|
||||
libdrm-2.4.65/xf86drmRandom.h
|
||||
libdrm-2.4.65/include/drm/drm_mode.h
|
||||
libdrm-2.4.65/include/drm/drm.h
|
||||
libdrm-2.4.65/include/drm/i915_drm.h
|
||||
libdrm-2.4.65/intel/intel_aub.h
|
||||
libdrm-2.4.65/intel/intel_bufmgr.c
|
||||
libdrm-2.4.65/intel/intel_bufmgr.h
|
||||
libdrm-2.4.65/intel/intel_bufmgr_priv.h
|
||||
libdrm-2.4.65/intel/intel_bufmgr_gem.c
|
||||
libdrm-2.4.65/intel/intel_chipset.h
|
||||
libdrm-2.4.65/intel/intel_decode.c
|
9
repos/libports/src/lib/drm/include/genode_types.h
Normal file
9
repos/libports/src/lib/drm/include/genode_types.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef _INCLUDE__GENODE_TYPES_H_
|
||||
#define _INCLUDE__GENODE_TYPES_H_
|
||||
|
||||
#include <base/fixed_stdint.h>
|
||||
|
||||
typedef genode_uint32_t uint32_t;
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
|
||||
#endif /* _INCLUDE__GENODE_TYPES_H_ */
|
20
repos/libports/src/lib/drm/include/libdrm_macros.h
Normal file
20
repos/libports/src/lib/drm/include/libdrm_macros.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef _INCLUDE__LIBDRM_MACROS_H_
|
||||
#define _INCLUDE__LIBDRM_MACROS_H_
|
||||
|
||||
#include <sys/mman.h>
|
||||
|
||||
/**
|
||||
* On Genode the virtual address of MMAP_GTT is stored in the offset
|
||||
*/
|
||||
static inline void *drm_mmap(void *addr, size_t length, int prot, int flags,
|
||||
int fd, off_t offset)
|
||||
{
|
||||
return (void *)offset;
|
||||
}
|
||||
|
||||
static inline int drm_munmap(void *addr, size_t length)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__LIBDRM_MACROS_H_ */
|
23
repos/libports/src/lib/drm/include/pciaccess.h
Normal file
23
repos/libports/src/lib/drm/include/pciaccess.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef _INCLUDE__PCIACCESS_H_
|
||||
#define _INCLUDE__PCIACCESS_H_
|
||||
|
||||
#include <genode_types.h>
|
||||
|
||||
struct pci_mem_region
|
||||
{
|
||||
void *memory;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct pci_device
|
||||
{
|
||||
struct pci_mem_region regions[6];
|
||||
};
|
||||
|
||||
int pci_system_init(void);
|
||||
void pci_system_cleanup(void);
|
||||
int pci_device_probe(struct pci_device *dev);
|
||||
|
||||
struct pci_device *pci_device_find_by_slot(uint32_t domain, uint32_t bus,
|
||||
uint32_t dev, uint32_t func);
|
||||
#endif /* _INCLUDE__PCIACCESS_H_ */
|
26
repos/libports/src/lib/drm/ioctl.cc
Normal file
26
repos/libports/src/lib/drm/ioctl.cc
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* \brief Called for every DRM function (implement me)
|
||||
* \author Sebastian Sumpf
|
||||
* \date 2017-08-17
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
#include <drm.h>
|
||||
#include <i915_drm.h>
|
||||
}
|
||||
|
||||
#include <base/log.h>
|
||||
|
||||
|
||||
extern "C" int genode_ioctl(int fd, unsigned long request, void *arg)
|
||||
{
|
||||
Genode::error(__func__, " not implemented");
|
||||
return -1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user