linux/drivers/gpu/drm
Mark Kettenis cef1d00cd5 drm/radeon: fix combios tables on older cards
Noticed that my old Radeon 7500 hung after printing

   drm: GPU not posted. posting now...

when it wasn't selected as the primary card the BIOS.  Some digging
revealed that it was hanging in combios_parse_mmio_table() while
parsing the ASIC INIT 3 table.  Looking at the BIOS ROM for the card,
it becomes obvious that there is no ASIC INIT 3 table in the BIOS.
The code is just processing random garbage.  No surprise it hangs!

Why do I say that there is no ASIC INIT 3 table is the BIOS?  This
table is found through the MISC INFO table.  The MISC INFO table can
be found at offset 0x5e in the COMBIOS header.  But the header is
smaller than that.  The COMBIOS header starts at offset 0x126.  The
standard PCI Data Structure (the bit that starts with 'PCIR') lives at
offset 0x180.  That means that the COMBIOS header can not be larger
than 0x5a bytes and therefore cannot contain a MISC INFO table.

I looked at a dozen or so BIOS images, some my own, some downloaded from:

    <http://www.techpowerup.com/vgabios/index.php?manufacturer=ATI&page=1>

It is fairly obvious that the size of the COMBIOS header can be found
at offset 0x6 of the header.  Not sure if it is a 16-bit number or
just an 8-bit number, but that doesn't really matter since the tables
seems to be always smaller than 256 bytes.

So I think combios_get_table_offset() should check if the requested
table is present.  This can be done by checking the offset against the
size of the header.  See the diff below.  The diff is against the WIP
OpenBSD codebase that roughly corresponds to Linux 3.8.13 at this
point.  But I don't think this bit of the code changed much since
then.

For what it is worth:

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2013-07-22 15:57:14 -04:00
..
ast drm/ast: inline reservations 2013-06-28 12:04:04 +10:00
cirrus drm/cirrus: inline reservations 2013-06-28 12:04:05 +10:00
exynos drm/exynos: remove duplicated error routine and unnecessary assign 2013-07-04 15:55:37 +09:00
gma500 Merge branch 'gma500-fixes' of git://github.com/patjak/drm-gma500 into drm-fixes 2013-06-11 08:16:10 +10:00
i2c
i810 i810: VM_IO is set by io_remap_pfn_range() 2013-06-29 12:46:40 +04:00
i915 Merge tag 'drm-intel-fixes-2013-07-22' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes 2013-07-22 16:14:26 +10:00
mga
mgag200 drm/mgag200: inline reservations 2013-06-28 12:04:06 +10:00
nouveau drm/nouveau: do not allow negative sizes for now 2013-07-10 10:48:07 +10:00
omapdrm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-07-09 16:04:31 -07:00
qxl Linux 3.10 2013-07-18 12:03:29 +02:00
r128
radeon drm/radeon: fix combios tables on older cards 2013-07-22 15:57:14 -04:00
rcar-du drm/rcar-du: Use the GEM PRIME helpers 2013-07-17 15:44:01 +02:00
savage drm (ast, cirrus, mgag200, nouveau, savage, vmwgfx): Remove drm_mtrr_{add, del} 2013-05-31 13:02:54 +10:00
shmobile drm/shmobile: Use the GEM PRIME helpers 2013-07-17 15:43:55 +02:00
sis
tdfx
tilcdc drm/tilcdc: Clear bits of register we're going to set. 2013-06-28 09:13:00 +10:00
ttm drm: make drm_mm_init() return void 2013-07-02 13:34:41 +10:00
udl drm: Drop all the stub gamma_get, gamma_set, load_lut functions from drivers 2013-06-17 19:42:47 +10:00
via
vmwgfx drm/vmwgfx: get rid of ttm_bo_is_reserved usage 2013-06-28 12:04:14 +10:00
ati_pcigart.c
drm_agpsupport.c
drm_auth.c
drm_buffer.c
drm_bufs.c drm: Don't leak phys_wc "handles" to userspace 2013-05-31 13:37:39 +10:00
drm_cache.c lib/scatterlist: sg_page_iter: support sg lists w/o backing pages 2013-03-27 17:13:44 +01:00
drm_context.c
drm_crtc.c drm: add hotspot support for cursors. 2013-06-28 09:13:39 +10:00
drm_crtc_helper.c drm/crtc-helper: explicit DPMS on after modeset 2013-07-22 09:55:17 +10:00
drm_debugfs.c
drm_dma.c
drm_dp_helper.c
drm_drv.c drm: add hotspot support for cursors. 2013-06-28 09:13:39 +10:00
drm_edid.c drm: add assertion for checking null edid to drm_edid_block_valid 2013-07-04 10:52:50 +10:00
drm_edid_load.c drm: avoid warning in drm_load_edid_firmware() 2013-07-10 14:21:46 -07:00
drm_encoder_slave.c drm: refactor call to request_module 2013-05-10 14:46:03 +10:00
drm_fb_cma_helper.c treewide: Fix typo in printk 2013-05-28 12:02:13 +02:00
drm_fb_helper.c drm/fb-helper: Make load_lut and gamma_set/gamma_get hooks optional 2013-06-17 19:42:47 +10:00
drm_fops.c drm: fix error routines in drm_open_helper 2013-07-04 10:53:37 +10:00
drm_gem.c drm: make drm_mm_init() return void 2013-07-02 13:34:41 +10:00
drm_gem_cma_helper.c drm/cma: remove GEM CMA specific dma_buf functionality 2013-07-05 15:44:54 +10:00
drm_global.c
drm_hashtab.c
drm_info.c
drm_ioc32.c
drm_ioctl.c drm: Don't leak phys_wc "handles" to userspace 2013-05-31 13:37:39 +10:00
drm_irq.c drm: fix a use-after-free when GPU acceleration disabled 2013-06-03 19:12:04 +10:00
drm_lock.c
drm_memory.c
drm_mm.c drm/mm: WARN for unclean mm takedown 2013-07-04 10:01:12 +10:00
drm_modes.c drm: Sort connector modes based on vrefresh 2013-06-11 08:35:51 +10:00
drm_pci.c drm, agpgart: Use pgprot_writecombine for AGP maps and make the MTRR optional 2013-05-31 13:37:31 +10:00
drm_platform.c
drm_prime.c drm: add mmap function to prime helpers 2013-07-05 15:44:44 +10:00
drm_proc.c drm: proc: Use remove_proc_subtree() 2013-05-01 17:29:44 -04:00
drm_rect.c drm: Add drm_rect_debug_print() 2013-04-30 22:20:00 +02:00
drm_scatter.c
drm_stub.c drm: drm_stub: Fixing return value if driver master_set call failed 2013-06-27 21:03:16 +10:00
drm_sysfs.c drm: Convert drm class driver from legacy pm ops to dev_pm_ops 2013-07-04 10:50:26 +10:00
drm_trace.h drm: fix print format of sequence in trace point 2013-07-04 10:55:27 +10:00
drm_trace_points.c
drm_usb.c
drm_vm.c drm: io_remap_pfn_range() sets VM_IO... 2013-06-29 12:46:39 +04:00
Kconfig drm/nouveau: always select ACPI_VIDEO if ACPI is enabled. 2013-06-28 11:56:22 +10:00
Makefile drm: Renesas R-Car Display Unit DRM driver 2013-06-27 10:08:04 +10:00
README.drm

************************************************************
* For the very latest on DRI development, please see:      *
*     http://dri.freedesktop.org/                          *
************************************************************

The Direct Rendering Manager (drm) is a device-independent kernel-level
device driver that provides support for the XFree86 Direct Rendering
Infrastructure (DRI).

The DRM supports the Direct Rendering Infrastructure (DRI) in four major
ways:

    1. The DRM provides synchronized access to the graphics hardware via
       the use of an optimized two-tiered lock.

    2. The DRM enforces the DRI security policy for access to the graphics
       hardware by only allowing authenticated X11 clients access to
       restricted regions of memory.

    3. The DRM provides a generic DMA engine, complete with multiple
       queues and the ability to detect the need for an OpenGL context
       switch.

    4. The DRM is extensible via the use of small device-specific modules
       that rely extensively on the API exported by the DRM module.


Documentation on the DRI is available from:
    http://dri.freedesktop.org/wiki/Documentation
    http://sourceforge.net/project/showfiles.php?group_id=387
    http://dri.sourceforge.net/doc/

For specific information about kernel-level support, see:

    The Direct Rendering Manager, Kernel Support for the Direct Rendering
    Infrastructure
    http://dri.sourceforge.net/doc/drm_low_level.html

    Hardware Locking for the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/hardware_locking_low_level.html

    A Security Analysis of the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/security_low_level.html