Commit graph

506479 commits

Author SHA1 Message Date
Dave Airlie
ae10c22485 Merge branch 'drm/next/rcar-du' of git://linuxtv.org/pinchartl/fbdev into drm-next
rcar-du fixes

* 'drm/next/rcar-du' of git://linuxtv.org/pinchartl/fbdev:
  drm: rcar-du: Enable the atomic updates API
  drm: rcar-du: Don't initialize event->pipe field
  drm: rcar-du: Fix framebuffer reference leak through plane state
  MAINTAINERS: Remove rcar-du.h entry
2015-03-23 09:34:32 +10:00
Dave Airlie
e8b6fe6990 Merge branch 'drm/next/adv7511' of git://linuxtv.org/pinchartl/fbdev into drm-next
adv7511 fixes.

* 'drm/next/adv7511' of git://linuxtv.org/pinchartl/fbdev:
  drm: adv7511: Refactor power management
  drm: adv7511: Fix nested sleep when reading EDID
  drm: adv7511: Fix DDC error interrupt handling
2015-03-23 09:34:08 +10:00
Dave Airlie
b3ede177c8 Merge branch 'drm-next-4.1' of git://people.freedesktop.org/~agd5f/linux into drm-next
- DP MST support (disabled by default)
- non-ATOM aux support (DCE5+)
- output csc support for clamped RGB
- Lots of new queries for profiling, Gallium HUD, etc.
- Misc fixes

* 'drm-next-4.1' of git://people.freedesktop.org/~agd5f/linux: (40 commits)
  drm/radeon: add DisplayPort MST support (v2)
  drm/radeon: improve encoder picking functions (v2)
  drm/radeon: export max link rate calculation
  drm/radeon: add new atombios encoder/transmitter interfaces
  drm/radeon: add some MST registers
  radeon/fb: add wrapper functions around fb connector add/remove
  radeon/cik: add support for short HPD irqs
  radeon/si: add support for short HPD irqs
  radeon/evergreen: add support for short HPD irqs
  radeon: introduce a dp_work handler
  drm/dp_mst: add a function to retrieve vcpi slots
  drm/radeon: program auxch directly (v2)
  drm/radeon: fix doublescan modes (v2)
  drm/radeon: typo in parameter description
  drm/radeon: add support for read reg query from radeon info ioctl
  drm/radeon: add get_allowed_info_register for CIK
  drm/radeon: add get_allowed_info_register for SI
  drm/radeon: add get_allowed_info_register for cayman/TN
  drm/radeon: add get_allowed_info_register for EG/BTC
  drm/radeon: add get_allowed_info_register for r6xx/r7xx
  ...
2015-03-23 09:15:02 +10:00
Dave Airlie
9843ead08f drm/radeon: add DisplayPort MST support (v2)
This adds initial DP 1.2 MST support to radeon, on CAYMAN
and up in theory.

This is off by default.

v2: agd5f:
- add UNIPHY3 offsets
- move atom cmd table code into atombios_encoders.c
- whitespace cleanup
- replace some magic numbers with proper defines

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:51 -04:00
Dave Airlie
8f0fc088f5 drm/radeon: improve encoder picking functions (v2)
For MST we need to be able to pick front end encoders
separate from backend, but only for MST, so we need to
make the encoder picking interface smarter.

v2: agd5f: squash in:
drm/radeon: release digital encoder before asking for new one
Reported-by: Dieter Nützel <Dieter@nuetzel-hh.de>

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:51 -04:00
Dave Airlie
2be123d7c6 drm/radeon: export max link rate calculation
We need this in the MST code later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:50 -04:00
Dave Airlie
bf071900c3 drm/radeon: add new atombios encoder/transmitter interfaces
These allow overriding the encoder id with the frontend,
we need this for setting up MST.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:49 -04:00
Dave Airlie
00a014e8ef drm/radeon: add some MST registers
These registers will be used later to setup

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:49 -04:00
Dave Airlie
bb26270ed2 radeon/fb: add wrapper functions around fb connector add/remove
These are just two wrappers to be used in the MST code later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:48 -04:00
Alex Deucher
f6b355dda4 radeon/cik: add support for short HPD irqs
This adds support to process short HPD irqs on CIK gpus.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:47 -04:00
Dave Airlie
47f2467fff radeon/si: add support for short HPD irqs
This adds support to process short HPD irqs on SI gpus.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:47 -04:00
Dave Airlie
2bc67b4d9e radeon/evergreen: add support for short HPD irqs
This adds support for processing short irqs, and triggering
the dp_work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:46 -04:00
Dave Airlie
de6284aa01 radeon: introduce a dp_work handler
This is to be called on short HPD irqs, just introduce
the basic infrastructure for it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:45 -04:00
Dave Airlie
87f5942d1f drm/dp_mst: add a function to retrieve vcpi slots
radeon requires this to get the slots for later filling
out a table on every transition.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:45 -04:00
Dave Airlie
875711f0e2 drm/radeon: program auxch directly (v2)
The atombios tables have an unfortunate restriction on only
being able to write 12 bytes, MST really wants 16-bytes here,
and since the hw can do it, we should just write directly to it.

This uses a module option to allow for it now, and maybe
we should provide the old code as a fallback for a while.

v2: (agd5f)
- move registers to a proper register header
- only enable on DCE5+
- enable by default on DCE5+
- Switch pad to aux mode before using it
- reformat instance handling to better match the
  rest of the driver

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:44 -04:00
Alex Deucher
fd99a0943f drm/radeon: fix doublescan modes (v2)
Use the correct flags for atom.

v2: handle DRM_MODE_FLAG_DBLCLK

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-03-19 12:26:43 -04:00
b5c9ecab1e drm/radeon: typo in parameter description
"defaul" -> "default"

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:43 -04:00
Alex Deucher
4535cb9cef drm/radeon: add support for read reg query from radeon info ioctl
This allows us to query certain registers from userspace
for profiling and harvest configuration.  E.g., it can
be used by the GALLIUM_HUD for profiling the status of
various gfx blocks.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:42 -04:00
Alex Deucher
353eec2ab2 drm/radeon: add get_allowed_info_register for CIK
Registers that can be fetched from the info ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:41 -04:00
Alex Deucher
4af692f6e3 drm/radeon: add get_allowed_info_register for SI
Registers that can be fetched from the info ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:40 -04:00
Alex Deucher
e66582f9ff drm/radeon: add get_allowed_info_register for cayman/TN
Registers that can be fetched from the info ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:40 -04:00
Alex Deucher
ff609975e1 drm/radeon: add get_allowed_info_register for EG/BTC
Registers that can be fetched from the info ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:39 -04:00
Alex Deucher
c6d2ac2c36 drm/radeon: add get_allowed_info_register for r6xx/r7xx
Registers that can be fetched from the info ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:38 -04:00
Alex Deucher
18b53e9057 drm/radeon: add get_allowed_info_register function for r1xx-r5xx
Just a stub.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:38 -04:00
Alex Deucher
4ce4728b51 drm/radeon: add new callback for info ioctl register accessor
This adds a callback for each asic family to determine what
registers are allowed to be read back via the info ioctl.

The idea here is to allow usermode to query things like GPU status
registers or GPU harvest registers for profiling and determining
the gfx config.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:37 -04:00
Alex Deucher
5c363a8603 drm/radeon: add INFO query for current sclk/mclk
Allow the UMDs to query the current sclk/mclk
for profiling, etc.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:36 -04:00
Alex Deucher
9b23bad032 drm/radeon/kv: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:36 -04:00
Alex Deucher
7ce9cdaec3 drm/radeon/tn: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:35 -04:00
Alex Deucher
2f8e1eb7d6 drm/radeon/sumo: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:34 -04:00
Alex Deucher
dbbd3c81b0 drm/radeon/ci: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:34 -04:00
Alex Deucher
ca1110bc5b drm/radeon/si: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:33 -04:00
Alex Deucher
1d633e3a21 drm/radeon/ni: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:32 -04:00
Alex Deucher
da6472f349 drm/radeon: remove some rv7xx leftovers from btc dpm code
Some copy paste leftovers.  No functional change.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:31 -04:00
Alex Deucher
99550ee9e8 drm/radeon/btc: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:31 -04:00
Alex Deucher
296deb7167 drm/radeon/rv7xx/eg: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:30 -04:00
Alex Deucher
d0a04d3b2e drm/radeon/rv6xx: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:29 -04:00
Alex Deucher
3c94566ce1 drm/radeon/rs780: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:29 -04:00
Alex Deucher
d7dbce09b6 drm/radeon/dpm: add new callbacks to get the current sclk/mclk
Needed to to expose the current clocks via the INFO ioctl.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:28 -04:00
Alex Deucher
d6d2a1882a drm/radeon: add INFO query for GPU temperature
Useful for profiling.

Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:27 -04:00
Maarten Lankhorst
b9729b17a4 drm/radeon: dont switch vt on suspend
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:27 -04:00
Alex Deucher
a1dcc2778b drm/radeon: setup quantization_range in AVI infoframe
If the display supports selectable range, set the range
based on what the user has selected for output csc.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=83226

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:26 -04:00
Alex Deucher
643b1f5629 drm/radeon: implement output csc property for DCE5+
Implement the property for DCE5+ asics.  Older asics
require a slightly more complex process.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=83226

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:25 -04:00
Alex Deucher
67ba31d352 drm/radeon: add an output_csc property
This adds the drm property for output csc (e.g.,
transform of output display colorspace).  Currently
only common ones (TV RGB, BT.601, BT.709) are supported,
but bypass and tv rgb are really the only useful ones at
the moment.  Additionally we could expose a user adjustable
matrix in the future.

This commit just adds the property.  The hw support will
be added in subsequent patches.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=83226

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:25 -04:00
Laurent Pinchart
c6169e49bd drm: adv7511: Refactor power management
Remove the internal dependency on DPMS mode for power management by
using a by a powered state boolean instead, and use the new power off
handler at probe time. This ensure that the regmap cache is properly
marked as dirty when the device is probed, and the registers properly
synced during the first power up.

As a side effect this removes the initialization of current_edid_segment
at probe time, as the field will be initialized when the device is
powered on, at the latest right before reading EDID data.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Christian Kohn <christian.kohn@xilinx.com>
Tested-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2015-03-19 12:28:55 +02:00
Laurent Pinchart
a5241289c4 drm: adv7511: Fix nested sleep when reading EDID
The EDID read code waits for the read completion interrupt to occur
using wait_event_interruptible(). The condition passed to the macro
reads I2C registers. This results in sleeping with the task state set
to TASK_INTERRUPTIBLE, triggering a WARN_ON() introduced in commit
8eb23b9f35 ("sched: Debug nested sleeps").

Fix this by reworking the EDID read code. Instead of checking whether
the read is complete through I2C reads, handle the interrupt registers
in the interrupt handler and update a new edid_read flag accordingly. As
a side effect both the IRQ and polling code paths now process the
interrupt sources through the same code path, simplifying the code.

Cc: stable@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-19 12:28:55 +02:00
Laurent Pinchart
2e96206c4f drm: adv7511: Fix DDC error interrupt handling
The DDC error interrupt bit is located in REG_INT1, not REG_INT0. Update
both the interrupt wait code and the interrupt sources reset code
accordingly.

Cc: stable@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-19 12:28:55 +02:00
Laurent Pinchart
6dbe686b59 drm: rcar-du: Enable the atomic updates API
Set the DRIVER_ATOMIC flag to enable usage of the atomic updates API
with the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-19 12:00:22 +02:00
Laurent Pinchart
3515a9a20a drm: rcar-du: Don't initialize event->pipe field
The field is set by drm_send_vblank_event(), there's no need to
preinitialize it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-19 12:00:21 +02:00
Laurent Pinchart
de115fac73 drm: rcar-du: Fix framebuffer reference leak through plane state
Plane state duplication takes a reference to the framebuffer stored in
the state, but state destroy doesn't release it. This causes a reference
leak. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-19 12:00:21 +02:00
Joe Perches
343e0d2b58 MAINTAINERS: Remove rcar-du.h entry
commit 2378ad1228 ("drm: rcar-du: Remove platform data support")
removed the file, remove the pattern.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-19 12:00:21 +02:00