drm: rename main to single_color
This commit is contained in:
parent
a6e5d755ce
commit
960694b184
4
drm/.gitignore
vendored
Normal file
4
drm/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
*
|
||||
!*.*
|
||||
!*/
|
||||
!Makefile
|
24
drm/Makefile
Normal file
24
drm/Makefile
Normal file
@ -0,0 +1,24 @@
|
||||
OPT = -O0
|
||||
|
||||
CFLAGS += -g
|
||||
CFLAGS += -Wall -Werror -Wfatal-errors
|
||||
CFLAGS += $(shell pkg-config --cflags libdrm)
|
||||
|
||||
LDFLAGS += $(shell pkg-config --libs libdrm)
|
||||
|
||||
%: %.c
|
||||
$(CC) $(ARCH) $(CFLAGS) $(LDFLAGS) $(OPT) $< -o $@
|
||||
|
||||
clean:
|
||||
find . -type f ! -name "*.*" -delete
|
||||
|
||||
.SUFFIXES:
|
||||
.INTERMEDIATE:
|
||||
.SECONDARY:
|
||||
.PHONY: all clean phony
|
||||
|
||||
%: RCS/%,v
|
||||
%: RCS/%
|
||||
%: %,v
|
||||
%: s.%
|
||||
%: SCCS/s.%
|
37
drm/command_processor.h
Normal file
37
drm/command_processor.h
Normal file
@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#define TYPE_0_COUNT(c) (((c) & 0x3fff) << 16)
|
||||
#define TYPE_0_ONE_REG (1 << 15)
|
||||
#define TYPE_0_BASE_INDEX(i) (((i) & 0x1fff) << 0)
|
||||
|
||||
#define TYPE_3_COUNT(c) (((c) & 0x3fff) << 16)
|
||||
#define TYPE_3_OPCODE(o) (((o) & 0xff) << 8)
|
||||
|
||||
#define T0(address, count) \
|
||||
do { \
|
||||
ib[ix++].u32 = TYPE_0_COUNT(count) | TYPE_0_BASE_INDEX(address >> 2); \
|
||||
} while (0);
|
||||
|
||||
#define T0_ONE_REG(address, count) \
|
||||
do { \
|
||||
ib[ix++].u32 = TYPE_0_COUNT(count) | TYPE_0_ONE_REG | TYPE_0_BASE_INDEX(address >> 2); \
|
||||
} while (0);
|
||||
|
||||
#define T0V(address, value) \
|
||||
do { \
|
||||
ib[ix++].u32 = TYPE_0_COUNT(0) | TYPE_0_BASE_INDEX(address >> 2); \
|
||||
ib[ix++].u32 = value; \
|
||||
} while (0);
|
||||
|
||||
#define T0Vf(address, value) \
|
||||
do { \
|
||||
ib[ix++].u32 = TYPE_0_COUNT(0) | TYPE_0_BASE_INDEX(address >> 2); \
|
||||
ib[ix++].f32 = value; \
|
||||
} while (0);
|
||||
|
||||
#define T3(opcode, count) \
|
||||
do { \
|
||||
ib[ix++].u32 = (0b11 << 30) | TYPE_3_COUNT(count) | TYPE_3_OPCODE(opcode); \
|
||||
} while (0);
|
||||
|
||||
#define _3D_DRAW_IMMD_2 0x35
|
@ -14,6 +14,7 @@
|
||||
#include "3d_registers.h"
|
||||
#include "3d_registers_undocumented.h"
|
||||
#include "3d_registers_bits.h"
|
||||
#include "command_processor.h"
|
||||
|
||||
union u32_f32 {
|
||||
uint32_t u32;
|
||||
@ -22,42 +23,6 @@ union u32_f32 {
|
||||
|
||||
static union u32_f32 ib[16384];
|
||||
|
||||
#define TYPE_0_COUNT(c) (((c) & 0x3fff) << 16)
|
||||
#define TYPE_0_ONE_REG (1 << 15)
|
||||
#define TYPE_0_BASE_INDEX(i) (((i) & 0x1fff) << 0)
|
||||
|
||||
#define TYPE_3_COUNT(c) (((c) & 0x3fff) << 16)
|
||||
#define TYPE_3_OPCODE(o) (((o) & 0xff) << 8)
|
||||
|
||||
#define T0(address, count) \
|
||||
do { \
|
||||
ib[ix++].u32 = TYPE_0_COUNT(count) | TYPE_0_BASE_INDEX(address >> 2); \
|
||||
} while (0);
|
||||
|
||||
#define T0_ONE_REG(address, count) \
|
||||
do { \
|
||||
ib[ix++].u32 = TYPE_0_COUNT(count) | TYPE_0_ONE_REG | TYPE_0_BASE_INDEX(address >> 2); \
|
||||
} while (0);
|
||||
|
||||
#define T0V(address, value) \
|
||||
do { \
|
||||
ib[ix++].u32 = TYPE_0_COUNT(0) | TYPE_0_BASE_INDEX(address >> 2); \
|
||||
ib[ix++].u32 = value; \
|
||||
} while (0);
|
||||
|
||||
#define T0Vf(address, value) \
|
||||
do { \
|
||||
ib[ix++].u32 = TYPE_0_COUNT(0) | TYPE_0_BASE_INDEX(address >> 2); \
|
||||
ib[ix++].f32 = value; \
|
||||
} while (0);
|
||||
|
||||
#define T3(opcode, count) \
|
||||
do { \
|
||||
ib[ix++].u32 = (0b11 << 30) | TYPE_3_COUNT(count) | TYPE_3_OPCODE(opcode); \
|
||||
} while (0);
|
||||
|
||||
#define _3D_DRAW_IMMD_2 0x35
|
||||
|
||||
int indirect_buffer()
|
||||
{
|
||||
int ix = 0;
|
Loading…
x
Reference in New Issue
Block a user