summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_edid.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/edid: Fix CVT width/height decodeAdam Jackson2010-01-071-5/+5
| | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/edid: Skip empty CVT codepointsAdam Jackson2010-01-071-0/+4
| | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: silencing a false positive warning.Marin Mitov2009-12-231-1/+1
| | | | | | | | warning: 'width' may be used uninitialized in this function drivers/gpu/drm/drm_edid.c Signed-off-by: Marin Mitov <mitov@issp.bas.bg> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge branch 'drm-core-next' into drm-linusDave Airlie2009-12-081-124/+204
|\ | | | | | | | | | | | | | | Bring all core drm changes into 2.6.32 tree and resolve the conflict that occurs. Conflicts: drivers/gpu/drm/drm_fb_helper.c
| * drm/edid: Decode 3-byte CVT codes from EDID 1.4Adam Jackson2009-12-041-0/+48
| | | | | | | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Add DMT modes to the pool if the monitor is GTF-capableAdam Jackson2009-12-041-4/+65
| | | | | | | | | | | | | | See also: http://bugzilla.redhat.com/539785 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Unify detailed block parsing between base and extension blocksAdam Jackson2009-12-041-102/+61
| | | | | | | | | | | | | | | | Also fix an embarassing bug in standard timing subblock parsing that would result in an infinite loop. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Fix up partially corrupted headersAdam Jackson2009-11-241-6/+16
| | | | | | | | | | | | | | | | | | We'll still fail the block if it fails the EDID checksum though. See also: http://bugzilla.redhat.com/534120 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Retry EDID fetch up to four timesAdam Jackson2009-11-241-14/+14
| | | | | | | | | | | | | | | | | | | | | | This matches the X server's retry logic. Note that we'll only retry if we get a DDC response but fail validation; legitimately disconnected outputs will bomb out early. See also: http://bugzilla.redhat.com/532957 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/modes: Limit fallback modes to 60HzAdam Jackson2009-11-241-0/+2
| | | | | | | | | | | | | | See also: http://bugzilla.redhat.com/514600 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm: work around EDIDs with bad htotal/vtotal valuesJesse Barnes2009-11-241-0/+6
|/ | | | | | | | | | | We did this on the userspace side, but we need a similar fix for the kernel. Fixes LP #460664. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Add the basic check for the detailed timing in EDIDZhao Yakui2009-10-281-0/+15
| | | | | | | | | | | | | Sometimes we will get the incorrect display modeline when parsing the detailed timing in EDID. For example: >hsync/vsync width is zero >sync is beyond the blank. So add the basic check for the detailed timing in EDID to avoid the incorrect display modeline. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: start adding command line interface using fb.Dave Airlie2009-09-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | [note this requires an fb patch posted to linux-fbdev-devel already] This uses the normal video= command line option to control the kms output setup at boot time. It is used to override the autodetection done by kms. video= normally takes a framebuffer as the first parameter, in kms it will take a connector name, DVI-I-1, or LVDS-1 etc. If no output connector is specified the mode string will apply to all connectors. The mode specification used will match down the probed modes, and if no mode is found it will add a CVT mode that matches. video=1024x768 - all connectors match a 1024x768 mode or add a CVT on video=VGA-1:1024x768, VGA-1 connector gets mode only. The same strings as used in current fb modedb.c are used, except I've added three more letters, e, D, d, e = enable, D = enable Digital, d = disable, which allow a connector to be forced into a certain state. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/edid: Fix standard timing parse for EDID <= 1.2Adam Jackson2009-09-241-5/+12
| | | | | | | Aspect ratio code of 0 means 1:1 before EDID 1.3. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/edid: Detailed standard timing blocks have six timings, not five.Adam Jackson2009-09-241-2/+1
| | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/edid: Ignore bad standard timings.Adam Jackson2009-09-241-0/+16
| | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/edid: const cleanupAdam Jackson2009-09-241-1/+3
| | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: shut the EDID warnings up.Adam Jackson2009-09-081-3/+0
| | | | | | | | These really aren't all that useful. taken from Fedora kernel. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: add a function that can add the mode for the output device without EDIDZhao Yakui2009-09-071-0/+46
| | | | | | | | | | Add a function that can be used to add the default mode for the output device without EDID. It will add the default mode that meets with the requirements of given hdisplay/vdisplay limit. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: try to find the std mode in DMT tableZhao Yakui2009-09-071-7/+33
| | | | | | | | | | | | | | | | When we need to add the standard timing mode, we will firstly check whether it can be found in DMT table by comparing the hdisplay/vdisplay/vfresh_rate. If it can't be found, then we will use the cvt/gtf to add the required mode. If it can be found, it will be returned. At the same time the function of drm_mode_vrefresh is also fixed. It will return the result of actual refresh_rate plus 0.5. For example: When the calculated value is 84.9, then the fresh_rate is 85. When the calculated value is 70.02, then the fresh_rate is 70. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: Add the default mode tableZhao Yakui2009-09-071-0/+237
| | | | | | | | | | | | | | | | | | | | When we add a standard timing mode in UMS, we will first check whether it can be found in default mode table. If it can't be found, then we will use cvt/gtf to add the standard timing mode. Add the default mode table so that we can check whether the given mode can be found in the default mode table as what we have done in UMS mode. If the status of one output device is connected but there is no EDID, it will have no correct mode. In such case we can add some default modes for it. Of course we only add the modes in the default modes list that visible part is not greater than 1024x768. The default mode is autogenerated from the DMT spec. And it is copied from xserver/hw/xfree86/modes/xf86EdidModes.c. But the mode with reduced blank feature is removed. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: Parse the detailed time info in CEA-EDIDZhao Yakui2009-08-311-1/+119
| | | | | | | | | | | | | Sometimes we can obtain the EDID with multiple blocks from the display device. For example: HDMI monitor. When the CEA-EDID block is detected, we should also parse the detailed timing info from it. Otherwise we will lose some modes for the display device. The first step is check whether the CEA EDID block is found. If it exists, it will skip the CEA-data block and parse the detailed timing info. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge Linus master to drm-nextDave Airlie2009-08-201-39/+35
|\ | | | | | | | | | | | | | | | | | | | | linux-next conflict reported needed resolution. Conflicts: drivers/gpu/drm/drm_crtc.c drivers/gpu/drm/drm_edid.c drivers/gpu/drm/i915/intel_sdvo.c drivers/gpu/drm/radeon/radeon_ttm.c drivers/gpu/drm/ttm/ttm_bo.c
| * drm/edid: fixup detailed timings like the X server.Dave Airlie2009-08-151-38/+34
| | | | | | | | | | | | | | this syncs the versioning check with the code the X server uses. Reported-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/mode: get the modeline for standard timing in EDID by using CVT/GTFZhao Yakui2009-07-151-12/+58
|/ | | | | | | | | | | | | | | | | | | | Create the standard timing modeline by using CVT/GFT algorithm while interpreting the EDID. In course of interpreting the EDID, the timing level will be obtained, which is used to determine whether the CVT/GTF algorithm is selected to generate the modeline for the given hdisplay/vdisplay/vrefresh_rate. In the UMS mode firstly it will check whether it can be found in the DMT table. If it can be found, then the modeline is returned. Then the timing_level is used to choose CVT/GTF. As there is no DMT table, no modeline is returned when timing level is DMT. For the other two timing levels, the CVT/GTF will be called to generate the required standard timing modeline. [airlied: fixed up conflicts since EDID rework] Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: Fix shifts which were miscalculated when converting from bitfields.Michel Dänzer2009-06-241-6/+6
| | | | | | | | | | | | Looks like I managed to mess up most shifts when converting from bitfields. :( The patch below works on my Thinkpad T500 (as well as on my PowerBook, where the previous change worked as well, maybe out of luck...). I'd appreciate more testing and eyes looking over it though. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Tested-by: Michael Pyne <mpyne@kde.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: EDID endianness fixes.Michel Dänzer2009-06-191-48/+52
| | | | | | Mostly replacing bitfields with explicit masks and shifts. Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge branch 'drm-linus' of ↵Linus Torvalds2009-06-121-73/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 * 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (50 commits) drm: include kernel list header file in hashtab header drm: Export hash table functionality. drm: Split out the mm declarations in a separate header. Add atomic operations. drm/radeon: add support for RV790. drm/radeon: add rv740 drm support. drm_calloc_large: check right size, check integer overflow, use GFP_ZERO drm: Eliminate magic I2C frobbing when reading EDID drm/i915: duplicate desired mode for use by fbcon. drm/via: vfree() no need checking before calling it drm: Replace DRM_DEBUG with DRM_DEBUG_DRIVER in i915 driver drm: Replace DRM_DEBUG with DRM_DEBUG_MODE in drm_mode drm/i915: Replace DRM_DEBUG with DRM_DEBUG_KMS in intel_sdvo drm/i915: replace DRM_DEBUG with DRM_DEBUG_KMS in intel_lvds drm: add separate drm debugging levels radeon: remove _DRM_DRIVER from the preadded sarea map drm: don't associate _DRM_DRIVER maps with a master drm: simplify kcalloc() call to kzalloc(). intelfb: fix spelling of "CLOCK" drm: fix LOCK_TEST_WITH_RETURN macro drm/i915: Hook connector to encoder during load detection (fixes tv/vga detect) ...
| * drm: Eliminate magic I2C frobbing when reading EDIDKeith Packard2009-06-121-73/+1
| | | | | | | | | | | | | | | | | | | | This code depends on the underlying I2C adapter using the bit-banging algo, which may not be the case. If specific encoders require this mechanism, they should build a custom I2C algo that implements this workaround, rather than having it in the general path. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm: ignore EDID with really tiny modes.Adam Jackson2009-06-041-0/+5
|/ | | | | | | | Some EDIDs lie and report tiny modes that aren't possible. Ignore these modes. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: fix EDID backward compat checkJesse Barnes2009-04-031-4/+2
| | | | | | | | | EDIDs should be backward compatible, so don't bail if we see a version of 3 (which is out there now) and print a message if we see something newer, but allow it to be parsed. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: fix typo in edid vendor parsing.Dave Airlie2009-04-031-1/+1
| | | | | | | | | | | | Should be, edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@'; Since vendor ID has only two bytes only, I am somewhat surprised why gcc doesn't complain this. Reported-by: Guo, Chaohong <chaohong.guo@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: detect hdmi monitor by hdmi identifier (v3)Ma Ling2009-03-291-0/+62
| | | | | | | | Sometime we need to communicate with HDMI monitor by sending audio or video info frame, so we have to know monitor type. However if user utilize HDMI-DVI adapter to connect DVI monitor, hardware detection will incorrectly show the monitor is HDMI. HDMI spec tell us that any device containing IEEE registration Identifier will be treated as HDMI device. The patch intends to detect HDMI monitor by this rule. Signed-off-by: Ma Ling <ling.ma@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: read EDID extensions from monitorMa Ling2009-03-291-28/+93
| | | | | | | | | | | | | Usually drm read basic EDID, that is enough for us, but since igital display were introduced i.e. HDMI monitor, sometime we need to interact with monitor by EDID extension information, EDID extensions include audio/video data block, speaker allocation and vendor specific data blocks. This patch intends to read EDID extensions from digital monitor for users. Signed-off-by: Ma Ling <ling.ma@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: edid revision 0 is validKyle McMartin2009-02-251-1/+1
| | | | | | | | | | | | | | | | | edid->revision == 0 should be valid (at least, so the error message indicates. :) and wikipedia seems to indicate that EDID 1.0 existed. We can dump the entire check, since edid->revision is a u8, so it can't ever be less than 0. Marko reports in RH bz#476735 that his monitor claims to be EDID 1.0, and therefore hits the check and is stuck at 800x600 because of it. Reported-by: Marko Ristola <marko.ristola@kolumbus.fi> Signed-off-by: Kyle McMartin <kyle@redhat.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: Fix shifts of EDID vsync offset/width fields.Linus Torvalds2009-02-251-2/+2
| | | | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: don't whine about not reading EDID dataJesse Barnes2009-01-221-1/+1
| | | | | | | | Make this message a little quieter, since it's common and not necessarily indicative of a problem. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: fix useless gcc unused variable warningDave Airlie2008-12-291-1/+1
| | | | | | | the calling function doesn't call this function unless one of the two states that sets the value is true. Signed-off-by: Dave Airlie <airlied@redhat.com>
* DRM: add mode setting supportDave Airlie2008-12-291-0/+732
Add mode setting support to the DRM layer. This is a fairly big chunk of work that allows DRM drivers to provide full output control and configuration capabilities to userspace. It was motivated by several factors: - the fb layer's APIs aren't suited for anything but simple configurations - coordination between the fb layer, DRM layer, and various userspace drivers is poor to non-existent (radeonfb excepted) - user level mode setting drivers makes displaying panic & oops messages more difficult - suspend/resume of graphics state is possible in many more configurations with kernel level support This commit just adds the core DRM part of the mode setting APIs. Driver specific commits using these new structure and APIs will follow. Co-authors: Jesse Barnes <jbarnes@virtuousgeek.org>, Jakob Bornecrantz <jakob@tungstengraphics.com> Contributors: Alan Hourihane <alanh@tungstengraphics.com>, Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenPOWER on IntegriCloud