Alex Deucher [Thu, 15 Oct 2009 20:16:35 +0000 (16:16 -0400)]
drm/radeon/kms: fix connector edid handling
Based partly on a patch from
Christian Koenig <deathsimple@vodafone.de>
- fix several memory leaks in radeon_connector->edid handling
- store edid in radeon_connector->edid in detect() or get_modes()
- switch hdmi detect code to use radeon_connector->edid
- add support for oem boards multiple connectors that share
a ddc line.
- short circuit lvds_detect() if have a stored edid
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 15 Oct 2009 05:33:35 +0000 (01:33 -0400)]
drm/radeon/kms: fix internal tmds setup on legacy display engine
- crtc 0 routing was wrong
- need to clear various timing bits in FP_GEN_CNTL
- need to set FP_H/V2_SYNC_STRT_WID regs for crtc 1
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Wed, 14 Oct 2009 06:00:42 +0000 (02:00 -0400)]
drm/radeon/kms: move active_device setup into encoder fixup()
radeon_encoder->active_device defines the active routing
between the encoder and connector. The encoder fixup and
dpms functions need to know the active_device to function
properly. Setting active_device in the prepare hook was
too late in some cases.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Mon, 12 Oct 2009 15:25:05 +0000 (11:25 -0400)]
drm/radeon/kms: properly handle mode id with native mode changes
drm modes are objects with indentifiers. Make sure to preserve
the mode id when copying mode params.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 12 Oct 2009 04:21:19 +0000 (14:21 +1000)]
drm/radeon/kms: fix use of index before proper initialisation.
With the adjust table introduction, we need to fill out index
before getting the table version.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 12 Oct 2009 03:54:10 +0000 (13:54 +1000)]
drm/radeon: Revert "drm/r600: avoid assigning vb twice in blit code"
This reverts commit
49c458e544ae14514209ed80ea6829ca1b18ddf0. It
seems to have some side effects in the non-kms cases.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 9 Oct 2009 22:41:19 +0000 (18:41 -0400)]
drm/radeon/kms: also check for edid in lvds detect
In case the system has bad native mode info but
valid edid.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 9 Oct 2009 19:14:30 +0000 (15:14 -0400)]
drm/radeon/kms: use drm_mode directly for panel modes
This reduces the number of mode format conversions needed
and makes native panel mode support cleaner.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 8 Oct 2009 19:09:31 +0000 (15:09 -0400)]
drm/radeon/kms/atom: rework crtc modeset
- clean up tv timing handling
- unify SetCRTC_Timing and SetCRTC_UsingDTDTiming
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 8 Oct 2009 17:36:21 +0000 (13:36 -0400)]
drm/radeon/kms/atom: add support for AdjustDisplayPll
DCE3+ has an AdjustDisplayPll that will adjust the pixel
clock accordingly based on the encoder/transmitter to
handle special hw requirements.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 8 Oct 2009 17:08:29 +0000 (13:08 -0400)]
drm/radeon/kms/atom: reorder crtc dpms
Based on recommendation from bios docs.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 8 Oct 2009 17:02:19 +0000 (13:02 -0400)]
drm/radeon/kms: make sure LVDS panel is valid in detect()
If the panel data is bogus this can lead to problems
later when the hardware trys to set the mode. If the
data is invalid, report LVDS as disconnected.
Should fix fdo bug 24247.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Michel Dänzer [Thu, 8 Oct 2009 08:44:10 +0000 (10:44 +0200)]
drm/radeon/kms: Fix apparent typo in legacy CRTC memory bandwidth calculation.
While investigating the cause of CRTC FIFO underruns, I noticed that when
converting the memory bandwidth calculation from the userspace X driver code,
an instance of '8.0' was apparently accidentally converted to '80'.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Michel Dänzer [Thu, 8 Oct 2009 08:44:09 +0000 (10:44 +0200)]
drm/radeon/kms: Update memory bandwidth requirements in mode_set_base hook.
The hook may change the number of bytes per pixel being scanned out, which
affects the CRTC memory bandwidth requirements. E.g. booting in 8bpp and then
running X in 32bpp would result in the bandwidth requirements being
underestimated for the latter and consequently in CRTC FIFO underruns causing
visible artifacts with 3D intensive workloads.
ATOM changes only compile-tested.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 12 Oct 2009 03:32:38 +0000 (13:32 +1000)]
drm/radeon/kms: don't refuse LUT because no framebuffer.
The fb binding might be happening in a subsequent crtc setup call.
gets rid of some lut issues.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Thu, 8 Oct 2009 01:32:49 +0000 (11:32 +1000)]
drm/radeon/kms: fix vline register for second head.
Both r100/r600 had this wrong, use the macro to extract the register
to relocate.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Robert Noland [Mon, 5 Oct 2009 15:56:44 +0000 (11:56 -0400)]
drm/r600: avoid assigning vb twice in blit code
There is no need to assign vb before you know that space is available.
[agd5f: adapted for kernel tree.]
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 7 Oct 2009 23:28:19 +0000 (09:28 +1000)]
drm/radeon: use list_for_each_entry instead of list_for_each
This is just a cleanup of the list macro usage.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Tue, 6 Oct 2009 17:04:30 +0000 (19:04 +0200)]
drm/radeon/kms: Fix AGP support for R600/RV770 family (v2)
For AGP to work unmapped access must cover VRAM & AGP as
AGP is treated like VRAM by the GPU (ie physical address).
This patch properly setup the virtual memory system aperture
to cover AGP if AGP is enabled. It seems that there is memory
corruption after resume when using AGP (RV770 seems unaffected
thought). Version 2 just fix merge issue with updated AGP
fallback patch.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Tue, 6 Oct 2009 17:04:29 +0000 (19:04 +0200)]
drm/radeon/kms: Fallback to non AGP when acceleration fails to initialize (v2)
When GPU acceleration is not working with AGP try to fallback to non
AGP GART (either PCI or PCIE GART). This should make KMS failure on
AGP less painfull. We still need to find out what is wrong when AGP
fails but at least user have a lot of more chances to get a working
configuration with acceleration. This patch also cleanup R600/RV770
fallback path so they use same code as others asics. Version 2
factorize agp disabling logic to avoid code duplication and bugs.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Wed, 7 Oct 2009 09:08:22 +0000 (11:08 +0200)]
drm/radeon/kms: Fix RS600/RV515/R520/RS690 IRQ
Bad generated header file leaded to use wrong register
to check IRQ status and acknowledge them. Fix the header
and use proper registers.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Roel Kluin [Tue, 6 Oct 2009 19:48:40 +0000 (21:48 +0200)]
drm/radeon: Fix setting of bits
Duplicate bits set
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 29 Sep 2009 03:56:38 +0000 (13:56 +1000)]
drm/ttm: fix refcounting in ttm global code.
the global refcount wasn't being increased after the first reference.
this caused an oops on unload on a multi-gpu card.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 6 Oct 2009 03:54:01 +0000 (13:54 +1000)]
drm/fb: add more correct 8/16/24/32 bpp fb support.
The previous patches had some unwanted side effects, I've fixed
the lack of 32bpp working, and fixed up 16bpp so it should also work.
this also adds the interface to allow the driver to set a preferred
console depth so for example low memory rn50 can set it to 8bpp.
It also catches 24bpp on cards that can't do it and forces 32bpp.
Tested on r100/r600/i945.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sun, 4 Oct 2009 23:58:02 +0000 (09:58 +1000)]
drm/fb: add setcmap and fix 8-bit support.
This adds support for the setcmap api and fixes the 8bpp
support at least on radeon hardware. It adds a new load_lut
hook which can be called once the color map is setup.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Thu, 1 Oct 2009 23:19:09 +0000 (09:19 +1000)]
drm/radeon/kms: respect single crtc cards, only create one crtc. (v2)
Also add single crtc for RN50 chips.
changes in v2:
fix vblank init to respect single crtc flag
fix r100 mode bandwidth to respect single crtc flag
Signed-off-by: Dave Airlie <airlied@redhat.com>
Zhao Yakui [Wed, 30 Sep 2009 07:21:43 +0000 (15:21 +0800)]
drm: Delete the DRM_DEBUG_KMS in drm_mode_cursor_ioctl
We can get the corresponding info by adding the boot option of "drm.debug=
0x07". But On some boxes it will print the following message many times in
course of moving mouse. In such case the useful DRM debug info will be flushed.
>[drm:drm_mode_cursor_ioctl],
Avoid using the DRM_DEBUG_KMS in drm_mode_cursor_ioctl.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 2 Oct 2009 21:36:41 +0000 (17:36 -0400)]
drm/radeon/kms: add support for "Surround View"
"Surround View" is an option in the system bios that
enables the AMD IGP chip in conjunction with a
discrete AMD card. However, since the IGP vbios is
part of the system bios it is not accessible via the
rom bar or the legacy vga location. When "Surround View"
is enabled in the system bios, the system bios puts a
copy of the IGP vbios image at the start of vram.
This patch adds support for reading the vbios image out
of vram on IGP cards.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Wed, 30 Sep 2009 20:18:43 +0000 (22:18 +0200)]
drm/radeon/kms: Fix irq handling on AVIVO hw
Avivo hw have vblank interrupt in different place, fixes
irq handling (especialy irq disabling while suspending or
shuting down the module).
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Thu, 1 Oct 2009 16:02:15 +0000 (18:02 +0200)]
drm/radeon/kms: R600/RV770 remove dead code and print message for wrong BIOS
R600 & RV770 family are all using atombios so remove dead code and
print an error message if we fail to find a valid atombios.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Thu, 1 Oct 2009 16:02:14 +0000 (18:02 +0200)]
drm/radeon/kms: Fix R600/RV770 disable acceleration path
When acceleration doesn't work we should free associated memory
and stop GPU block responsible for hardware acceleration so we
don't waste resource or let think one component of the driver that
a GPU feature is working/running while it doesn't actualy work.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Thu, 1 Oct 2009 16:02:13 +0000 (18:02 +0200)]
drm/radeon/kms: Fix R600/RV770 startup path & reset
We were calling reset unconditionaly in the startup path
this is bad we need to call GPU reset for a good reason
as after reset the GPU is in unknown states. To avoid any
more bad things to happen we now also unconditionaly
reinitialize the GPU after reset. This patch fix few issues
reported by different people regarding KMS & R6XX/RV7XX hw.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Thu, 1 Oct 2009 16:02:12 +0000 (18:02 +0200)]
drm/radeon/kms: Fix R600 write back buffer
This split write back buffer handling into 3 functions,
wb_fini for cleanup, wb_enable/wb_disable for enabling/disabling
write back used for suspend/resume. This should fix
potential issue of letting the write back active before
suspending. We need to allocate memory in wb_enable because
we can only allocate once GART is running.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Thu, 1 Oct 2009 16:02:11 +0000 (18:02 +0200)]
drm/radeon/kms: Remove old init path as no hw use it anymore
This remove old init path and allow code cleanup, now all hw
use the new init path, see top of radeon.h for description of
this.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Wed, 30 Sep 2009 20:09:06 +0000 (22:09 +0200)]
drm/radeon/kms: Convert RS600 to new init path
New init path allow to simply asic initialization and make easier
to trace what happen on each different asic. We are removing most
callback. Do a massive RS600 register cleanup to clarify RS600
register, we are still bit fuzy on some register and waiting for
more informations. I don't have hw to test, so this patch is a
best effort to not break anythings and to try to improve things.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Thu, 1 Oct 2009 07:39:24 +0000 (09:39 +0200)]
drm/radeon/kms: Convert RS690/RS740 to new init path (V2).
Also cleanup register specific to RS690/RS740. Version 2 add
missing header file for register, remove unecessary call to AGP
function and fix an indentation bug.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Thu, 1 Oct 2009 08:12:06 +0000 (10:12 +0200)]
drm/radeon/kms: Convert R100 to new init path (V2)
New init path allow to simply asic initialization and make easier
to trace what happen on each different asic. We are removing most
callback. More cleanup should happen latter to remove even more
callback. Also cleanup register specific to R100,RV200,RV250.
Version 2 correct the placement on IGP of the VRAM inside GPU address
space to match the stollen RAM placement of IGP.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Wed, 30 Sep 2009 13:35:32 +0000 (15:35 +0200)]
drm/radeon/kms: Convert R300 to new init path
Also cleanup register specific to R300.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Thu, 1 Oct 2009 08:20:52 +0000 (10:20 +0200)]
drm/radeon/kms: Convert RS400/RS480 to new init path & fix legacy VGA (V3)
Also cleanup register specific to RS400/RS480. This patch also fix
legacy VGA register used to disable VGA access we were programming
wrong register. Now we should properly disable VGA on r100 up to
rs400 asics. Note that RS400/RS480 resume is broken, it hangs the
computer while reprogramming dynamic clock, doesn't work either
without that patch. We need to spend more time investigating this
issue. Version 2 of the patch remove dead code that was left
commented out in the previous version. Version 3 correct the
placement on IGP of the VRAM inside GPU address space to match the
stollen RAM placement of IGP.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Mon, 28 Sep 2009 18:39:19 +0000 (20:39 +0200)]
drm/radeon/kms: Convert R520 to new init path and associated cleanup
Convert the r520 asic support to new init path, change are smaller than
previous one as most of the architecture is now in place and more code
sharing can happen btw various asics.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Jerome Glisse [Mon, 28 Sep 2009 16:34:43 +0000 (18:34 +0200)]
drm/radeon/kms: Convert RV515 to new init path and associated cleanup
Convert the rv515 asic support to new init path also add an explanation
in radeon.h about the new init path. There is also few cleanups
associated with this change (others asic calling rv515 helper
functions).
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Mikael Pettersson [Mon, 28 Sep 2009 16:27:23 +0000 (18:27 +0200)]
drm: fix radeon DRM warnings when !CONFIG_DEBUG_FS
Compiling the radeon DRM driver with !CONFIG_DEBUG_FS
throws the following warnings:
drivers/gpu/drm/radeon/radeon_ttm.c: In function 'radeon_ttm_debugfs_init':
drivers/gpu/drm/radeon/radeon_ttm.c:714: warning: unused variable 'i'
drivers/gpu/drm/radeon/radeon_ttm.c: At top level:
drivers/gpu/drm/radeon/radeon_ttm.c:692: warning: 'radeon_mem_types_list' defined but not used
drivers/gpu/drm/radeon/radeon_ttm.c:693: warning: 'radeon_mem_types_names' defined but not used
Fix: move these variables inside the #if defined(CONFIG_DEBUG_FS)
block in radeon_ttm_debugsfs_init(), which is the only place using them.
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Mikael Pettersson [Mon, 28 Sep 2009 16:26:25 +0000 (18:26 +0200)]
drm: fix drm_fb_helper warning when !CONFIG_MAGIC_SYSRQ
Compiling DRM throws the following warning if MAGIC_SYSRQ is disabled:
drivers/gpu/drm/drm_fb_helper.c:101: warning: 'sysrq_drm_fb_helper_restore_op' defined but not used
Fix: place sysrq_drm_fb_helper_restore_op and associated
definitions inside #ifdef CONFIG_MAGIC_SYSRQ.
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Dave Airlie [Mon, 28 Sep 2009 05:37:25 +0000 (15:37 +1000)]
drm/r600: fix memory leak introduced with 64k malloc avoidance fix.
The legacy r600 path shares code, but doesn't share quite enough
to get the freeing correct. Free the pages here also.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 28 Sep 2009 05:31:10 +0000 (15:31 +1000)]
drm/kms: make fb helper work for all drivers.
This initialises the fb helper with the connector helper,
so that the fb cmdline code works for intel as well.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 25 Sep 2009 22:33:08 +0000 (18:33 -0400)]
drm/radeon/r600: fix offset handling in CS parser
Need add reloc offset to the offset in the actual
packet. Fixes use of the DRAW_INDEX packet by the 3D
driver.
[airlied: modified first one where idx_value == ib[idx+0]
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Alex Deucher [Fri, 25 Sep 2009 21:32:14 +0000 (17:32 -0400)]
drm/radeon/kms/r600: fix forcing pci mode on agp cards
All we need to do on r6xx/r7xx is clear the RADEON_IS_AGP
flag; the rest is handled in r600.c
fixes fdo bug 23990:
http://bugs.freedesktop.org/show_bug.cgi?id=23990
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Dave Airlie [Fri, 25 Sep 2009 23:03:39 +0000 (09:03 +1000)]
drm/radeon/kms: fix for the extra pages copying.
Thanks to Michel for pointing this out to me, this is
why I need to get more sleep, over complicate this a bit.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 25 Sep 2009 20:35:11 +0000 (16:35 -0400)]
drm/radeon/kms/r600: add support for vline relocs
Provides support for anti-tearing functionality
in the ddx.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Alex Deucher [Fri, 25 Sep 2009 20:39:24 +0000 (16:39 -0400)]
drm/radeon/kms: fix some bugs in vline reloc
- fix offset of NOP packet for parsing
- fix p->idx increments
- fix bad mask when updating crtc vline info
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Alex Deucher [Fri, 25 Sep 2009 14:06:39 +0000 (10:06 -0400)]
drm/radeon/kms/r600: clamp vram to aperture size
r6xx and r7xx was missing this. We don't support
non-CPU accessible vram yet.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Dave Airlie [Fri, 25 Sep 2009 20:39:00 +0000 (06:39 +1000)]
drm/kms: protect against fb helper not being created.
If drivers don't init the fb helper on the connector, the cmdline
code won't work, but it shouldn't crash either.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 25 Sep 2009 04:23:47 +0000 (14:23 +1000)]
drm/r600: get values from the passed in IB not the copy.
this avoids reading back the IB on AGP, also it avoids
the race where since we haven't fetched the page from the main IB
and written it to the gpu one, reading back fetches 0.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Amerigo Wang [Wed, 23 Sep 2009 08:24:05 +0000 (04:24 -0400)]
drm: create gitignore file for radeon
Got lots of untracked files after compiling.
These files are generated, thus should be ignored by git.
Signed-off-by: WANG Cong <amwang@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 23 Sep 2009 05:49:20 +0000 (15:49 +1000)]
drm/radeon/kms: remove unneeded master create/destroy functions.
We shouldn't need these at all in radeon kms mode.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 23 Sep 2009 04:44:08 +0000 (14:44 +1000)]
drm/kms: start adding command line interface using fb.
[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>
Dave Airlie [Wed, 16 Sep 2009 10:45:09 +0000 (20:45 +1000)]
fb: change rules for global rules match.
Having a : should be enough 'fb:' isn't really useful
if the fb wants to a kms output ID.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 23 Sep 2009 06:56:27 +0000 (16:56 +1000)]
drm/radeon/kms: don't require up to 64k allocations. (v2)
This avoids needing to do a kmalloc > PAGE_SIZE for the main
indirect buffer chunk, it adds an accessor for all reads from
the chunk and caches a single page at a time for subsequent
reads.
changes since v1:
Use a two page pool which should be the most common case
a single packet spanning > PAGE_SIZE will be hit, but I'm
having trouble seeing anywhere we currently generate anything like that.
hopefully proper short page copying at end
added parser_error flag to set deep errors instead of having to test
every ib value fetch.
fixed bug in patch that went to list.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 25 Sep 2009 01:56:50 +0000 (11:56 +1000)]
drm/radeon/kms: enable dac load detection by default.
when I added the property I forgot to enable it.
Thanks to soreau on #radeon for tracking it down.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Thu, 24 Sep 2009 22:56:12 +0000 (08:56 +1000)]
drm/radeon/kms: enable r600 tv outputs.
I never changed this back when I wrote tv-out support.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Adam Jackson [Wed, 23 Sep 2009 21:31:21 +0000 (17:31 -0400)]
drm/edid: Fix standard timing parse for EDID <= 1.2
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>
Adam Jackson [Wed, 23 Sep 2009 21:31:09 +0000 (17:31 -0400)]
drm/edid: Detailed standard timing blocks have six timings, not five.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Adam Jackson [Wed, 23 Sep 2009 21:30:58 +0000 (17:30 -0400)]
drm/edid: Ignore bad standard timings.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Adam Jackson [Wed, 23 Sep 2009 21:30:45 +0000 (17:30 -0400)]
drm/edid: const cleanup
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Andre Maasikas [Mon, 21 Sep 2009 12:59:41 +0000 (08:59 -0400)]
drm/radeon/r600: set correct pitch for 4 byte copy
[agd5f: also fix the non-kms path]
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Dave Airlie [Mon, 21 Sep 2009 22:50:10 +0000 (08:50 +1000)]
drm/radeon: consolidate family flags used in pciids.
having these separate was pointless and introduced a bug when
one got updated without the other.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Mon, 21 Sep 2009 04:48:45 +0000 (14:48 +1000)]
drm/radeon: some r420s have a CP race with the DMA engine.
This patch makes sure the CP doesn't DMA do VRAM while 2D
is active by inserting a CP resync token.
todo: port to kms.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 18 Sep 2009 15:30:30 +0000 (11:30 -0400)]
drm/radeon/r600/kms: rv670 is not DCE3
RV670 was using the wrong modesetting code.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Sep 2009 04:15:10 +0000 (14:15 +1000)]
drm/radeon/kms: r420 idle after programming GA_ENHANCE
https://bugs.freedesktop.org/show_bug.cgi?id=24041
The idle allows rs690 to startup properly.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Sep 2009 04:06:30 +0000 (14:06 +1000)]
drm/radeon/kms: more fixes to rv770 suspend/resume path.
This resumes my
RV730PRO (4650)
RV770 (4850)
fine.
Still researching the RV4550 (RV710), resumes without X fine.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 18 Sep 2009 08:41:24 +0000 (18:41 +1000)]
drm/radeon/kms: more alignment for rv770.c with r600.c
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 18 Sep 2009 08:33:07 +0000 (18:33 +1000)]
drm/radeon/kms: rv770 blit init called too late.
re-align with r600 code, to init blit earlier.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 18 Sep 2009 05:19:37 +0000 (15:19 +1000)]
drm/radeon/kms: move around new init path code to avoid posting at init
We really don't want to post the card at init, it takes a relatively
long time and isn't required, so split the resume path into
a startup path called by both init/resume and separate resume
entry point to do posting.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 15 Sep 2009 01:07:52 +0000 (11:07 +1000)]
drm/radeon/r600: fix some issues with suspend/resume.
a) don't zero gart table on gart enable
b) move pinning shader object into resume path
c) unpin shader object on suspend
d) set cp ready to false after cp shutdown on suspend.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 18 Sep 2009 04:16:38 +0000 (14:16 +1000)]
drm/radeon/kms: disable VGA rendering engine before taking over VRAM
Before we use any of VRAM, we need to disable the VGA rendering
engine, this render text mode into a graphical framebuffer
for scanout, however it does this on vblank, and can end up
overwriting the GART table and r600 shader objects.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Michel Dänzer [Thu, 17 Sep 2009 07:42:28 +0000 (09:42 +0200)]
drm/radeon/kms: Move radeon_get_clock_info() call out of radeon_clocks_init().
Someone on IRC reported problems after commit
95a8f1bf4f48b434c9f839ab5a0773f66b39d7c6 ('drm/radeon/kms: Move
radeon_clocks_init() call back after getting VRAM info.'). And indeed, at least
some ASIC vram_info hooks use the clock info obtained by
radeon_get_clock_info(). So, move that call out of radeon_clocks_init(), ahead
of the radeon_vram_info() call.
[airlied - fixup missing r600/rv770 calls]
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drm/radeon/kms: fix get clock info calls for r600/rv770 init path.
These were missed when it got split out.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 9 Sep 2009 07:40:54 +0000 (17:40 +1000)]
drm/radeon/kms: add initial connector properties
This adds:
coherent mode: TMDS coherent mode for atom cards.
scaling mode: LVDS scaler mode
load detect: DAC load detection, DVI-I, VGA, TV
tmds pll: legacy TMDS pll selection
tv standard: TV standard selection.
for later: other TV ones? dvi subconnector selection using std prop
[contains fixes pointed out on dri-devel for atom bios mixups
by Michel]
Signed-off-by: Dave Airlie <airlied@redhat.com>
Michel Dänzer [Tue, 15 Sep 2009 15:09:30 +0000 (17:09 +0200)]
drm/radeon/kms: Use surfaces for scanout / cursor byte swapping on big endian.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Wed, 16 Sep 2009 13:24:21 +0000 (15:24 +0200)]
drm/radeon/kms: don't fail if we fail to init GPU acceleration
Userspace can query if acceleration is working or not true get
info ioctl and could fallback to software if for some reason
kernel failed to initialize KMS. This should allow to give a
working KMS setup in all case (even with non functionning accel).
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Thu, 17 Sep 2009 06:11:31 +0000 (16:11 +1000)]
drm/r600/kms: fixup number of loops per blit calculation.
Some people were seeing
*ERROR* radeon: writting more dword to ring than expected
after certain blits, the loops calculation didn't take
into account that we do a separate blit for the remainder
after doing the aligned blits.
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 16 Sep 2009 00:15:21 +0000 (10:15 +1000)]
drm/radeon/kms: reprogram format in set base.
This should in theory fix the problem with a mode set being required
for adjusting the color depth.
This also adds in the necessary bits to the format tables for
8-bit, though it doesn't work yet.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 18 Sep 2009 04:31:48 +0000 (14:31 +1000)]
drm/radeon: avivo chips have no separate int bit for display
display interrupts are not enabled via this register, the
DISPLAY_INT bit is a status only to show that other regs
need to be read.
Noticed by Alex Deucher
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 17 Sep 2009 18:25:12 +0000 (14:25 -0400)]
drm/radeon/r600: don't do interrupts
Interrupts are not supported yet. This prevents
things like mesa from trying to use them.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Pekka Paalanen [Thu, 17 Sep 2009 19:59:54 +0000 (22:59 +0300)]
drm: fix _DRM_GEM addmap error message
Fix the error message: this is add, not rm.
Move the closing brace to proper spot: _DRM_GEM branch should not be
included in the block.
Signed-off-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ben Skeggs [Fri, 18 Sep 2009 00:43:52 +0000 (10:43 +1000)]
drm: update crtc x/y when only fb changes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jesse Barnes [Fri, 18 Sep 2009 01:14:41 +0000 (18:14 -0700)]
drm: fix drm_fb_helper handling of kernel crtcs
The drm_fb_helper shouldn't mess with CRTCs that aren't enabled or in
its initial config. Ideally it shouldn't even include CRTCs in its
initial config if they're not in use, but my old fix for that no longer
works. At any rate, this fixes a real bug I was seeing where after a
console blank, both pipes would come back on, even though only one had
been enabled before that. Since the other pipe had a bogus config,
this led to some screen corruption.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Michel Dänzer [Tue, 15 Sep 2009 15:09:27 +0000 (17:09 +0200)]
drm/radeon/kms: Get LVDS native mode details from EDID if necessary.
Fixes RMX problems on older Apple laptops which don't have an x86 BIOS ROM.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Yang Zhao [Tue, 15 Sep 2009 02:21:01 +0000 (12:21 +1000)]
drm/radeon: Save and restore bios scratch regs during S/R
[airlied:- adapted slightly in naming]
Signed-off-by: Yang Zhao <yang@yangman.ca>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 15 Sep 2009 01:12:56 +0000 (11:12 +1000)]
drm/radeon/kms: IB locking dumps out a lockdep ordering issue
We sometimes lock IB then the ring and sometimes the ring then
the IB. This is mostly due to the IB locking not being well defined
about what data in the structs it actually locks. Define what I
believe is the correct behaviour and gets rid of the lock dep ordering
warning.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 15 Sep 2009 10:21:11 +0000 (20:21 +1000)]
drm/radeon/kms: we should return 0 when we have no modes not -1.
This fixes my monitor with broken EDID so it at least get 800x600.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Michel Dänzer [Tue, 15 Sep 2009 15:09:32 +0000 (17:09 +0200)]
drm/radeon/kms: Free CS parser state tracking memory.
Fixes leak hidden in commit
9f022ddfb23793b475ff7e57ac08a766dd5d31bd
('drm/radeon/kms: convert r4xx to new init path').
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Michel Dänzer [Tue, 15 Sep 2009 15:09:33 +0000 (17:09 +0200)]
drm/radeon/kms: Don't kzalloc memory which is immediately overwritten.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Michel Dänzer [Tue, 15 Sep 2009 15:09:26 +0000 (17:09 +0200)]
drm/radeon/kms: Move radeon_clocks_init() call back after getting VRAM info.
It may indirectly call radeon_set_clock_gating() which relies on the VRAM info.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Michel Dänzer [Tue, 15 Sep 2009 15:09:28 +0000 (17:09 +0200)]
drm/radeon/kms: Only add common modes which fit in both panel dimensions.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Dave Airlie [Mon, 14 Sep 2009 23:03:43 +0000 (09:03 +1000)]
drm/radeon/kms: add 32/64 ioctl support.
Although the new radeon driver ioctls don't need this, some of
the drm initialisation ioctls require it, so add this to make them
work.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Mon, 14 Sep 2009 16:29:49 +0000 (18:29 +0200)]
drm/radeon/kms: clear confusion in GART init/deinit path
GART static one time initialization was mixed up with GART
enabling/disabling which could happen several time for instance
during suspend/resume cycles. This patch splits all GART
handling into 4 differents function. gart_init is for one
time initialization, gart_deinit is called upon module unload
to free resources allocated by gart_init, gart_enable enable
the GART and is intented to be call after first initialization
and at each resume cycle or reset cycle. Finaly gart_disable
stop the GART and is intended to be call at suspend time or
when unloading the module.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Fri, 11 Sep 2009 13:55:33 +0000 (15:55 +0200)]
drm/radeon/kms: cleanup - remove radeon_share.h
radeon_share.h was begining to give problem with include order in
respect of radeon.h. It's easier and also i think cleaner to move
what was in radeon_share.h into radeon.h. At the same time use the
extern keyword for function shared accross the module.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Fri, 11 Sep 2009 11:00:43 +0000 (13:00 +0200)]
drm/radeon/kms: move mtrr range add and memory information
Move mtrr range and memory information printing to radeon_object_init,
this are memory information and initialization common to all GPU and
they better fit in this function. Will also prevent code duplication
with upcoming init path changes.
airlied: fixed warning introduced
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Fri, 11 Sep 2009 13:35:22 +0000 (15:35 +0200)]
drm/radeon/kms: convert r4xx to new init path
This convert r4xx to new init path it also fix few bugs.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 11 Sep 2009 19:27:14 +0000 (15:27 -0400)]
drm/radeon/kms: fix typo in quirks
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>