diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-12 02:07:48 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-12 02:07:48 +0100 |
commit | 33b7e8f777727b2e53365b2dbd355a665c51501e (patch) | |
tree | ff00316e188379683371cb7974f757c1e07d2269 | |
parent | type + update todo, drm looks like the solution for not requiring X/Wayland/Mir (diff) | |
download | blueshift-33b7e8f777727b2e53365b2dbd355a665c51501e.tar.gz blueshift-33b7e8f777727b2e53365b2dbd355a665c51501e.tar.bz2 blueshift-33b7e8f777727b2e53365b2dbd355a665c51501e.tar.xz |
begin on drm support
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | DEPENDENCIES | 2 | ||||
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | dist/archlinux/stable/PKGBUILD | 4 | ||||
-rw-r--r-- | src/blueshift_drm_c.c | 44 |
5 files changed, 56 insertions, 3 deletions
@@ -18,6 +18,7 @@ obj/ __pycache__/ /src/blueshift_randr.c /src/blueshift_vidmode.c +/src/blueshift_drm.c *.info *.pdf *.dvi diff --git a/DEPENDENCIES b/DEPENDENCIES index cffcbe9..bbddafb 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -4,6 +4,7 @@ RUNTIME DEPENDENCIES: libxcb (opt-out, for randr, crtc identification and icc profile listing) libx11 (opt-out, for vidmode) libxxf86vm (opt-out, for vidmode) + libdrm (opt-out, for drm) adjbacklight (optional, for permission-hasslefree backlight adjustments) linux (optional, for backlight support) argparser-python (https://github.com/maandree/argparser) @@ -17,6 +18,7 @@ MAKE DEPENDENCIES: libxcb (opt-out, for randr, crtc identification and icc profile listing) libx11 (opt-out, for vidmode) libxxf86vm (opt-out, for vidmode) + libdrm (opt-out, for drm) make coreutils sed @@ -39,7 +39,7 @@ PKGNAME ?= blueshift # Bindings for display server access SERVER_BINDINGS ?= randr vidmode # Executable bindings for display server access -EXECS ?= idcrtc iccprofile +EXECS ?= idcrtc iccprofile drm # Executable library files EXECLIBS = $(foreach E,$(EXECS),blueshift_$(E)) @@ -55,6 +55,7 @@ LIBS_idcrtc = xcb-randr LIBS_iccprofile = xcb LIBS_randr = xcb-randr LIBS_vidmode = x11 xxf86vm +LIBS_drm = libdrm LIBS = python3 $(foreach B,$(SERVER_BINDINGS) $(EXECS),$(LIBS_$(B))) FLAGS = $$($(PKGCONFIG) --cflags $(LIBS)) -std=$(STD) $(WARN) $(OPTIMISE) -fPIC $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) @@ -94,6 +95,11 @@ bin/blueshift_iccprofile: obj/blueshift_iccprofile.o @mkdir -p bin $(CC) $(FLAGS) $$($(PKGCONFIG) --libs $($(LIBS_))) -o $@ $^ +bin/blueshift_drm: LIBS_=LIBS_drm +bin/blueshift_drm: obj/blueshift_drm_c.o + @mkdir -p bin + $(CC) $(FLAGS) $$($(PKGCONFIG) --libs $($(LIBS_))) -o $@ $^ + bin/blueshift_randr.so: LIBS_=LIBS_randr bin/blueshift_vidmode.so: LIBS_=LIBS_vidmode bin/%.so: obj/%.o obj/%_c.o diff --git a/dist/archlinux/stable/PKGBUILD b/dist/archlinux/stable/PKGBUILD index f51a19f..be80463 100644 --- a/dist/archlinux/stable/PKGBUILD +++ b/dist/archlinux/stable/PKGBUILD @@ -7,10 +7,10 @@ pkgdesc="An extensible and highly configurable alternative to redshift" arch=(i686 x86_64) url="https://github.com/maandree/blueshift" license=('AGPL3' 'GPL3' 'custom:GFDL1.3') -depends=(python3 argparser libxcb libxxf86vm libx11) +depends=(python3 argparser libxcb libxxf86vm libx11 libdrm) optdepends=('adjbacklight: for backlight adjustments without root requirements' 'linux: for backlight support') -makedepends=(cython gcc python3 libxcb libxxf86vm libx11 make coreutils sed zip texinfo auto-auto-complete) +makedepends=(cython gcc python3 libxcb libxxf86vm libx11 libdrm make coreutils sed zip texinfo auto-auto-complete) install=blueshift.install source=($url/archive/$pkgver.tar.gz) sha256sums=(NOT_YET_TAGGED) diff --git a/src/blueshift_drm_c.c b/src/blueshift_drm_c.c new file mode 100644 index 0000000..5007a24 --- /dev/null +++ b/src/blueshift_drm_c.c @@ -0,0 +1,44 @@ +/** + * Copyright © 2014 Mattias Andrée (maandree@member.fsf.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include <stdlib.h> +#include <stdio.h> +#include <sys/types.h> +#include <dirent.h> + +#include <xf86drm.h> +#include <xf86drmMode.h> + +/* Requires video group */ + + +int main(int argc, char** argv) +{ + DIR* dir; + + (void) argc; + (void) argv; + + if ((dir = opendir("/dev/dri")) == NULL) + { + perror("opendir"); + return 1; + } + + free(dir); + return 0; +} + |