Commit graph

11156 commits

Author SHA1 Message Date
Patrik Jakobsson 5934584701 drm/gma500: Add generic encoder functions
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:28 +02:00
Patrik Jakobsson 561573bf69 drm/gma500/psb: Convert to generic cursor funcs
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:28 +02:00
Patrik Jakobsson 04416625f9 drm/gma500/cdv: Convert to generic cursor funcs
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:27 +02:00
Patrik Jakobsson 38945be630 drm/gma500: Add generic cursor functions
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:27 +02:00
Patrik Jakobsson b1255b8849 drm/gma500/psb: Convert to generic crtc->destroy
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:26 +02:00
Patrik Jakobsson d903b610d3 drm/gma500/mdfld: Use identical generic crtc funcs
Use the generic gma functions instead of the medfield functions where
they are identical.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:26 +02:00
Patrik Jakobsson fe5802957f drm/gma500/oak: Use identical generic crtc funcs
Use the generic gma functions instead of the oaktrail functions where
they are identical.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:25 +02:00
Patrik Jakobsson 42568dd5d3 drm/gma500/psb: Convert to gma_crtc_dpms()
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:24 +02:00
Patrik Jakobsson 6443ea1aca drm/gma500: Convert to generic gamma funcs
This takes care of the remaining chips using the old generic code.
We don't check if the pipe number is valid but the old code peeked in
the register map before checking anyways so just ignore it.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:24 +02:00
Patrik Jakobsson 00b1fe7445 drm/gma500/psb: Convert to gma_pipe_set_base()
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:23 +02:00
Patrik Jakobsson a1f4efe441 drm/gma500/cdv: Convert to generic gamma funcs
There is a slight difference in how we pick the palette register in the
generic function but we should be ok as long as psb_intel_crtc->pipe and
the register map is sane.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:23 +02:00
Patrik Jakobsson 7ea03f0695 drm/gma500/cdv: Convert to gma_crtc_dpms()
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:22 +02:00
Patrik Jakobsson b8e5ec9f30 drm/gma500: Add IS_CDV() macro
This macro is needed for Cedarview specific stuff in the generic gma
functions.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:22 +02:00
Patrik Jakobsson 3c44716653 drm/gma500/cdv: Convert to gma_pipe_set_base()
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:21 +02:00
Patrik Jakobsson 4855177ed0 drm/gma500/psb: Use identical generic crtc funcs
This patch makes psb use the gma_xxx counterparts that are identical. I
took them in one sweep as they should not cause any regressions.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:20 +02:00
Patrik Jakobsson d1fa08f3ba drm/gma500: Make all chips use gma_wait_for_vblank
Also remove the duplicated oaktrail function.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:20 +02:00
Patrik Jakobsson ad3c46eae3 drm/gma500/cdv: Use identical generic crtc funcs
This patch makes cdv use the gma_xxx counterparts that are identical. I
took them in one sweep as they should not cause any regressions.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:19 +02:00
Patrik Jakobsson 2eff0b3359 drm/gma500: Add generic pipe/crtc functions
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:19 +02:00
Patrik Jakobsson f0e9d89b9b drm/gma500: Remove the unused psb_intel_display.h
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:18 +02:00
Patrik Jakobsson 7f67c06721 drm/gma500/psb: Make use of generic clock code
Add chip specific callbacks for the generic and non-generic clock
calculation code. Also remove as much dupilicated code as possible.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:18 +02:00
Patrik Jakobsson fe477cc1b0 drm/gma500: Make use of gma_pipe_has_type()
Replace any use of xxx_intel_pipe_has_type() with the generic
gma_pipe_has_type() function. Poulsbo still use it but that will be
removed when we rip out psb_intel_pipe_has_type().

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:17 +02:00
Patrik Jakobsson 2adb29ff61 drm/gma500/cdv: Make use of the generic clock code
Add chip specific callbacks for the generic and non-generic clock
calculation code. Also remove as much dupilicated code as possible.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:17 +02:00
Patrik Jakobsson 5ea75e0f05 drm/gma500: Add generic code for clock calculation
This patch aims to unify the bits and pieces that are common (or similar
enough) for pll clock calculations. Nothing makes use of this code yet
That will come in later patches.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
2013-07-24 01:47:16 +02:00
Daniel Vetter 85d9cb41db drm: remove drm_order
All users of it are now gone!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 20:14:29 +10:00
Daniel Vetter b72a8925fd drm/radeon: s/drm_order/order_base_2/
Last driver and pretty obviously a major user of this little function.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 20:14:24 +10:00
Daniel Vetter 0e267944f6 drm/r128: s/drm_order/order_base_2/
Again just use the version provided by the linux core.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 20:14:19 +10:00
Daniel Vetter 04420c9c6a drm/bufs: s/drm_order/order_base_2/
The version offered by the core is ridiculously optimized and
does the same thing. So use it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 20:13:49 +10:00
Daniel Vetter bd0c0ceef6 drm: move drm_getsarea into drm_bufs.c
It fiddles the sarea out of the maps which are also handled in
drm_bufs.c

With this drm_drv.c is a notch more legacy free.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 20:13:17 +10:00
David Herrmann c3911624f9 drm/pci: remove useles #if 1
These don't make any sense, really..

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:37:59 +10:00
David Herrmann 89c8233f82 drm/gem: simplify object initialization
drm_gem_object_init() and drm_gem_private_object_init() do exactly the
same (except for shmem alloc) so make the first use the latter to reduce
code duplication.

Also drop the return code from drm_gem_private_object_init(). It seems
unlikely that we will extend it any time soon so no reason to keep it
around. This simplifies code paths in drivers, too.

Last but not least, fix gma500 to call drm_gem_object_release() before
freeing objects that were allocated via drm_gem_private_object_init().
That isn't actually necessary for now, but might be in the future.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Acked-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:37:53 +10:00
Daniel Vetter 23367ff490 drm: rip out dev->last_checked
Only ever re-cleared in drm_setup, otherwise completely unused.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:36:23 +10:00
Daniel Vetter 1d8d29cf2a drm: fold in drm_sg_alloc into the ioctl
There's no other caller from driver code, so we can fold this in.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:34:01 +10:00
Daniel Vetter 81e9569760 drm/radeon: remove DRIVER_HAS_DMA/SG/PCI_DMA from the kms driver
Really, this is all old-style stuff and just copy-pasta from the
ums driver.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:25:11 +10:00
Daniel Vetter 4cb4ea39cd drm/nouveau: drop DRIVER_PCI_DMA and DRIVER_SG
The former doesn't do anything without DRIVER_HAVE_DMA (which is
force-disabled for kms drivers anyway). The latter isn't used by the
(kms) nouveau ddx.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:25:02 +10:00
Daniel Vetter 494f38e4e0 drm: kill dev->buf_readers and dev->buf_writers
Again totally unused, so just remove them.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:20:24 +10:00
Daniel Vetter 5379dc0422 drm/radoen: kill radeon_dma_ioctl_kms
No need to create a dummy ioctl function to return -EINVAL, since
that's what the core already does in the absence of the dma_ioctl
callback. So we can safely remove this.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:20:23 +10:00
Daniel Vetter c7e00b6d6a drm: kill dev->ctx_start and dev->lck_start
Again completely unused, so just remove it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:20:21 +10:00
Daniel Vetter c78d753103 drm: kill dev->interrupt_flag and dev->dma_flag
Completely unused, so just remove them.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:20:21 +10:00
Daniel Vetter a17800c701 drm: remove dev->last_switch
Only ever assigned in the context code for real, with no readers
anywhere. Remove it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:20:20 +10:00
Daniel Vetter 3dadef6c96 drm: kill dev->context_wait
No one ever waits on this waitqueue, so the wake_up call is wasted.
Remove it all.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:20:19 +10:00
Daniel Vetter 492d774db3 drm: remove drm_modctx ioctl and use drm_noop instead
It doesn't do anything, so kill the code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-23 19:20:18 +10:00
Dave Airlie e13af9a834 Merge tag 'drm-intel-next-2013-07-12' of git://people.freedesktop.org/~danvet/drm-intel into drm-next
Highlights:
- follow-up refactoring after the shared dpll rework that landed in 3.11
- oddball prep cleanups from Ben for ppgtt
- encoder->get_config state tracking infrastructure from Jesse
- used by the experimental fastboot support from Jesse (disabled by
  default)
- make the error state file official and add it to our sysfs interface
  (Mika)
- drm_mm prep changes from Ben, prepares to embedd the drm_mm_node (which
  will be used by the vma rework later on)
- interrupt handling rework, follow up cleanups to the VECS enabling, hpd
  storm handling and fifo underrun reporting.
- Big pile of smaller cleanups, code improvements and related stuff.

* tag 'drm-intel-next-2013-07-12' of git://people.freedesktop.org/~danvet/drm-intel: (72 commits)
  drm/i915: clear DPLL reg when disabling i9xx dplls
  drm/i915: Fix up cpt pixel multiplier enable sequence
  drm/i915: clean up vlv ->pre_pll_enable and pll enable sequence
  drm/i915: move error state to own compilation unit
  drm/i915: Don't attempt to read an unitialized stack value
  drm/i915: Use for_each_pipe() when possible
  drm/i915: don't enable PM_VEBOX_CS_ERROR_INTERRUPT
  drm/i915: unify ring irq refcounts (again)
  drm/i915: kill dev_priv->rps.lock
  drm/i915: queue work outside spinlock in hsw_pm_irq_handler
  drm/i915: streamline hsw_pm_irq_handler
  drm/i915: irq handlers don't need interrupt-safe spinlocks
  drm/i915: kill lpt pch transcoder->crtc mapping code for fifo underruns
  drm/i915: improve GEN7_ERR_INT clearing for fifo underrun reporting
  drm/i915: improve SERR_INT clearing for fifo underrun reporting
  drm/i915: extract ibx_display_interrupt_update
  drm/i915: remove unused members from drm_i915_private
  drm/i915: don't frob mm.suspended when not using ums
  drm/i915: Fix VLV DP RBR/HDMI/DAC PLL LPF coefficients
  drm/i915: WARN if the bios reserved range is bigger than stolen size
  ...

Conflicts:
	drivers/gpu/drm/i915/i915_gem.c
2013-07-19 12:12:21 +10:00
Dave Airlie 3668f0df6e Merge branch 'drm/3.11/fixes' of git://linuxtv.org/pinchartl/fbdev into drm-fixes
Fixes builds
* 'drm/3.11/fixes' of git://linuxtv.org/pinchartl/fbdev:
  drm/rcar-du: Use the GEM PRIME helpers
  drm/shmobile: Use the GEM PRIME helpers
2013-07-18 20:04:50 +10:00
Dave Airlie fb328d7365 Merge branch 'drm-fixes-3.11' of git://people.freedesktop.org/~agd5f/linux
more DPM fixes for radeon.

* 'drm-fixes-3.11' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon/dpm: add debugfs support for RS780/RS880 (v3)
  drm/radeon/dpm/atom: fix broken gcc harder
  drm/radeon/dpm/atom: restructure logic to work around a compiler bug
  drm/radeon/dpm: fix atom vram table parsing
  drm/radeon: fix an endian bug in atom table parsing
  drm/radeon: add a module parameter to disable aspm
2013-07-18 10:19:46 +10:00
Alex Deucher 444bddc4b9 drm/radeon/dpm: add debugfs support for RS780/RS880 (v3)
This allows you to look at the current DPM state via
debugfs.

Due to the way the hardware works on these asics, there's
no way to look up exactly what power state we are in, so
we make the best guess we can based on the current sclk.

v2: Anthoine's version
v3: fix ref div

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-17 16:47:52 -04:00
Alex Deucher f90555cbe6 drm/radeon/dpm/atom: fix broken gcc harder
See bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=66932
https://bugs.freedesktop.org/show_bug.cgi?id=66972
https://bugs.freedesktop.org/show_bug.cgi?id=66945

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-17 16:35:06 -04:00
Andre Heider 48fa04c3fc drm/radeon/dpm/atom: restructure logic to work around a compiler bug
It seems gcc 4.8.1 generates bogus code for the old logic causing
part of the function to get skipped.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=66932
https://bugs.freedesktop.org/show_bug.cgi?id=66972
https://bugs.freedesktop.org/show_bug.cgi?id=66945

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-17 14:52:49 -04:00
Alex Deucher 77c7d50a4a drm/radeon/dpm: fix atom vram table parsing
Parsing the table in incorrectly led to problems with
certain asics with mclk switching.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-17 14:52:48 -04:00
Alex Deucher 1fa4252af7 drm/radeon: fix an endian bug in atom table parsing
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-17 14:52:47 -04:00
Alex Deucher 1294d4a36d drm/radeon: add a module parameter to disable aspm
Can cause hangs when enabled in certain motherboards.
Set radeon.aspm=0 to disable aspm.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-17 14:52:46 -04:00