]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
9 years agoMerge tag 'drm-amdkfd-next-2015-03-25' of git://people.freedesktop.org/~gabbayo/linux...
Dave Airlie [Tue, 31 Mar 2015 03:36:25 +0000 (13:36 +1000)]
Merge tag 'drm-amdkfd-next-2015-03-25' of git://people.freedesktop.org/~gabbayo/linux into drm-next

- Allow amdkfd to work with multiple kgd instances. This is in preparation for
  AMD's new open source kernel graphic driver (amdgpu), and for the new
  AMD APU, Carrizo.

- Convert timestamping to use 64bit time accessors

- Three other minor changes.

* tag 'drm-amdkfd-next-2015-03-25' of git://people.freedesktop.org/~gabbayo/linux:
  drm/amdkfd: Add multiple kgd support
  drm/amdkfd: Convert timestamping to use 64bit time accessors
  drm/amdkfd: add debug prints for process teardown
  drm/amdkfd: Remove unused field from struct qcm_process_device
  drm/amdkfd: rename fence_wait_timeout

9 years agoMerge branch 'drm-st-next-2015-03-19' of git://git.linaro.org/people/benjamin.gaignar...
Dave Airlie [Thu, 26 Mar 2015 23:17:20 +0000 (09:17 +1000)]
Merge branch 'drm-st-next-2015-03-19' of git://git.linaro.org/people/benjamin.gaignard/kernel into drm-next

This patch makes STI driver use the atomic helpers.
I have fix the comments done by Daniel on the first version and get
his ack with this second version.
* 'drm-st-next-2015-03-19' of git://git.linaro.org/people/benjamin.gaignard/kernel:
  drm: sti: convert driver to atomic modeset

9 years agodrm/amdkfd: Add multiple kgd support
Xihan Zhang [Tue, 17 Mar 2015 11:32:53 +0000 (19:32 +0800)]
drm/amdkfd: Add multiple kgd support

The current code can only support one kgd instance. We have to
support multiple kgd instances in one system. i.e two amdgpu or two
radeon or one amdgpu + one radeon or more than two kgd instances.

Signed-off-by: Xihan Zhang <xihan.zhang@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
9 years agodrm/amdkfd: Convert timestamping to use 64bit time accessors
John Stultz [Thu, 12 Mar 2015 17:23:40 +0000 (10:23 -0700)]
drm/amdkfd: Convert timestamping to use 64bit time accessors

Convert the timestamping in the amdkfd driver to use a timespec64 and 64bit
time accessors.

Although the existing code is completely safe beyond y2038 because it deals
with monotonic time, this patch is still needed in order to kill off all uses
of struct timespec.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
9 years agodrm/amdkfd: add debug prints for process teardown
Oded Gabbay [Tue, 24 Feb 2015 08:51:59 +0000 (10:51 +0200)]
drm/amdkfd: add debug prints for process teardown

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agodrm/amdkfd: Remove unused field from struct qcm_process_device
Oded Gabbay [Wed, 25 Feb 2015 12:15:24 +0000 (14:15 +0200)]
drm/amdkfd: Remove unused field from struct qcm_process_device

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Reviewed-by: Ben Goz <ben.goz@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agodrm/amdkfd: rename fence_wait_timeout
Oded Gabbay [Thu, 26 Feb 2015 19:24:44 +0000 (21:24 +0200)]
drm/amdkfd: rename fence_wait_timeout

fence_wait_timeout() is an exported kernel symbol, so we should rename our
local function to something different.

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agoMerge tag 'drm-intel-next-2015-03-13-merge' of git://anongit.freedesktop.org/drm...
Dave Airlie [Tue, 24 Mar 2015 01:12:20 +0000 (11:12 +1000)]
Merge tag 'drm-intel-next-2015-03-13-merge' of git://anongit.freedesktop.org/drm-intel into drm-next

drm-intel-next-2015-03-13-rebased:
- EU count report param for gen9+ (Jeff McGee)
- piles of pll/wm/... fixes for chv, finally out of preliminary hw support
  (Ville, Vijay)
- gen9 rps support from Akash
- more work to move towards atomic from Matt, Ander and others
- runtime pm support for skl (Damien)
- edp1.4 intermediate link clock support (Sonika)
- use frontbuffer tracking for fbc (Paulo)
- remove ilk rc6 (John Harrison)
- a bunch of smaller things and fixes all over

Includes backmerge because git rerere couldn't keep up any more.

* tag 'drm-intel-next-2015-03-13-merge' of git://anongit.freedesktop.org/drm-intel: (366 commits)
  drm/i915: Make sure the primary plane is enabled before reading out the fb state
  drm/i915: Update DRIVER_DATE to 20150313
  drm/i915: Fix vmap_batch page iterator overrun
  drm/i915: Export total subslice and EU counts
  drm/i915: redefine WARN_ON_ONCE to include the condition
  drm/i915/skl: Implement WaDisableHBR2
  drm/i915: Remove the preliminary_hw_support shackles from CHV
  drm/i915: Read CHV_PLL_DW8 from the correct offset
  drm/i915: Rewrite IVB FDI bifurcation conflict checks
  drm/i915: Rewrite some some of the FDI lane checks
  drm/i915/skl: Enable the RPS interrupts programming
  drm/i915/skl: Enabling processing of Turbo interrupts
  drm/i915/skl: Updated the i915_frequency_info debugfs function
  drm/i915: Simplify the way BC bifurcation state consistency is kept
  drm/i915/skl: Updated the act_freq_mhz_show sysfs function
  drm/i915/skl: Updated the gen9_enable_rps function
  drm/i915/skl: Updated the gen6_rps_limits function
  drm/i915/skl: Restructured the gen6_set_rps_thresholds function
  drm/i915/skl: Updated the gen6_set_rps function
  drm/i915/skl: Updated the gen6_init_rps_frequencies function
  ...

9 years agoMerge branch 'drm/next/rcar-du' of git://linuxtv.org/pinchartl/fbdev into drm-next
Dave Airlie [Sun, 22 Mar 2015 23:34:32 +0000 (09:34 +1000)]
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

9 years agoMerge branch 'drm/next/adv7511' of git://linuxtv.org/pinchartl/fbdev into drm-next
Dave Airlie [Sun, 22 Mar 2015 23:34:08 +0000 (09:34 +1000)]
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

9 years agoMerge branch 'drm-next-4.1' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Sun, 22 Mar 2015 23:15:02 +0000 (09:15 +1000)]
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
  ...

9 years agoMerge tag 'drm-intel-fixes-2015-03-19' into drm-intel-next
Daniel Vetter [Fri, 20 Mar 2015 10:43:59 +0000 (11:43 +0100)]
Merge tag 'drm-intel-fixes-2015-03-19' into drm-intel-next

Backmerge because of numerous and interleaving conflicts and git
rerere getting confused a bit too often.

Conflicts:
drivers/gpu/drm/i915/intel_display.c

All conflicts are because of -next patches backported to -fixes, so
just go with the code in -next.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
9 years agodrm/radeon: add DisplayPort MST support (v2)
Dave Airlie [Mon, 23 Feb 2015 23:24:04 +0000 (09:24 +1000)]
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>
9 years agodrm/radeon: improve encoder picking functions (v2)
Dave Airlie [Mon, 23 Feb 2015 23:24:03 +0000 (09:24 +1000)]
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>
9 years agodrm/radeon: export max link rate calculation
Dave Airlie [Mon, 23 Feb 2015 23:24:02 +0000 (09:24 +1000)]
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>
9 years agodrm/radeon: add new atombios encoder/transmitter interfaces
Dave Airlie [Mon, 23 Feb 2015 23:24:01 +0000 (09:24 +1000)]
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>
9 years agodrm/radeon: add some MST registers
Dave Airlie [Mon, 23 Feb 2015 23:24:00 +0000 (09:24 +1000)]
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>
9 years agoradeon/fb: add wrapper functions around fb connector add/remove
Dave Airlie [Mon, 23 Feb 2015 23:23:59 +0000 (09:23 +1000)]
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>
9 years agoradeon/cik: add support for short HPD irqs
Alex Deucher [Tue, 24 Feb 2015 17:38:42 +0000 (12:38 -0500)]
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>
9 years agoradeon/si: add support for short HPD irqs
Dave Airlie [Mon, 23 Feb 2015 23:23:58 +0000 (09:23 +1000)]
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>
9 years agoradeon/evergreen: add support for short HPD irqs
Dave Airlie [Mon, 23 Feb 2015 23:23:57 +0000 (09:23 +1000)]
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>
9 years agoradeon: introduce a dp_work handler
Dave Airlie [Mon, 23 Feb 2015 23:23:56 +0000 (09:23 +1000)]
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>
9 years agodrm/dp_mst: add a function to retrieve vcpi slots
Dave Airlie [Mon, 23 Feb 2015 23:23:55 +0000 (09:23 +1000)]
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>
9 years agodrm/radeon: program auxch directly (v2)
Dave Airlie [Thu, 19 Feb 2015 23:21:36 +0000 (09:21 +1000)]
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>
9 years agodrm/radeon: fix doublescan modes (v2)
Alex Deucher [Tue, 24 Feb 2015 16:29:21 +0000 (11:29 -0500)]
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
9 years agodrm/radeon: typo in parameter description
Vincent Batts [Fri, 6 Mar 2015 21:07:05 +0000 (21:07 +0000)]
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>
9 years agodrm/radeon: add support for read reg query from radeon info ioctl
Alex Deucher [Wed, 1 Oct 2014 15:26:50 +0000 (11:26 -0400)]
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>
9 years agodrm/radeon: add get_allowed_info_register for CIK
Alex Deucher [Wed, 1 Oct 2014 15:18:46 +0000 (11:18 -0400)]
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>
9 years agodrm/radeon: add get_allowed_info_register for SI
Alex Deucher [Wed, 1 Oct 2014 14:03:31 +0000 (10:03 -0400)]
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>
9 years agodrm/radeon: add get_allowed_info_register for cayman/TN
Alex Deucher [Wed, 1 Oct 2014 13:51:29 +0000 (09:51 -0400)]
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>
9 years agodrm/radeon: add get_allowed_info_register for EG/BTC
Alex Deucher [Wed, 1 Oct 2014 13:43:38 +0000 (09:43 -0400)]
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>
9 years agodrm/radeon: add get_allowed_info_register for r6xx/r7xx
Alex Deucher [Wed, 1 Oct 2014 13:36:57 +0000 (09:36 -0400)]
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>
9 years agodrm/radeon: add get_allowed_info_register function for r1xx-r5xx
Alex Deucher [Wed, 1 Oct 2014 13:25:27 +0000 (09:25 -0400)]
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>
9 years agodrm/radeon: add new callback for info ioctl register accessor
Alex Deucher [Wed, 1 Oct 2014 13:17:12 +0000 (09:17 -0400)]
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>
9 years agodrm/radeon: add INFO query for current sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 15:33:30 +0000 (11:33 -0400)]
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>
9 years agodrm/radeon/kv: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 15:21:23 +0000 (11:21 -0400)]
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>
9 years agodrm/radeon/tn: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 15:01:59 +0000 (11:01 -0400)]
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>
9 years agodrm/radeon/sumo: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 14:58:22 +0000 (10:58 -0400)]
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>
9 years agodrm/radeon/ci: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 14:54:05 +0000 (10:54 -0400)]
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>
9 years agodrm/radeon/si: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 14:50:07 +0000 (10:50 -0400)]
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>
9 years agodrm/radeon/ni: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 14:46:02 +0000 (10:46 -0400)]
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>
9 years agodrm/radeon: remove some rv7xx leftovers from btc dpm code
Alex Deucher [Tue, 30 Sep 2014 14:41:15 +0000 (10:41 -0400)]
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>
9 years agodrm/radeon/btc: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 14:39:30 +0000 (10:39 -0400)]
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>
9 years agodrm/radeon/rv7xx/eg: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 14:34:39 +0000 (10:34 -0400)]
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>
9 years agodrm/radeon/rv6xx: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 14:27:42 +0000 (10:27 -0400)]
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>
9 years agodrm/radeon/rs780: implement get_current_sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 14:19:57 +0000 (10:19 -0400)]
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>
9 years agodrm/radeon/dpm: add new callbacks to get the current sclk/mclk
Alex Deucher [Tue, 30 Sep 2014 14:12:17 +0000 (10:12 -0400)]
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>
9 years agodrm/radeon: add INFO query for GPU temperature
Alex Deucher [Tue, 30 Sep 2014 14:04:40 +0000 (10:04 -0400)]
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>
9 years agodrm/radeon: dont switch vt on suspend
Maarten Lankhorst [Tue, 13 Jan 2015 08:40:13 +0000 (09:40 +0100)]
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>
9 years agodrm/radeon: setup quantization_range in AVI infoframe
Alex Deucher [Mon, 23 Feb 2015 22:14:47 +0000 (17:14 -0500)]
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>
9 years agodrm/radeon: implement output csc property for DCE5+
Alex Deucher [Mon, 23 Feb 2015 15:59:36 +0000 (10:59 -0500)]
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>
9 years agodrm/radeon: add an output_csc property
Alex Deucher [Mon, 23 Feb 2015 15:11:49 +0000 (10:11 -0500)]
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>
9 years agodrm: sti: convert driver to atomic modeset
Benjamin Gaignard [Thu, 19 Mar 2015 12:35:16 +0000 (13:35 +0100)]
drm: sti: convert driver to atomic modeset

v1: This patch does the minimum to make sti driver use atomic helpers.
No big bang, only adapt some functions to new call order.

v2: Use dpms and page flip atomic helpers

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
9 years agodrm: adv7511: Refactor power management
Laurent Pinchart [Mon, 2 Mar 2015 12:38:52 +0000 (14:38 +0200)]
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>
9 years agodrm: adv7511: Fix nested sleep when reading EDID
Laurent Pinchart [Wed, 18 Feb 2015 13:19:33 +0000 (15:19 +0200)]
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
8eb23b9f35aae ("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>
9 years agodrm: adv7511: Fix DDC error interrupt handling
Laurent Pinchart [Wed, 18 Feb 2015 13:19:33 +0000 (15:19 +0200)]
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>
9 years agodrm: rcar-du: Enable the atomic updates API
Laurent Pinchart [Thu, 26 Feb 2015 19:22:10 +0000 (21:22 +0200)]
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>
9 years agodrm: rcar-du: Don't initialize event->pipe field
Laurent Pinchart [Thu, 5 Mar 2015 21:46:22 +0000 (23:46 +0200)]
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>
9 years agodrm: rcar-du: Fix framebuffer reference leak through plane state
Laurent Pinchart [Thu, 5 Mar 2015 17:41:04 +0000 (19:41 +0200)]
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>
9 years agoMAINTAINERS: Remove rcar-du.h entry
Joe Perches [Sun, 8 Mar 2015 19:15:56 +0000 (12:15 -0700)]
MAINTAINERS: Remove rcar-du.h entry

commit 2378ad1228d2 ("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>
9 years agoMerge branch 'drm_next' of https://github.com/markyzq/kernel-drm-rockchip into drm...
Dave Airlie [Thu, 19 Mar 2015 04:05:53 +0000 (14:05 +1000)]
Merge branch 'drm_next' of https://github.com/markyzq/kernel-drm-rockchip into drm-next

rockchip fixes.

* 'drm_next' of https://github.com/markyzq/kernel-drm-rockchip:
  drm/rockchip: vop: power off until vop standby take effect
  drm/rockchip: vop: set vop enabled after enable iommu
  drm/rockchip: vop use is_enabled instead of dpms mode
  drm/rockchip: vop: fix vop vsync/hsync polarity
  drm/rockchip: Only alloc a kmap for fbdev gem object

9 years agoMerge tag 'topic/drm-misc-2015-03-18' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Thu, 19 Mar 2015 04:03:39 +0000 (14:03 +1000)]
Merge tag 'topic/drm-misc-2015-03-18' of git://anongit.freedesktop.org/drm-intel into drm-next

Another drm-misch pull request. Mostly the fbdev sizes deconfusion series
from Rob, everything else is small stuff all over. And the large i2c over
aux transfers patch, too.

* tag 'topic/drm-misc-2015-03-18' of git://anongit.freedesktop.org/drm-intel:
  drm: check that planes types are correct while initializing CRTC
  drm: change connector to tmp_connector
  drm: Fix some typo mistake of the annotations
  drm: Silence sparse warnings
  drm: %pF is only for function pointers
  drm/fb: handle tiled connectors better
  drm/fb: small cleanup
  drm/rockchip: use correct fb width/height
  drm/exynos: use correct fb width/height
  drm/cma: use correct fb width/height
  drm/atomic: minor kerneldoc typo fix
  drm/fb: document drm_fb_helper_surface_size
  drm/dp: Use large transactions for I2C over AUX
  drm/plane-helper: Fixup mismerge
  drm/atomic: Constify a bunch of functions pointer structs

9 years agodrm/i915: Make sure the primary plane is enabled before reading out the fb state
Damien Lespiau [Thu, 5 Feb 2015 19:35:13 +0000 (19:35 +0000)]
drm/i915: Make sure the primary plane is enabled before reading out the fb state

We don't want to end up in a state where we track that the pipe has its
primary plane enabled when primary plane registers are programmed with
values that look possible but the plane actually disabled.

Refuse to read out the fb state when the primary plane isn't enabled.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Suggested-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reported-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Reference: http://mid.gmane.org/20150203191507.GA2374@crion86
Tested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agodrm/i915: Update DRIVER_DATE to 20150313
Daniel Vetter [Fri, 13 Mar 2015 21:15:40 +0000 (22:15 +0100)]
drm/i915: Update DRIVER_DATE to 20150313

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Fix vmap_batch page iterator overrun
Mika Kuoppala [Fri, 13 Mar 2015 13:21:53 +0000 (15:21 +0200)]
drm/i915: Fix vmap_batch page iterator overrun

vmap_batch() calculates amount of needed pages for the mapping
we are going to create. And it uses this page count as an
argument for the for_each_sg_pages() macro. The macro takes the number
of sg list entities as an argument, not the page count. So we ended
up iterating through all the pages on the mapped object, corrupting
memory past the smaller pages[] array.

Fix this by bailing out when we have enough pages.

This regression has been introduced in

commit 17cabf571e50677d980e9ab2a43c5f11213003ae
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jan 14 11:20:57 2015 +0000

    drm/i915: Trim the command parser allocations

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Export total subslice and EU counts
Jeff McGee [Mon, 9 Mar 2015 23:06:54 +0000 (16:06 -0700)]
drm/i915: Export total subslice and EU counts

Setup new I915_GETPARAM ioctl entries for subslice total and
EU total. Userspace drivers need these values when constructing
GPGPU commands. This kernel query method is intended to replace
the PCI ID-based tables that userspace drivers currently maintain.
The kernel driver can employ fuse register reads as needed to
ensure the most accurate determination of GT config attributes.
This first became important with Cherryview in which the config
could differ between devices with the same PCI ID.

The kernel detection of these values is device-specific and not
included in this patch. Because zero is not a valid value for any of
these parameters, a value of zero is interpreted as unknown for the
device. Userspace drivers should continue to maintain ID-based tables
for older devices not supported by the new query method.

v2: Increment our I915_GETPARAM indices to fit after REVISION
    which was merged ahead of us.

For: VIZ-4636
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Tested-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Acked-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: redefine WARN_ON_ONCE to include the condition
Jani Nikula [Thu, 12 Mar 2015 11:01:12 +0000 (13:01 +0200)]
drm/i915: redefine WARN_ON_ONCE to include the condition

Same as

commit c883ef1b1c998d2d66866772fd0fc34afa45641e
Author: Mika Kuoppala <miku@iki.fi>
Date:   Tue Oct 28 17:32:30 2014 +0200

    drm/i915: Redefine WARN_ON to include the condition

but for WARN_ON_ONCE. Since the kernel WARN_ON_ONCE actually picks up
*our* version of WARN_ON, we end up with messages like

[  838.285319] WARN_ON(!__warned)

which are not that helpful.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Implement WaDisableHBR2
Damien Lespiau [Wed, 11 Feb 2015 17:43:24 +0000 (17:43 +0000)]
drm/i915/skl: Implement WaDisableHBR2

v2: Use the recently introduced INTEL_REVID() and SKL_REVID defines
    (Nick Hoath)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89554
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Remove the preliminary_hw_support shackles from CHV
Ville Syrjälä [Wed, 11 Mar 2015 20:52:28 +0000 (22:52 +0200)]
drm/i915: Remove the preliminary_hw_support shackles from CHV

CHV should be in a good enough shape now, so let's drop the
.is_preliminary flag.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Read CHV_PLL_DW8 from the correct offset
Ville Syrjälä [Wed, 11 Mar 2015 20:52:08 +0000 (22:52 +0200)]
drm/i915: Read CHV_PLL_DW8 from the correct offset

We accidentally pass 'pipe' instead of 'port' to CHV_PLL_DW8() and
with PIPE_C we end up at register offset 0x8320 which isn't the
0x8020 we wanted. Fix it.

The problem was fortunately caught by the sanity check in vlv_dpio_read():
WARNING: CPU: 1 PID: 238 at ../drivers/gpu/drm/i915/intel_sideband.c:200 vlv_dpio_read+0x77/0x80 [i915]()
DPIO read pipe C reg 0x8320 == 0xffffffff

The problem got introduced with this commit:
 commit 71af07f91f12bbab96335e202c82525d31680960
 Author: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
 Date:   Thu Mar 5 19:33:08 2015 +0530

    drm/i915: Update prop, int co-eff and gain threshold for CHV

Cc: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Todd Previte <tprevite@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Rewrite IVB FDI bifurcation conflict checks
Ville Syrjälä [Wed, 11 Mar 2015 16:52:31 +0000 (18:52 +0200)]
drm/i915: Rewrite IVB FDI bifurcation conflict checks

Ignore the current state of the pipe and just check crtc_state->enable
and the number of FDI lanes required. This means we don't accidentally
mistake the FDI lanes as being available of one of the pipes just
happens to be disabled at the time of the check. Also we no longer
consider pipe C to require FDI lanes when it's driving the eDP
transcoder.

We also take the opportunity to make the code a bit nicer looking by
hiding the ugly bits in the new pipe_required_fdi_lanes() function.

Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Rewrite some some of the FDI lane checks
Ville Syrjälä [Wed, 11 Mar 2015 16:52:30 +0000 (18:52 +0200)]
drm/i915: Rewrite some some of the FDI lane checks

The logic in the FDI lane checks is very hard for my poor brain to
grasp. Rewrite it in a more straightforward way.

Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Enable the RPS interrupts programming
Akash Goel [Fri, 6 Mar 2015 05:37:24 +0000 (11:07 +0530)]
drm/i915/skl: Enable the RPS interrupts programming

Enable the RPS interrupts programming(enable/disable/reset) for GEN9,
as missing changes to enable the RPS support on GEN9 have been added.

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Enabling processing of Turbo interrupts
Akash Goel [Fri, 6 Mar 2015 05:37:23 +0000 (11:07 +0530)]
drm/i915/skl: Enabling processing of Turbo interrupts

Earlier Turbo interrupts were not being processed for SKL,
as something was amiss in turbo programming for SKL.
Now missing changes have been added, so enabling the Turbo
interrupt processing for SKL.

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Updated the i915_frequency_info debugfs function
Akash Goel [Fri, 6 Mar 2015 05:37:21 +0000 (11:07 +0530)]
drm/i915/skl: Updated the i915_frequency_info debugfs function

Added support for SKL in the i915_frequency_info debugfs function

v2:
- corrected the handling of reqf (Damien)
- Reorderd the platform check for cagf (Ville)

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Simplify the way BC bifurcation state consistency is kept
Ander Conselvan de Oliveira [Wed, 11 Mar 2015 11:35:43 +0000 (13:35 +0200)]
drm/i915: Simplify the way BC bifurcation state consistency is kept

Remove the global modeset resource function that would disable the
bifurcation bit, and instead enable/disable it when enabling the pch
transcoder. The mode set consistency check should prevent us from
disabling the bit if pipe C is enabled so the change should be safe.

Note that this doens't affect the logic that prevents the bit being
set while a pipe is active, since the patch retains the behavior of
only chaging the bit if necessary. Because of the checks during mode
set, the first change would necessarily happen with both pipes B and
C disabled, and any subsequent write would be skipped.

v2: Only change the bit during pch trancoder enable. (Ville)

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Updated the act_freq_mhz_show sysfs function
Akash Goel [Fri, 6 Mar 2015 05:37:22 +0000 (11:07 +0530)]
drm/i915/skl: Updated the act_freq_mhz_show sysfs function

Added support for SKL in the act_freq_mhz_show sysfs function

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Updated the gen9_enable_rps function
Akash Goel [Fri, 6 Mar 2015 05:37:20 +0000 (11:07 +0530)]
drm/i915/skl: Updated the gen9_enable_rps function

On SKL, GT frequency is programmed in units of 16.66 MHZ units compared
to 50 MHZ for older platforms. Also the time value specified for Up/Down EI &
Up/Down thresholds are expressed in units of 1.33 us, compared to 1.28
us for older platforms. So updated the gen9_enable_rps function as per that.

v2: Updated to use new macro GT_INTERVAL_FROM_US

v3: Removed the initial setup of certain registers, from gen9_enable_rps,
    which gets overridden later from gen6_set_rps (Damien)

v4: Removed the enabling of rps interrupts, from gen9_enable_rps.
    To be done from intel_gen6_powersave_work only, as done for other
    platforms also.

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Updated the gen6_rps_limits function
Akash Goel [Fri, 6 Mar 2015 05:37:19 +0000 (11:07 +0530)]
drm/i915/skl: Updated the gen6_rps_limits function

RP Interrupt Up/Down Frequency Limits register (A014) definition
has changed for SKL. Updated the gen6_rps_limits function as per that

v2: Renamed the function to intel_rps_limits (Chris)

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Restructured the gen6_set_rps_thresholds function
Akash Goel [Fri, 6 Mar 2015 05:37:18 +0000 (11:07 +0530)]
drm/i915/skl: Restructured the gen6_set_rps_thresholds function

Prior to SKL, the time period programmed in Up/Down EI & Up/Down
threshold registers was in units of 1.28 micro seconds. But for
SKL, the units have changed (1.333 micro seconds).
Have generalized the implementation of gen6_set_rps_thresholds function,
by removing the hard coding done in it as per 1.28 micro seconds.

v2: Renamed the local variables & removed superfluous comments (Chris)

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Updated the gen6_set_rps function
Akash Goel [Fri, 6 Mar 2015 05:37:17 +0000 (11:07 +0530)]
drm/i915/skl: Updated the gen6_set_rps function

On SKL, the frequency is programmed differently in RPNSWREQ (A008)
register (from bits 23 to 31, compared to bits 24 to 31). So updated
the gen6_set_rps function, as per this change.

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Updated the gen6_init_rps_frequencies function
Akash Goel [Fri, 6 Mar 2015 05:37:16 +0000 (11:07 +0530)]
drm/i915/skl: Updated the gen6_init_rps_frequencies function

On SKL the frequency is specified in units of 16.66 MHZ, barring the
RP_STATE_CAP(0x5998) register, which still reports frequency in units
of 50 MHZ. So an extra conversion is required in gen6_init_rps_frequencies
function for SKL, to store the frequency values as per the actual hardware unit.

v2: Corrected the conversion from 50 to 16.66 MHZ (Ville)

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Updated intel_gpu_freq() and intel_freq_opcode()
Akash Goel [Fri, 6 Mar 2015 05:37:15 +0000 (11:07 +0530)]
drm/i915/skl: Updated intel_gpu_freq() and intel_freq_opcode()

On SKL, frequency is specified in units of 16.66 MHZ.
Updated the intel_gpu_freq() and intel_freq_opecode() functions
to do the conversion appropriately.

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915/skl: Added new macros
Akash Goel [Fri, 6 Mar 2015 05:37:14 +0000 (11:07 +0530)]
drm/i915/skl: Added new macros

For SKL, register definition for RPNSWREQ (A008), RPSTAT1(A01C)
have changed slightly. Also on SKL, frequency is specified in
units of 16.66 MHZ, compared to 50 MHZ for most of the earlier
platforms and the time values are expressed in units of 1.33 us,
compared to 1.28 us for earlier platforms.
Added new macros for the aforementioned changes.

v2: Renamed the GT_FREQ_FROM_PERIOD macro to GT_INTERVAL_FROM_US (Damien)

v3: Removed the implicit use of dev_priv in GT_INTERVAL_FROM_US macro (Chris)

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: remove indirection in the PCI ID macros
Jani Nikula [Tue, 3 Feb 2015 12:34:05 +0000 (14:34 +0200)]
drm/i915: remove indirection in the PCI ID macros

Spell all the PCI IDs out to be able to quickly grep for the IDs. No
functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
[danvet: Add GT1/2 to comments to not loose that distinction.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Use FW_WM() macro for older gmch platforms too
Ville Syrjälä [Tue, 10 Mar 2015 15:02:21 +0000 (17:02 +0200)]
drm/i915: Use FW_WM() macro for older gmch platforms too

Use the FW_WM() macro from the VLV wm code to polish up the wm
code for older gmch platforms.

Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Add polish to VLV WM shift+mask operations
Ville Syrjälä [Tue, 10 Mar 2015 14:16:28 +0000 (16:16 +0200)]
drm/i915: Add polish to VLV WM shift+mask operations

Wrap the FW register value shift+mask operations into a macro to hide
the ugliness a bit. Also might avoid bugs due to typos.

Also rename all the primary/sprite plane low order bit masks to have the
_VLV suffix, so that we can use the FW_WM_VLV() macro instead of the
FW_WM() macro for them in a consistent manner. Cursor and all the high
order bits are left to use the FW_WM() macro as there's no real
confusion with them.

Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Use plane->state->fb instead of plane->fb in intel_plane_restore()
Ville Syrjälä [Tue, 10 Mar 2015 11:15:23 +0000 (13:15 +0200)]
drm/i915: Use plane->state->fb instead of plane->fb in intel_plane_restore()

plane->fb is not as reliable as plane->state->fb so let's convert
intel_plane_restore() over the the new way of thinking as well.

Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Reduce clutter by using the local plane pointer
Ville Syrjälä [Tue, 10 Mar 2015 11:15:22 +0000 (13:15 +0200)]
drm/i915: Reduce clutter by using the local plane pointer

No need to go dig throguh intel_crtc->base.cursor when we already have
the same thing as 'plane' local variable.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Remove debug prints from primary plane update funcs
Ville Syrjälä [Tue, 10 Mar 2015 11:15:21 +0000 (13:15 +0200)]
drm/i915: Remove debug prints from primary plane update funcs

These are now called from the plane commit hooks, so they really need to
be fast or else we risk atomic update failures. So kill the debug prints
which are slowing things down massively.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Add ULL postfix to VGT_MAGIC constant
Daniel Vetter [Wed, 11 Mar 2015 07:27:25 +0000 (08:27 +0100)]
drm/i915: Add ULL postfix to VGT_MAGIC constant

Without this Dave's 32bit rhel compiler is annoyed. Don't ask me about
the exact rules for this stuff though, but this should be safe.

Reported-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
9 years agodrm/fourcc: 64 #defines need ULL postfix
Daniel Vetter [Wed, 11 Mar 2015 07:26:23 +0000 (08:26 +0100)]
drm/fourcc: 64 #defines need ULL postfix

I have no idea about the exact rules, but this angered Dave's 32bit
rhel gcc.

Reported-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
9 years agodrm/i915: Don't assume primary & cursor are always on for wm calculation (v4)
Matt Roper [Mon, 9 Mar 2015 18:06:02 +0000 (11:06 -0700)]
drm/i915: Don't assume primary & cursor are always on for wm calculation (v4)

Current ILK-style watermark code assumes the primary plane and cursor
plane are always enabled.  This assumption, along with the combination
of two independent commits that got merged at the same time, results in
a NULL dereference.  The offending commits are:

        commit fd2d61341bf39d1054256c07d6eddd624ebc4241
        Author: Matt Roper <matthew.d.roper@intel.com>
        Date:   Fri Feb 27 10:12:01 2015 -0800

            drm/i915: Use plane->state->fb in watermark code (v2)

and

        commit 0fda65680e92545caea5be7805a7f0a617fb6c20
        Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
        Date:   Fri Feb 27 15:12:35 2015 +0000

            drm/i915/skl: Update watermarks for Y tiling

The first commit causes us to use the FB from plane->state->fb rather
than the legacy plane->fb, which is updated a bit later in the process.

The second commit includes a change that now triggers watermark
reprogramming on primary plane enable/disable where we didn't have one
before (which wasn't really correct, but we had been getting lucky
because we always calculated as if the primary plane was on).

Together, these two commits cause the watermark calculation to
(properly) see plane->state->fb = NULL when we're in the process of
disabling the primary plane.  However the existing watermark code
assumes there's always a primary fb and tries to dereference it to find
out pixel format / bpp information.

The fix is to make ILK-style watermark calculation actually check the
true status of primary & cursor planes and adjust our watermark logic
accordingly.

v2: Update unchecked uses of state->fb for other platforms (pnv, skl,
    etc.).  Note that this is just a temporary fix.  Ultimately the
    useful information is going to be computed at check time and stored
    right in the state structures so that we don't have to figure this
    all out while we're supposed to be programming the watermarks.
    (caught by Tvrtko)

v3: Fix a couple copy/paste mistakes in SKL code. (Tvrtko)

v4: Only add FB checks for ILK/SKL codepaths.  Older platforms still use
    intel_crtc_active() and will shortcircuit out of watermark
    calculations before ever trying to dereference the primary plane's
    framebuffer.

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reported-by: Michael Leuchtenburg <michael@slashhome.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89388
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Move drm_framebuffer_unreference out of struct_mutex for flips
Chris Wilson [Mon, 16 Feb 2015 14:31:49 +0000 (14:31 +0000)]
drm/i915: Move drm_framebuffer_unreference out of struct_mutex for flips

intel_user_framebuffer_destroy() requires the struct_mutex for its
object bookkeeping, so this means that all calls to
drm_framebuffer_unreference must not hold that lock.

Regression from commit ab8d66752a9c28cd6c94fa173feacdfc1554aa03
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Mon Feb 2 15:44:15 2015 +0000

    drm/i915: Track old framebuffer instead of object

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89166
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
[danvet: Clarify commit message slightly.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Disable DDR DVFS on CHV
Ville Syrjälä [Thu, 5 Mar 2015 19:19:52 +0000 (21:19 +0200)]
drm/i915: Disable DDR DVFS on CHV

DDR DVFS introduces massive memory latencies which can't be handled by
the PND deadline stuff. Instead the watermarks will need to be
programmed to compensate for the latency and the deadlines will need to
be programmed to tight fixed values. That means DDR DVFS can only be
enabled if the display FIFOs are large enough, and that pretty much
means we have to manually repartition them to suit the needs of the
moment.

That's a lot of change, so in the meantime let's just disable DDR DVFS
to get the display(s) to be stable.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Enable the maxfifo PM5 mode when appropriate on CHV
Ville Syrjälä [Thu, 5 Mar 2015 19:19:51 +0000 (21:19 +0200)]
drm/i915: Enable the maxfifo PM5 mode when appropriate on CHV

CHV has a new knob in Punit to select between some memory power savings
modes PM2 and PM5. We can allow the deeper PM5 when maxfifo mode is
enabled, so let's do so in the hopes for moar power savings.

v2: Put the thing into a separate function to avoid churn later
v3: Don't break VLV

Reviewed-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Program PFI credits for VLV
Vidya Srinivas [Thu, 5 Mar 2015 19:19:50 +0000 (21:19 +0200)]
drm/i915: Program PFI credits for VLV

PFI credit programming is required when CD clock (related to data flow from
display pipeline to end display) is greater than CZ clock (related to data
flow from memory to display plane). This programming should be done when all
planes are OFF to avoid intermittent hangs while accessing memory even from
different Gfx units (not just display).

If cdclk/czclk >=1, PFI credits could be set as any number. To get better
performance, larger PFI credit can be assigned to PND. Otherwise if
cdclk/czclk<1, the default PFI credit of 8 should be set.

v2:
    - Change log to lower log level instead of DRM_ERROR
    - Change function name to valleyview_program_pfi_credits
    - Move program PFI credits to modeset_init instead of intel_set_mode
    - Change magic numbers to logical constants

[vsyrjala v3:
 - only program in response to cdclk update
 - program the credits also when cdclk<czclk
 - add CHV bits
 v4:
 - Change CHV cdclk<czclk credits to 12 (Vijay)]

Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
Signed-off-by: Gajanan Bhat <gajanan.bhat@intel.com>
Signed-off-by: Vandana Kannan <vandana.kannan@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Rewrite VLV/CHV watermark code
Ville Syrjälä [Thu, 5 Mar 2015 19:19:49 +0000 (21:19 +0200)]
drm/i915: Rewrite VLV/CHV watermark code

Assuming the PND deadline mechanism works reasonably we should do
memory requests as early as possible so that PND has schedule the
requests more intelligently. Currently we're still calculating
the watermarks as if VLV/CHV are identical to g4x, which isn't
the case.

The current code also seems to calculate insufficient watermarks
and hence we're seeing some underruns, especially on high resolution
displays.

To fix it just rip out the current code and replace is with something
that tries to utilize PND as efficiently as possible.

We now calculate the WM watermark to trigger when the FIFO still has
256us worth of data. 256us is the maximum deadline value supoorted by
PND, so issuing memory requests earlier would mean we probably couldn't
utilize the full FIFO as PND would attempt to return the data at
least in at least 256us. We also clamp the watermark to at least 8
cachelines as that's the magic watermark that enabling trickle feed
would also impose. I'm assuming it matches some burst size.

In theory we could just enable trickle feed and ignore the WM values,
except trickle feed doesn't work with max fifo mode anyway, so we'd
still need to calculate the SR watermarks. It seems cleaner to just
disable trickle feed and calculate all watermarks the same way. Also
trickle feed wouldn't account for the 256us max deadline value, thoguh
that may be a moot point in non-max fifo mode sicne the FIFOs are fairly
small.

On VLV max fifo mode can be used with either primary or sprite planes.
So the code now also checks all the planes (apart from the cursor)
when calculating the SR plane watermark.

We don't have to worry about the WM1 watermarks since we're using the
PND deadline scheme which means the hardware ignores WM1 values.

v2: Use plane->state->fb instead of plane->fb

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Make sure we invalidate frontbuffer on fbcon.
Rodrigo Vivi [Tue, 10 Mar 2015 00:57:07 +0000 (17:57 -0700)]
drm/i915: Make sure we invalidate frontbuffer on fbcon.

There are some cases like suspend/resume or dpms off/on sequences
that can flush frontbuffer bits. In these cases features that relies
on frontbuffer tracking can start working and user can stop getting
screen updates on fbcon having impression the system is frozen.

So, let's make sure we also invalidate frontbuffer on fbdev blank.

v2: Daniel was right, backtrace didn't show other path than this blank
one so let's make sure frontbuffer bits gets invalidate here instead of
on random write operations that doesn't garantee we track all frontbuffer
writes.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
[danvet: Exchange code comments for one that complains about the
locking, like in set_par.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/i915: Update prop, int co-eff and gain threshold for CHV
Vijay Purushothaman [Thu, 5 Mar 2015 14:03:08 +0000 (19:33 +0530)]
drm/i915: Update prop, int co-eff and gain threshold for CHV

This patch implements latest PHY changes in Gain, prop and int co-efficients
based on the vco freq.

v2: Split the original changes into multiple smaller patches based on
review by Ville

v3: Addressed Ville's review comments. Fixed the error introduced in v2.
Clear the old bits before we modify those bits as part of RMW.

v4: TDC target cnt is 10 bits and not 8 bits (Ville)

Signed-off-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>