-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
234 changed files
with
49,516 additions
and
4,257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
buildroot-overlay/board/canaan/k230-soc/rootfs_overlay/etc/version/release_version
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
project(display | ||
VERSION 1.0 | ||
DESCRIPTION "abstruct to libdrm" | ||
) | ||
|
||
include(FindPkgConfig) | ||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(LIBDRM REQUIRED libdrm) | ||
|
||
file(GLOB SOURCES "src/*.c") | ||
|
||
add_library(${PROJECT_NAME} src/display.c) | ||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<BUILD_INTERFACE:${LIBDRM_INCLUDE_DIRS}> | ||
#$<INSTALL_INTERFACE:${LIBDRM_INCLUDE_DIRS}> | ||
) | ||
target_link_libraries(${PROJECT_NAME} ${LIBDRM_LIBRARIES}) | ||
|
||
if(${BUILD_TEST}) | ||
add_executable(test-${PROJECT_NAME} src/test.cpp) | ||
target_link_libraries(test-${PROJECT_NAME} display) | ||
endif(${BUILD_TEST}) | ||
|
||
|
||
install(DIRECTORY include/ DESTINATION include) | ||
install(TARGETS ${PROJECT_NAME} DESTINATION lib) | ||
|
||
set(DRM_INCLUDES "") | ||
foreach(DRM_INCLUDE ${LIBDRM_INCLUDE_DIRS}) | ||
set(DRM_INCLUDES "${DRM_INCLUDES} -I${DRM_INCLUDE}") | ||
endforeach(DRM_INCLUDE ${LIBDRM_INCLUDE_DIRS}) | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in | ||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc | ||
@ONLY | ||
) | ||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config BR2_PACKAGE_DISPLAY | ||
bool "libdrm abstruct library for display" | ||
select BR2_PACKAGE_LIBDRM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
################################################################################ | ||
# | ||
# display | ||
# | ||
################################################################################ | ||
|
||
DISPLAY_DIR_NAME := display | ||
DISPLAY_APP_NAME := display | ||
DISPLAY_SITE = $(realpath $(TOPDIR))"/package/display" | ||
DISPLAY_SITE_METHOD = local | ||
DISPLAY_INSTALL_STAGING = YES | ||
DISPLAY_INSTALL_TARGET = YES | ||
DISPLAY_DEPENDENCIES = libdrm | ||
|
||
$(eval $(cmake-package)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
includedir=${prefix}/include | ||
libdir=${prefix}/lib | ||
|
||
Name: @PROJECT_NAME@ | ||
Description: @PROJECT_DESCRIPTION@ | ||
Version: @PROJECT_VERSION@ | ||
Libs: -L${libdir} -l@PROJECT_NAME@ | ||
Libs.private: -ldrm | ||
Cflags: -I${includedir} -I${includedir}/libdrm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#pragma once | ||
#ifndef __DISPLAY_H__ | ||
#define __DISPLAY_H__ | ||
|
||
#include <xf86drmMode.h> | ||
#include <xf86drm.h> | ||
#include <drm/drm_fourcc.h> | ||
#include <stdbool.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define MAX_PROPS 128 | ||
#define DISPLAY_QUEUE_DEPTH 3 | ||
|
||
struct display { | ||
int fd; | ||
uint32_t conn_id, enc_id, crtc_id, blob_id; | ||
int crtc_idx; | ||
uint32_t width, height; | ||
uint32_t mmWidth, mmHeight; | ||
drmModeModeInfo mode; | ||
drmModeCrtcPtr crtc; | ||
drmModePropertyPtr crtc_props[MAX_PROPS]; | ||
uint32_t crtc_props_count; | ||
drmModeConnectorPtr conn; | ||
drmModePropertyPtr conn_props[MAX_PROPS]; | ||
uint32_t conn_props_count; | ||
drmModeAtomicReqPtr req; | ||
uint32_t commitFlags; | ||
drmEventContext drm_event_ctx; | ||
struct display_plane* planes; | ||
}; | ||
|
||
struct display_buffer { | ||
struct display_buffer* next; | ||
struct display_plane* plane; | ||
uint32_t handle; | ||
uint32_t stride, width, height; | ||
uint32_t size; | ||
int dmabuf_fd; | ||
uint32_t id; | ||
void* map; | ||
}; | ||
|
||
struct display_plane { | ||
struct display_plane* next; | ||
struct display* display; | ||
drmModePlanePtr plane; | ||
drmModePropertyPtr props[MAX_PROPS]; | ||
uint8_t props_count; | ||
uint32_t plane_id; | ||
unsigned int fourcc; | ||
bool first; | ||
struct display_buffer* buffers; | ||
}; | ||
|
||
void display_exit(struct display* display); | ||
struct display* display_init(unsigned device); | ||
struct display_plane* display_get_plane(struct display* display, unsigned int fourcc); | ||
void display_free_plane(struct display_plane* plane); | ||
struct display_buffer* display_allocate_buffer(struct display_plane* plane, uint32_t width, uint32_t height); | ||
void display_free_plane(struct display_plane* plane); | ||
void display_free_buffer(struct display_buffer* buffer); | ||
int display_commit_buffer(const struct display_buffer* buffer, uint32_t x, uint32_t y); | ||
int display_update_buffer(struct display_buffer* buffer, uint32_t x, uint32_t y); | ||
int display_commit(struct display* display); | ||
void display_wait_vsync(struct display* display); | ||
void display_handle_vsync(struct display* display); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Oops, something went wrong.