summaryrefslogtreecommitdiff
path: root/bsd-core/r128/Makefile
blob: 2d2e7e4feb851824fcd092f0c0620472dc5b20ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# $FreeBSD$

.PATH:	${.CURDIR}/..
KMOD	= r128
NOMAN=	YES
SRCS    = r128_cce.c r128_drv.c r128_state.c r128_irq.c
SRCS   += device_if.h bus_if.h pci_if.h opt_drm.h
CFLAGS += ${DEBUG_FLAGS} -I. -I..

.if defined(DRM_DEBUG)
DRM_DEBUG_OPT= "\#define DRM_DEBUG 1"
.endif

.if !defined(DRM_NOLINUX)
DRM_LINUX_OPT= "\#define DRM_LINUX 1"
.endif

opt_drm.h:
	touch opt_drm.h
	echo $(DRM_DEBUG_OPT) >> opt_drm.h
	echo $(DRM_LINUX_OPT) >> opt_drm.h

.include <bsd.kmod.mk>
">; namespace kms { Framebuffer::Framebuffer(Card& card, uint32_t width, uint32_t height) : DrmObject(card, DRM_MODE_OBJECT_FB), m_width(width), m_height(height) { card.m_framebuffers.push_back(this); } Framebuffer::Framebuffer(Card& card, uint32_t id) : DrmObject(card, id, DRM_MODE_OBJECT_FB) { auto fb = drmModeGetFB(card.fd(), id); if (fb) { m_width = fb->width; m_height = fb->height; drmModeFreeFB(fb); } else { m_width = m_height = 0; } card.m_framebuffers.push_back(this); } void Framebuffer::flush() { drmModeClip clip { }; clip.x1 = clip.y1 = 0; clip.x2 = width(); clip.y2 = height(); drmModeDirtyFB(card().fd(), id(), &clip, 1); } Framebuffer::~Framebuffer() { auto& fbs = card().m_framebuffers; auto iter = find(fbs.begin(), fbs.end(), this); card().m_framebuffers.erase(iter); } }