Commit Graph

74 Commits

Author SHA1 Message Date
Eric Anholt
e2e50c5097 xserver: Unifdef HAVE_CONFIG_H
The X Server never generates a global config.h, and instead all these
paths are including dix-config.h or xorg-config.h.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2017-03-23 13:19:51 -04:00
Michel Dänzer
fdc79fe72b edid: Prune duplicates after adding modes from DDC
Multiple calls to xf86EdidMonitorSet (which can be triggered e.g. by
running xrandr) would potentially keep adding the same modes, causing
the Monitor->Modes list to keep growing larger and using up more memory.

Fix this by calling xf86PruneDuplicateModes after adding the modes
returned by xf86DDCGetModes. This makes sure there's only one instance
of each unique mode in the list.

v2:
* Replace semicolon with {} for empty for loop (Emil Velikov)
* Slightly tweak commit log to avoid minor inaccuracy about what
  xf86PruneDuplicateModes does

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99521
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-21 12:31:16 -04:00
Kai-Heng Feng
9874f73e88 edid: Add quirk for ADA 1024x600 7" display.
Detailed mode reports 108 mm x 68 mm which is for smaller display.
Maximum image size reports 15 cm x 10 cm which aligns with its physical
size, use this size instead.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-02 14:42:45 -05:00
Ville Syrjälä
98e170971c xfree86: Fix the 1792x1344-75 EST III mode
The correct refresh rate for this mode is 75, not 85.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-23 13:18:22 -04:00
Arun Raghavan
83e38eb73f edid: Add quirk for Sony Vaio Pro 13
The detailed timings are for a 15.6" display when max image size
correctly reports 13.3".

Signed-off-by: Arun Raghavan <arun@accosted.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-01-30 16:27:59 -08:00
Keith Packard
07b03e721e xfree86: Fix -Wshadow warnings
Just rename variables to eliminate -Wshadow warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:31 -08:00
Alan Coopersmith
9f7ef7f7f0 Fix up formatting of initializers for arrays of structs
The indenter seems to have gotten confused by initializing arrays of
structs with the struct defined inline - for predefined structs it did
a better job, so match that.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-08-06 15:22:53 -07:00
Torsten Kaiser
7c9d8cbd36 xfree86: EDID Est III parsing skips some modes
This loop needs to count from 7 to 0, not only from 7 to 1.
The current code always skips the modes {1152, 864, 75, 0}, {1280, 1024, 85, 0},
{1400, 1050, 75, 0}, {1600, 1200, 70, 0} and {1920, 1200, 60, 0}.

Signed-off-by: Torsten Kaiser <x11@ariolc.dyndns.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-06 12:11:48 -07:00
Torsten Kaiser
0b3abacb64 xfree86: EDID Est III parsing can walk off end of array
Using -O3 gcc notes that m could reach beyound the end of the EstIIIModes array,
if the last bits of the 11s byte where set.
Fix this, by extending the array to cover all possible bits from est.

https://bugs.freedesktop.org/show_bug.cgi?id=45623

Signed-off-by: Torsten Kaiser <x11@ariolc.dyndns.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-06 12:11:42 -07:00
Keith Packard
9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Alan Coopersmith
632d205b30 Fix gcc -Wwrite-strings warnings in xf86Modes code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Ross Burton
58864146fb edid: Add quirk for Acer Aspire One 110
At least one revision of the AAO reports a 190x110mm maximum size but a
451x113mm mode.

X.Org Bug 41141 <https://bugs.freedesktop.org/show_bug.cgi?id=41141>

Signed-off-by: Ross Burton <ross@linux.intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-18 11:26:03 -08:00
Zhao Yakui
86ca434a1a edid: Fix incorrect timings for VIC61
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2011-01-04 14:08:16 -05:00
Jörn Horstmann
4b88c7be8d Add EDID quirk for HP Compaq nc8430.
Like some other LPL panels, this one reports the vertical size in cm rather
than mm.
Patch taken from Launchpad bug #380009 <https://launchpad.net/bugs/380009>

X.Org Bug 28414 <https://bugs.freedesktop.org/show_bug.cgi?id=28414>

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-19 16:43:48 -08:00
Adam Jackson
b2f9ce201c edid: Fix the HDTV sync pulse adjustment
Simple typo, should have been adjusting the horizontal timings
consistently since we're not trying to mangle vertical at all.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Patrick E. Kane <pekane52@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-05 08:19:25 -07:00
Jamey Sharp
e4d4d6ddd5 Xserver need not be compatible with old versions of xserver.
Delete time-traveling multiple personality disorder from the server.

Gaetan notes:

    There were a couple of drivers containing an unknown version of the
    modes/parser code. This was done in server 1.2 time frame because it
    was released without mode code. It was barely or not maintained
    afterwards. There are currently no video drivers with a copy of the
    modes code.

Most of these ifdefs were introduced in commit
a8d760f567, where Aaron wrote,

    This change uses XORG_VERSION_CURRENT < 7.0 to mean "server newer
    than 1.2" since XORG_VERSION current went backwards at some point.

Alan explains that:

    In Xorg 1.3, when we first released an Xorg server release decoupled
    from the katamari release schedule.  (1.0 through 1.2 were released
    as part of X11R7.0 through 7.2, while 1.3 came out between X11R7.2 &
    7.3.)

Commit by Jamey Sharp and Josh Triplett.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-09-18 11:17:18 +02:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Zhao Yakui
19f7c15e20 xfree86: Edid quirk for Philips LCD LP154W01
v1->v2: Make one condition case for one quirk instead of merging them
together. This is based on the Keithp's suggestion.

Move the EDID quirk for Philips LCD LP154W01 as the panel reports the vertical
size in cm.

https://bugs.freedesktop.org/show_bug.cgi?id=24482

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-20 07:21:26 -08:00
Adam Jackson
ec98d7fc78 EDID: Extend the HDTV hack to handle "1368x769"
Hate televisions so much.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:06:00 -04:00
Adam Jackson
7c0803f555 modes: Fix duplicate detection, and do it more consistently
Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:06:00 -04:00
Adam Jackson
25236d19e6 EDID: Fix interlaced detailed timings to be frame size, not field size
Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:06:00 -04:00
Adam Jackson
fb86433d89 modes: Decorate interlaced mode names with a trailing 'i'
Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:06:00 -04:00
Ma Ling
fc2ec95664 EDID: CEA extension support
Reviewed-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:04:55 -04:00
Tormod Volden
757c11630d xfree86: Fix description of DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE
The message ending up in the log is misleading as to what the quirk
actually does: It ignores the sizes in the detailed timings and
replaces them with the display "Max Image Size".

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28 15:57:21 -07:00
Peter Hutterer
83023ffd09 xfree86: use the DDC size if either width or height of DisplaySize is bogus.
If either width or height of DisplaySize is invalid, assume that the
configuration is invalid and use the DDC-reported values instead.

See Comment 9, Bug 9758.
http://bugs.freedesktop.org/show_bug.cgi?id=9758#c9

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dave Airlie <airlied@redhat.com>
2009-09-28 14:51:39 +10:00
Adam Jackson
0bb9a7e165 displayid: Implement mode decoding. 2009-07-17 14:48:55 -04:00
Adam Jackson
2f1a9c5baa ddc: s/xf86DDCMonitorSet/xf86EdidMonitorSet/
Since we need a second path for DisplayID.
2009-07-17 13:42:57 -04:00
Ben Skeggs
048697ccfa quirk: use first detailed timing as preferred for PEA prod 9003 (rh#492359)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-23 15:55:25 +10:00
Adam Jackson
99e22b86c5 EDID: Add modes from Established Timings III descriptor to mode pool
EDID 1.4, section 3.10.3.9
2009-05-22 13:27:16 -04:00
Julien Cristau
2be5eecb4b xfree86: add edid quirk for Samsung Syncmaster 2333HD
It reports vertical size in cm in the detailed mode.
X.Org bug#21750 <http://bugs.freedesktop.org/show_bug.cgi?id=21750>

Reported-by: Peter Poklop <Peter.Poklop@gmx.at>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-05-15 17:35:30 +02:00
Julien Cristau
0dfb97f15f Bug#21324: Add quirk for Iiyama Vision Master 450
Reported-by: Jeremy Henty <onepoint@starurchin.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-04-22 20:02:38 +02:00
Tormod Volden
b1dab580bd xfree86: edid quirk for Philips LCD LP154W01-TLAJ
This panel reports its vertical size in cm.

X.Org bug#21000 <http://bugs.freedesktop.org/show_bug.cgi?id=21000>

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-04-01 20:05:23 +02:00
Chris Ball
45e14f5153 Build fix for xf86EdidModes.c
Commit 20ac314.. forgets to declare hsize/vsize/refresh.
2009-02-13 20:32:02 -05:00
Adam Jackson
20ac3140ce EDID: Hack for 1366x768 in standard timing descriptors
All you get for standard timing descriptors is horizontal size in
multiples of 8 pixels (which means you can't say 1366) and height in
terms of aspect ratio (which means you can't say 768).  You'd like to
just fuzzy-match this by walking the DMT list for sufficiently close
modes, but you can't because DMT is useless and only defines a 1360x768
mode, because it's _also_ specified in terms of character cells despite
providing pixel exact timings.  Neither can you use CVT or GTF to
generate the timings, because they _also_ believe that modes have to be
a multiple of 8 pixels.

You'd also hope you could find a timing definition for this in CEA, but
you can't because CEA only defines transmission formats that actually
exist.  So there's 480p, 720p, and 1080p, but no 768p.  And why would
there be, after all, the encoded signal is never 768p so obviously no
one would ever make a display in that format.

So instead, make a CVT mode since that's likely to be handled well by
just about everything, smash the horizontal active down by 2, and shift
the sync pulse by 1.  Underscanning the hard way.

Pass the suicide.
2009-02-13 15:12:06 -05:00
Paulo Cesar Pereira de Andrade
49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Paulo Cesar Pereira de Andrade
31285d063e Make visible symbols required by xorg modules.
This patch exports all symbols required by the compilable
(in a x86 linux computer) xorg/driver/* modules.
  Still missing symbols worth mentioning are:

sunleo
	miFindMaxBand no longer available

intel	(uxa/uxa-accel.c)
	fbShmPutImage no longer available (and should have been static)

mga
	MGAGetClientPointer (should come from matrox's libhal)

  This is not a definitive "visibility" patch, as all it does is to
export missing symbols, but the modules that current don't compile,
may require more symbols once fixed, and third party drivers should
also require more symbols exported.
  A "definitive" patch should export symbols defined in the sdk.
2008-11-28 01:55:11 -02:00
Alan Coopersmith
d5f9a131a2 Fix const-mismatch warnings for DisplayModePtr's
Includes fixes for:
"xf86Config.c", line 2434: warning: argument #1 is incompatible with prototype:
	prototype: pointer to struct _DisplayModeRec: "xf86.h", line 351
	argument : pointer to const struct _DisplayModeRec

"xf86EdidModes.c", line 312: warning: argument #1 is incompatible with prototype:
	prototype: pointer to struct _DisplayModeRec: "../../../hw/xfree86/common/xf86.h", line 351
	argument : pointer to const struct _DisplayModeRec

"xf86EdidModes.c", line 438: warning: assignment type mismatch:
	pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec

"xf86Modes.c", line 701: warning: assignment type mismatch:
	pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec
2008-11-25 15:51:17 -08:00
Adam Jackson
d692e1a63e Build fix. 2008-07-22 10:21:22 -04:00
Adam Jackson
8c8c4fdf34 EDID: Various reduced blanking fixes.
- Use a single common function to compute reducedness.
- Call it from both the old-school and new-school mode validation paths.
- Define monitor reduced-blanking support in accord with EDID 1.4.
- Attempt to filter RB DMT modes away from the "standard" EDID pool if
  the monitor doesn't claim RB support.
2008-07-21 16:49:17 -04:00
Adam Jackson
e8cd77e14d EDID: For standard timing blocks, prefer DMT timings if they exist. 2008-07-21 16:49:17 -04:00
Adam Jackson
6ba70091e2 EDID: Correct DDCEstablishedModes to conform to DMT. 2008-07-21 16:49:17 -04:00
Adam Jackson
c74ddc87c9 EDID: Add quirk to clamp max pixel clock to single DVI link speed.
On some panels you end up with all of:
- No range descriptor
- No description of physical connectivity
- Native panel size mode in standard timings list

In principle you're supposed to use the timings for that mode from the DMT
spec, but in practice the DMT spec has timings for both 1920x1200 normal
and 1920x1200RB, and the standard timing field gives you no way to
distinguish.  And, of course, the non-RB timings don't fit in a single
DVI link.
2008-07-21 15:10:20 -04:00
Dave Airlie
e4ebfed178 xf86edid: fix typo in debug output 2008-05-06 16:47:18 +10:00
Dave Airlie
b19027fbae quirk: add quirk for ACR 640x350 default mode is wrong
RH #440186
2008-04-09 14:34:11 +10:00
Dave Airlie
f0915fb3c4 quirk: add quirk for ACER EDID 2008-04-04 09:59:40 +10:00
Hong Liu
ebc56aca8b Bug #15160: quirk Proview AY765C
prefer first detailed timing
2008-04-02 10:46:03 +08:00
Dave Airlie
c747030a49 quirk: fix LPL monitors properly.
no point having a h cm fix when we really want to copy the sizes from the
other place.

RH BZ 435216
2008-03-27 15:19:52 +10:00
Aaron Plattner
a8d760f567 Get modes code building with old X servers again.
This change uses XORG_VERSION_CURRENT < 7.0 to mean "server newer than 1.2"
since XORG_VERSION current went backwards at some point.
2008-03-06 14:42:00 -08:00
Adam Jackson
3b73d62791 xf86DDCMonitorSet: Honor the DisplaySize from the config file.
We honor sync ranges and pixel clock settings from the config here, no
reason to ignore DisplaySize.
2008-03-03 15:43:22 -05:00
Adam Jackson
d1c48955f8 Fix CVT abuse in DDCModesFromStandardTiming.
CVT is enough different from GTF that it should not be used on monitors
that aren't expecting it.  This brings us closer to what the spec says
the correct behaviour is.
2008-02-29 16:01:15 -05:00