Commit Graph

277119 Commits

Author SHA1 Message Date
Ben Skeggs ff2b6c6e58 drm/nouveau/pm: remove the older interfaces completely
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:25 +10:00
Ben Skeggs 36f1317ed0 drm/nv04-nv30/pm: port to newer interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:24 +10:00
Ben Skeggs f3fbaf34e2 drm/nv50/pm: rewrite clock management, and switch to the new pm hooks
This area is horrifically complicated on these chipsets, and it's likely we
will need at least a few more tweaks yet.

Oh yes, and it's completely disabled on IGPs for the moment.  From traces,
things look potentially different there yet again.  Sigh...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:24 +10:00
Martin Peres d4cca9e1fc drm/nv50/pm: s/PLL_UNK05/PLL_VDEC/
Following to "drm/nv50/pm: s/unk05/vdec/", let's rename the PLL to PLL_VDEC

PLL names are purely indicative and are based on the most important engine
it clocks.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:24 +10:00
Martin Peres dd1da8de17 drm/nouveau/pm: make clocks_set return an error code clocks_set can fail.
Reporting an error is better than silently refusing to reclock.

V2: Use the same logic on nv40

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:23 +10:00
Martin Peres 6109183794 drm/nvd0: read temperature as we did on nv84+ boards
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:23 +10:00
Ben Skeggs 1cb9469ee7 drm/nv50/disp: fix scaling of doublescan modes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:23 +10:00
Ben Skeggs 616a5f57b6 drm/nv50/disp: rewrite crtc timing calculation, with proper names and fixes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:22 +10:00
Ben Skeggs a03a8623ad drm/nouveau/disp: kill off nouveau_crtc.mode
This hasn't been necessary for a long time now..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:22 +10:00
Ben Skeggs c833442306 drm/nv50/disp: allow interlaced and doublescan modes on digital outputs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:22 +10:00
Ben Skeggs 4ceca5f864 drm/nouveau: don't pretend to support the DVI-I 'select subconnector' prop
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:21 +10:00
Ben Skeggs de69185573 drm/nouveau: improve dithering properties, and implement proper auto mode
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:21 +10:00
Ben Skeggs 488ff207f9 drm/nouveau: no need to pass parameters into set_scale/dither
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:20 +10:00
Ben Skeggs 6322175530 drm/nouveau: determine a value for display_info.bpc if edid doesn't
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:20 +10:00
Ben Skeggs 9976f15c27 drm/nv50/disp: wait for encoder disconnect to complete before link training
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:20 +10:00
Ben Skeggs 7ae494e80c drm/nv50/disp: disconnect encoders before reprogramming them
Fixes a case where we don't get separate supervisor interrupt sequences for
disconnect and modeset events.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:19 +10:00
Ben Skeggs 0f6ea564de drm/nv50/disp: completely reset disp if master evo channel active at init
Should fix issues with kexec, and as a nice side bonus, the code to avoid
having PDISP disappear will also fix hibernate on those effected systems.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:19 +10:00
Ben Skeggs b98e3f5c9e drm/nv50/disp: synchronise display right after init
This has the effect of ensuring the encoders which were active before we
loaded get disconnected properly before we start reprogramming them.

Also removing a bit of cargo-cult from the initial evo pushbuf.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:18 +10:00
Ben Skeggs e6e039d10d drm/nv50/disp: move sync routine to where it can be used by other modules
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:18 +10:00
Maxim Levitsky a4eaa0a042 drm/nouveau: restore cursors after restoring mode
PDISP doesn't like it when disabled CRTCs are poked.

Fixes external output not coming to life when it has cursor on.
https://bugs.freedesktop.org/show_bug.cgi?id=41608

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:18 +10:00
Maxim Levitsky 71d91f655e drm/nouveau: restore performance mode a bit later.
Otherwice code that responsible for idling the card can't work.
BIOS init tables are supposed to init the clocks to correct values,
so that shouldn't cause any problems (we don't reclock by default anyway)

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:17 +10:00
Maxim Levitsky 4bfb94a1b4 drm/nouveau: disable output polling through suspend.
Because doing polling while hardware is disabled is a bad idea...

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:17 +10:00
Maxim Levitsky c983e6f660 drm/nv50: also report errors in MP1/MP2 when they happen.
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:17 +10:00
Ben Skeggs b29caa5885 drm/nouveau: add overscan compensation connector properties
Exposes the same connector properties as the Radeon implementation, however
their behaviour isn't exactly the same.  The primary difference being that
unless both hborder/vborder have been defined by the user, the driver will
keep the aspect ratio of the overscanned area the same as the mode the
display is programmed for.

Enabled for digital outputs on GeForce 8 and up, excluding GF119.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:16 +10:00
Ben Skeggs 27d5030a23 drm/nouveau: move master modesetting init to nouveau_display
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:16 +10:00
Ben Skeggs 549cd872b0 drm/nv50/crtc: disable flip overlay around scaling mode changes
Prevents EVO getting all angry at us.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:15 +10:00
Ben Skeggs b2337f2333 drm/nouveau/hdmi: enable sending of avi/audio infoframes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:15 +10:00
Ben Skeggs 52c7bcdb67 drm/nouveau/hdmi: add hdmi register accessors to handle hdmi block move
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:14 +10:00
Ben Skeggs 25575b414c drm/nouveau/hdmi: build ELD from EDID, notify audio driver of its presence
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:14 +10:00
Ben Skeggs 35bb5089cc drm/nv50/pm: s/unk05/vdec/
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:13 +10:00
Ben Skeggs 1e05415733 drm/nouveau/pm: remove defunct fanspeed_set/get from pm table
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:13 +10:00
Ben Skeggs 6934618014 drm/nv40/pm: convert to new pwm hooks, also fixing pwm type detection
A NV49 appeared a while back that was using the "nv41 style" pwm registers,
rather than the "nv40 style" ones my board is using.  This disproves the
previous theory that the pwm controller choice is chipset-specific.

So, after looking at a bunch of vbios images it appears that the next viable
theory is that we should select the pwm controller to use based on the gpio
line the fan is tied to, just like we do on nv50.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:13 +10:00
Ben Skeggs 5a4267ab14 drm/nv50/pm: convert to new fanspeed pwm controller hooks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:12 +10:00
Ben Skeggs a175094cd8 drm/nouveau/pm: introduce generic handler for on-chip fan controller
The handling of the internal pwm fan controller is similar enough between
current chipsets that it makes sense to share the logic, and bugfixes :)

No hw backends converted yet, will automatically fall-through to the
"old" per-chipset fanspeed hooks for now.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:12 +10:00
Ben Skeggs 85a2a36521 drm/nouveau/gpio: remove invert flag, use state[] everywhere
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:12 +10:00
Ben Skeggs 3f8e11e4b6 drm/nv50/pm: mostly nailed down fan pwm frequency selection
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:11 +10:00
Martin Peres 11b7d89521 drm/nouveau/pm: manual pwm fanspeed management for nv40+ boards
Exposes the following sysfs entries:
- fan0_input: read the rotational speed of the fan (poll a bit during 250ms)
- pwm0: set the pwm duty cycle
- pwm0_min/max: set the minimum/maximum pwm value

v2 (Ben Skeggs):
- nv50 pwm controller code removed in favour of other more complete code
- FAN_RPM -> FAN_SENSE
- merged FAN_SENSE readout into common code, not at all nv50-specific
- protected fanspeed changes with perflvl_wr
- formatting tidying
- added some comments where things are shaky

v3 (Martin Peres)
- ensure duty min/max from thermal table are sane

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@ensi-bourges.fr>
2011-12-21 19:01:11 +10:00
Ben Skeggs cb9fa62671 drm/nv50/pm: add support for pwm fan control
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:11 +10:00
Ben Skeggs 8f27c54342 drm/nouveau/vdec: implement stub modules for the known engines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:10 +10:00
Ben Skeggs 771e1035b9 drm/nouveau/pm: hook up fanspeed get/set if they're present
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:10 +10:00
Ben Skeggs 04de6a0461 drm/nv41/pm: implement a second type of fanspeed pwm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:10 +10:00
Ben Skeggs 9232969e19 drm/nv40/pm: implement first type of pwm fanspeed funcs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:09 +10:00
Ben Skeggs 0c101461e2 drm/nv40/pm: parse fan pwm divisor from vbios tables
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:09 +10:00
Dave Airlie 3e54f5b72b Merge branch 'exynos-drm-next' of git://git.infradead.org/users/kmpark/linux-samsung into drm-core-next
* 'exynos-drm-next' of git://git.infradead.org/users/kmpark/linux-samsung:
  drm/exynos: Add plane support with fimd
  drm/exynos: add runtime pm feature for fimd
  drm/exynos: updated crtc and encoder dpms framework.
  drm/exynos: Use struct drm_mode_fb_cmd2
  drm/exynos: Fix compile errors
2011-12-21 07:58:08 +00:00
Joonyoung Shim 864ee9e6f6 drm/exynos: Add plane support with fimd
The exynos fimd supports 5 window overlays. Only one window overlay of
fimd is used by the crtc, so we need plane feature to use the rest
window overlays.

This creates one ioctl exynos specific - DRM_EXYNOS_PLANE_SET_ZPOS, it
is the ioctl to decide for user to assign which window overlay.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2011-12-21 15:14:17 +09:00
Joonyoung Shim cb91f6a078 drm/exynos: add runtime pm feature for fimd
This adds runtime PM feature for fimd. The runtime PM functions control
clocks for fimd and prevent to access the register of fimd for vblank
when clock is turned off by suspend of runtime PM.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2011-12-21 15:14:17 +09:00
Inki Dae ec05da959a drm/exynos: updated crtc and encoder dpms framework.
With DPMS ON and OFF requests, crtc dpms would be in charge of
just only device power such as fimd or hdmi and encoder dpms
in charge of device setting(mode setting and register updating)
and also lcd panel and digital TV power.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2011-12-21 15:14:17 +09:00
Joonyoung Shim a794d57da8 drm/exynos: Use struct drm_mode_fb_cmd2
The exynos drm also should use struct drm_mode_fb_cmd2 by changes of
308e5bcbdb commit(drm: add an fb creation
ioctl that takes a pixel format v5).

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2011-12-21 15:14:17 +09:00
Joonyoung Shim ac2bdf7314 drm/exynos: Fix compile errors
This compile errors occur by changes of
e08e96de98 commit, so exynos drm should
apply this changes.

  CC      drivers/gpu/drm/exynos/exynos_drm_drv.o
drivers/gpu/drm/exynos/exynos_drm_drv.c:185: warning: braces around scalar initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:185: warning: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:186: error: field name not in record or union initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:186: error: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:186: warning: initialization from incompatible pointer type
drivers/gpu/drm/exynos/exynos_drm_drv.c:187: error: field name not in record or union initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:187: error: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:187: warning: excess elements in scalar initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:187: warning: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:188: error: field name not in record or union initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:188: error: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:188: warning: excess elements in scalar initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:188: warning: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:189: error: field name not in record or union initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:189: error: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:189: warning: excess elements in scalar initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:189: warning: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:190: error: field name not in record or union initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:190: error: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:190: warning: excess elements in scalar initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:190: warning: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:191: error: field name not in record or union initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:191: error: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:191: warning: excess elements in scalar initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:191: warning: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:192: error: field name not in record or union initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:192: error: (near initialization for 'exynos_drm_driver.fops')
drivers/gpu/drm/exynos/exynos_drm_drv.c:192: warning: excess elements in scalar initializer
drivers/gpu/drm/exynos/exynos_drm_drv.c:192: warning: (near initialization for 'exynos_drm_driver.fops')
make[4]: *** [drivers/gpu/drm/exynos/exynos_drm_drv.o] Error 1
make[3]: *** [drivers/gpu/drm/exynos] Error 2
make[2]: *** [drivers/gpu/drm] Error 2
make[1]: *** [drivers/gpu] Error 2
make: *** [drivers] Error 2

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2011-12-21 15:14:16 +09:00
Ville Syrjälä d0d110e096 drm: Add drm_format_num_planes() utility function
This function returns the number of planes used by a specific pixel
format.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Rob Clark <rob.clark@linaro.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-20 20:34:32 +00:00