Skip to content

Commit

Permalink
Import few patches from upstream to allow building with newer xorg
Browse files Browse the repository at this point in the history
Note that those drivers are barely maintained and might disappear in the futur

PR:		216281
Submitted by:	matthew@reztek.cz
  • Loading branch information
bapt committed Jan 23, 2017
1 parent 05e51da commit 230f4f8
Show file tree
Hide file tree
Showing 10 changed files with 836 additions and 2 deletions.
1 change: 1 addition & 0 deletions x11-drivers/xf86-video-cirrus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

PORTNAME= xf86-video-cirrus
PORTVERSION= 1.5.3
PORREVISION= 1
CATEGORIES= x11-drivers

MAINTAINER= x11@FreeBSD.org
Expand Down
127 changes: 127 additions & 0 deletions x11-drivers/xf86-video-cirrus/files/patch-Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Regen with autoreconf after git_04_27f85fc
#
--- Makefile.in.orig 2016-11-24 04:17:45 UTC
+++ Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@

-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -34,7 +34,17 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -98,14 +108,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.h.in COPYING ChangeLog INSTALL README compile \
- config.guess config.sub depcomp install-sh missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@@ -169,6 +177,9 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
+ COPYING ChangeLog INSTALL NEWS README compile config.guess \
+ config.sub install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -265,6 +276,7 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MAN_SUBSTS = @MAN_SUBSTS@
@@ -375,7 +387,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -608,15 +619,15 @@ dist-xz: distdir
$(am__post_remove_distdir)

dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)

dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@@ -652,17 +663,17 @@ distcheck: dist
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -840,6 +851,8 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am

+.PRECIOUS: Makefile
+

.PHONY: ChangeLog INSTALL

37 changes: 37 additions & 0 deletions x11-drivers/xf86-video-cirrus/files/patch-git_01_23da607
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 23da6073369ef6a99d1789de967e57359d1fe3b0 Mon Sep 17 00:00:00 2001
From: Stefan Dirsch <sndirsch@suse.de>
Date: Tue, 26 Apr 2016 16:26:49 +0200
Subject: Disable "acceleration" under qemu

Disable "acceleration" under qemu, since taking the hypercall trap
is really quite expensive and you're better off doing noaccel. Patch
is based on the one by "Adam Jackson" <ajax@redhat.com>

http://pkgs.fedoraproject.org/cgit/rpms/xorg-x11-drv-cirrus.git/tree/cirrus-1.2.0-qemu.patch?id=daccd1c8174623500eddfa297d8ea76a86d3c5d9

Reviewed-by: Adam Jackson <ajax@redhat.com>

diff --git a/src/alp_driver.c b/src/alp_driver.c
index bd5e52f..ba55247 100644
--- src/alp_driver.c
+++ src/alp_driver.c
@@ -774,6 +774,16 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
else
xf86SetDDCproperties(pScrn,xf86PrintEDID(
xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn),pCir->I2CPtr1)));
+
+#ifdef XSERVER_LIBPCIACCESS
+ #ifndef PCI_CHIP_QEMU
+ #define PCI_CHIP_QEMU 0x1af4
+ #endif
+ if (!pScrn->monitor->DDC &&
+ ((pCir->PciInfo->subvendor_id & 0xffff) == PCI_CHIP_QEMU)) {
+ pCir->NoAccel = TRUE;
+ }
+#endif

/* Probe the possible LCD display */
AlpProbeLCD(pScrn);
--
cgit v0.10.2

50 changes: 50 additions & 0 deletions x11-drivers/xf86-video-cirrus/files/patch-git_02_82db44f
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From 82db44fe8a726a4a1192b1b93992b642d0ec17b3 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 26 Apr 2016 13:57:52 +0200
Subject: Use 16bpp when running in virt and on XenSource gfx

Due to graphics corruption default to 16bpp in virt instead of 24 (Fedora).
Do the same on XenSource gfx, which suffers from the same issue.

Reviewed-by: Adam Jackson <ajax@redhat.com>

diff --git a/src/alp_driver.c b/src/alp_driver.c
index ba55247..01e05dc 100644
--- src/alp_driver.c
+++ src/alp_driver.c
@@ -466,6 +466,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
vgaHWPtr hwp;
MessageType from, from1;
int i;
+ int defaultdepth;
int depth_flags;
ClockRangePtr clockRanges;
char *s;
@@ -551,11 +552,23 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
depth_flags |= Support32bppFb |
SupportConvert32to24 |
PreferConvert32to24;
+
+ /* use 16bpp in virt and on XenSource */
+ #ifndef PCI_CHIP_QEMU
+ #define PCI_CHIP_QEMU 0x1af4
+ #endif
+ #define PCI_CHIP_XENSOURCE 0x5853
+ if (((pCir->PciInfo->subvendor_id & 0xffff) == PCI_CHIP_QEMU) ||
+ ((pCir->PciInfo->subvendor_id & 0xffff) == PCI_CHIP_XENSOURCE))
+ defaultdepth = 16;
+ else
+ defaultdepth = 24;
+
/*
* The first thing we should figure out is the depth, bpp, etc.
* We support both 24bpp and 32bpp layouts, so indicate that.
*/
- if (!xf86SetDepthBpp(pScrn, 0, 0, 24, depth_flags)) {
+ if (!xf86SetDepthBpp(pScrn, 0, 0, defaultdepth, depth_flags)) {
return FALSE;
} else {
/* Check that the returned depth is one we support */
--
cgit v0.10.2

87 changes: 87 additions & 0 deletions x11-drivers/xf86-video-cirrus/files/patch-git_03_adaf1fe
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
From adaf1fe744df8d37acdb8b157abc5034b8ea1073 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 13 Apr 2016 16:37:38 -0400
Subject: Remove (almost) no-op setup functions

These became practical no-ops when I removed reference to the loader
symbol lists. gcc will still emit code (and bss) for them though. No
functional change, just doing it to prove that nothing special happens
at submodule load.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>

diff --git a/src/alp_driver.c b/src/alp_driver.c
index 01e05dc..39802de 100644
--- src/alp_driver.c
+++ src/alp_driver.c
@@ -159,8 +159,6 @@ static int gd7556_MaxClocks[] = { 80100, 80100, 80100, 80100, 80100 };
#define ALP_MINOR_VERSION 0
#define ALP_PATCHLEVEL 0

-static MODULESETUPPROTO(alpSetup);
-
static XF86ModuleVersionInfo alpVersRec =
{
"cirrus_alpine",
@@ -181,20 +179,10 @@ static XF86ModuleVersionInfo alpVersRec =
*/
_X_EXPORT XF86ModuleData cirrus_alpineModuleData = {
&alpVersRec,
- alpSetup,
+ NULL,
NULL
};

-static pointer
-alpSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
- if (!setupDone) {
- setupDone = TRUE;
- }
- return (pointer)1;
-}
-
#endif /* XFree86LOADER */

_X_EXPORT const OptionInfoRec *
diff --git a/src/lg_driver.c b/src/lg_driver.c
index 589d14e..c3fe142 100644
--- src/lg_driver.c
+++ src/lg_driver.c
@@ -165,8 +165,6 @@ static int LgLinePitches[4][11] = {
#define LG_MINOR_VERSION 0
#define LG_PATCHLEVEL 0

-static MODULESETUPPROTO(lgSetup);
-
static XF86ModuleVersionInfo lgVersRec =
{
"cirrus_laguna",
@@ -187,21 +185,10 @@ static XF86ModuleVersionInfo lgVersRec =
*/
_X_EXPORT XF86ModuleData cirrus_lagunaModuleData = {
&lgVersRec,
- lgSetup,
+ NULL,
NULL
};

-static pointer
-lgSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
-
- if (!setupDone) {
- setupDone = TRUE;
- }
- return (pointer)1;
-}
-
#endif /* XFree86LOADER */

_X_EXPORT const OptionInfoRec *
--
cgit v0.10.2

Loading

0 comments on commit 230f4f8

Please sign in to comment.