]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
7 years agodrm/sun4i: dotclock: Fix clock rate read back calcation
Chen-Yu Tsai [Thu, 15 Sep 2016 15:14:00 +0000 (23:14 +0800)]
drm/sun4i: dotclock: Fix clock rate read back calcation

When reading back the divider set in the register, we mask off the
bits that aren't part of the divider. Unfortunately the mask used
here was not converted from the field width.

Fix this by converting the field width to a proper bit mask.

Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agodrm/sun4i: backend: remove redundant dev_err call in sun4i_backend_bind()
Wei Yongjun [Thu, 15 Sep 2016 03:25:58 +0000 (03:25 +0000)]
drm/sun4i: backend: remove redundant dev_err call in sun4i_backend_bind()

There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agodrm/ttm: remove cpu_address member from ttm_tt
Alexandre Courbot [Fri, 16 Sep 2016 09:32:26 +0000 (18:32 +0900)]
drm/ttm: remove cpu_address member from ttm_tt

Patch 3d50d4dcb0 exposed the CPU address of DMA-allocated pages as
returned by dma_alloc_coherent because Nouveau on Tegra needed it.

This is not required anymore - as there were no other users for it,
remove it and save some memory for everyone.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/radeon/radeon_device: remove unused function
Baoyou Xie [Thu, 15 Sep 2016 14:13:51 +0000 (22:13 +0800)]
drm/radeon/radeon_device: remove unused function

We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/radeon/radeon_device.c:1961:5: warning: no previous prototype for 'radeon_debugfs_init' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_device.c:1966:6: warning: no previous prototype for 'radeon_debugfs_cleanup' [-Wmissing-prototypes]

In fact, these functions are dummy, but can be removed,
so this patch removes them.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: clean function declarations in amdgpu_ttm.c up
Baoyou Xie [Thu, 15 Sep 2016 13:43:26 +0000 (21:43 +0800)]
drm/amdgpu: clean function declarations in amdgpu_ttm.c up

We get 2 warnings when building kernel with W=1:

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:985:5: warning: no previous prototype for 'amdgpu_ttm_init' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1092:6: warning: no previous prototype for 'amdgpu_ttm_fini' [-Wmissing-prototypes]

In fact, both functions are declared in
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c, but should be declared in
a header file, thus can be recognized in other file.

So this patch moves the declarations into
drivers/gpu/drm/amd/amdgpu/amdgpu.h.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: use the new ring ib and dma frame size callbacks (v2)
Alex Deucher [Fri, 16 Sep 2016 15:02:34 +0000 (11:02 -0400)]
drm/amdgpu: use the new ring ib and dma frame size callbacks (v2)

Use them to more accurately determine the ring size required
for ib submission.

v2: drop extra alignment

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/vce3: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 15:02:16 +0000 (11:02 -0400)]
drm/amdgpu/vce3: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/vce2: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 15:01:52 +0000 (11:01 -0400)]
drm/amdgpu/vce2: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/vce: add common ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 15:01:26 +0000 (11:01 -0400)]
drm/amdgpu/vce: add common ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/uvd6: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 15:00:58 +0000 (11:00 -0400)]
drm/amdgpu/uvd6: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/uvd5: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 15:00:42 +0000 (11:00 -0400)]
drm/amdgpu/uvd5: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/uvd4.2: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 15:00:11 +0000 (11:00 -0400)]
drm/amdgpu/uvd4.2: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/sdma3: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 14:59:31 +0000 (10:59 -0400)]
drm/amdgpu/sdma3: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/sdma2.4: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 14:59:12 +0000 (10:59 -0400)]
drm/amdgpu/sdma2.4: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/cik_sdma: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 14:58:52 +0000 (10:58 -0400)]
drm/amdgpu/cik_sdma: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/si_dma: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 14:58:12 +0000 (10:58 -0400)]
drm/amdgpu/si_dma: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 14:57:39 +0000 (10:57 -0400)]
drm/amdgpu/gfx8: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx7: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 14:57:20 +0000 (10:57 -0400)]
drm/amdgpu/gfx7: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx6: add ring callbacks for ib and dma frame size
Alex Deucher [Fri, 16 Sep 2016 14:56:33 +0000 (10:56 -0400)]
drm/amdgpu/gfx6: add ring callbacks for ib and dma frame size

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/ring: add an interface to get dma frame and ib size
Alex Deucher [Fri, 16 Sep 2016 14:55:50 +0000 (10:55 -0400)]
drm/amdgpu/ring: add an interface to get dma frame and ib size

Used to properly calculate space on the ring for ib submissions.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/sdma3: drop unused functions
Alex Deucher [Thu, 15 Sep 2016 20:30:01 +0000 (16:30 -0400)]
drm/amdgpu/sdma3: drop unused functions

These are not used yet.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx6: drop gds_switch callback
Alex Deucher [Thu, 15 Sep 2016 19:42:09 +0000 (15:42 -0400)]
drm/amdgpu/gfx6: drop gds_switch callback

GDS works differently on GFX6, plus the callback was
empty.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx6: add ring_emit_cntxcntl
Alex Deucher [Thu, 15 Sep 2016 19:40:06 +0000 (15:40 -0400)]
drm/amdgpu/gfx6: add ring_emit_cntxcntl

Missing for gfx6.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx6: drop duplicate code
Alex Deucher [Thu, 15 Sep 2016 19:28:46 +0000 (15:28 -0400)]
drm/amdgpu/gfx6: drop duplicate code

The compute functions just called the gfx functions, drop
the wrapper.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/si: fix ring size for compute
Alex Deucher [Thu, 15 Sep 2016 16:04:45 +0000 (12:04 -0400)]
drm/amdgpu/si: fix ring size for compute

We switched the other asics, but missed this.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: Partially revert change initialize platform caps
Rex Zhu [Wed, 14 Sep 2016 08:28:01 +0000 (16:28 +0800)]
drm/amd/powerplay: Partially revert change initialize platform caps

partially revert commit I36f3c9e3a28cbf290652edfb6e19109da660c4f1
this will lead APU can't work.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: not set cg for vce/uvd in late init.
Rex Zhu [Tue, 13 Sep 2016 11:38:38 +0000 (19:38 +0800)]
drm/amdgpu: not set cg for vce/uvd in late init.

no need to set cg for uvd/vce in late init.
As when ring test, uvd/vce's dpm will be enabled/disabled.
the cg will be set.

fix issue suspend when play video or encode, then resume back,
the clock will be bypassed on Polaris/Fiji.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: add pptable point check before use it
Rex Zhu [Thu, 25 Aug 2016 12:00:28 +0000 (20:00 +0800)]
drm/amd/powerplay: add pptable point check before use it

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: add pp_table_version in hwmgr.
Rex Zhu [Wed, 24 Aug 2016 03:28:41 +0000 (11:28 +0800)]
drm/amd/powerplay: add pp_table_version in hwmgr.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: rename tonga_processpptable* to processpptable_v1_0*.
Rex Zhu [Fri, 19 Aug 2016 12:52:09 +0000 (20:52 +0800)]
drm/amd/powerplay: rename tonga_processpptable* to processpptable_v1_0*.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/vi: Use correct external_rev_id for stoney
Jordan Lazare [Thu, 1 Sep 2016 17:49:33 +0000 (13:49 -0400)]
drm/amdgpu/vi: Use correct external_rev_id for stoney

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm: Fix DisplayPort branch device ID kernel-doc
Mika Kahola [Fri, 16 Sep 2016 10:39:15 +0000 (13:39 +0300)]
drm: Fix DisplayPort branch device ID kernel-doc

Fix missing parameter description for DisplayPort branch device ID.
This fixes warning of "No description found for parameter 'id[6]'" when
creating documentation by 'make htmldocs'.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
References: https://lists.freedesktop.org/archives/intel-gfx/2016-September/106645.html
Fixes: 266d783baaf5 ("drm: Read DP branch device id")
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1474022355-29990-1-git-send-email-mika.kahola@intel.com
7 years agodrm/i915: use NULL for NULL pointers
Jani Nikula [Thu, 15 Sep 2016 13:28:55 +0000 (16:28 +0300)]
drm/i915: use NULL for NULL pointers

Fix sparse warning:

drivers/gpu/drm/i915/i915_cmd_parser.c:987:72: warning: Using plain
integer as NULL pointer

Fixes: 52a42cec4b70 ("drm/i915/cmdparser: Accelerate copies from WC memory")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473946137-1931-4-git-send-email-jani.nikula@intel.com
7 years agodrm/i915: do not use 'false' as a NULL pointer
Jani Nikula [Thu, 15 Sep 2016 13:28:53 +0000 (16:28 +0300)]
drm/i915: do not use 'false' as a NULL pointer

Fixes sparse warning:

drivers/gpu/drm/i915/intel_dpll_mgr.c:1712:24: warning: Using plain
integer as NULL pointer

Fixes: a277ca7dc01d ("drm/i915: Split bxt_ddi_pll_select()")
Cc: Manasi Navare <manasi.d.navare@intel.com>
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473946137-1931-2-git-send-email-jani.nikula@intel.com
7 years agodrm/i915: make intel_dp_compute_bpp static
Jani Nikula [Thu, 15 Sep 2016 13:28:52 +0000 (16:28 +0300)]
drm/i915: make intel_dp_compute_bpp static

Fix sparse warning:

drivers/gpu/drm/i915/intel_dp.c:1527:5: warning: symbol
'intel_dp_compute_bpp' was not declared. Should it be static?

Fixes: f9bb705e65f6 ("drm/i915: Update bits per component for display info")
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Jim Bride <jim.bride@linux.intel.com>
Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473946137-1931-1-git-send-email-jani.nikula@intel.com
7 years agodrm/msm: submit support for out-fences
Rob Clark [Thu, 16 Jun 2016 20:43:49 +0000 (16:43 -0400)]
drm/msm: submit support for out-fences

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm/msm: move fence allocation out of msm_gpu_submit()
Rob Clark [Thu, 16 Jun 2016 20:37:38 +0000 (16:37 -0400)]
drm/msm: move fence allocation out of msm_gpu_submit()

Prep work for next patch.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm/msm: submit support for in-fences
Rob Clark [Thu, 16 Jun 2016 20:08:19 +0000 (16:08 -0400)]
drm/msm: submit support for in-fences

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm/msm: extend the submit ioctl to pass in flags
Rob Clark [Sat, 23 Apr 2016 14:08:59 +0000 (10:08 -0400)]
drm/msm: extend the submit ioctl to pass in flags

We'll want to be able to pass in flags, such as asking for explicit
fencing, and possibly other things down the road.  Fortunately we
don't need a full 32b for the pipe-id.  So use the upper 16 bits
for flags (which could be extended or reduced later if needed, so
start adding flags from the high bits).

Since anything with the upper bits set would not be a valid pipe-id,
an old userspace would not set any of the upper bits, and an old
kernel would reject it as an invalid pipe-id.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm/msm/mdp5: Set rotation property initial value to DRM_ROTATE_0 insted of 0
Ville Syrjälä [Fri, 22 Jul 2016 13:43:09 +0000 (16:43 +0300)]
drm/msm/mdp5: Set rotation property initial value to DRM_ROTATE_0 insted of 0

0 isn't a valid rotation property value, so let's set the initial value
of the property to DRM_ROTATE_0 instead.

In the same vein, we must always have at leat one angle as part of set
of supported rotation bits, so let's include DRM_ROTATE_0 in there.

Cc: Rob Clark <robdclark@gmail.com>
Cc: Jilai Wang <jilaiw@codeaurora.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm/msm/hdmi: don't print error when adding i2c adapter fails
Wolfram Sang [Tue, 9 Aug 2016 11:30:29 +0000 (13:30 +0200)]
drm/msm/hdmi: don't print error when adding i2c adapter fails

The core will do this for us now.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm/msm/mdp4: mark symbols static where possible
Baoyou Xie [Wed, 7 Sep 2016 10:58:44 +0000 (18:58 +0800)]
drm/msm/mdp4: mark symbols static where possible

We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c:96:23: warning: no previous prototype for 'get_connector' [-Wmissing-prototypes]
drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c:84:5: warning: no previous prototype for 'mdp4_plane_set_property' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm/msm: Remove call to reservation_object_test_signaled_rcu before wait
Chris Wilson [Mon, 29 Aug 2016 07:08:26 +0000 (08:08 +0100)]
drm/msm: Remove call to reservation_object_test_signaled_rcu before wait

Since fence_wait_timeout_reservation_object_wait_timeout_rcu() with a
timeout of 0 becomes reservation_object_test_signaled_rcu(), we do not
need to handle such conversion in the caller. The only challenge are
those callers that wish to differentiate the error code between the
nonblocking busy check and potentially blocking wait.

v2: 9 is only 0 in German.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm/msm/hdmi: Clean up HDMI gpio DT bindings
Archit Taneja [Tue, 13 Sep 2016 15:21:35 +0000 (20:51 +0530)]
drm/msm/hdmi: Clean up HDMI gpio DT bindings

Make the following changes in the HDMI gpio bindings:

- Use "-gpios" as the suffix for all the gpio names
- Move all the gpios to optional, since there are platforms that use none
  of them.
- The HPD gpio is a standard one, remove the "qcom,hdmi-tx-" prefix from
  it.
- Remove the HDMI DDC clk/data gpios. They are just leftovers of an old
  way to configure pinctrl properties.
- Add a missing lpm gpio used on some platforms.

Make the necessary changes in the driver to incorporate these changes.

There hasn't been any upstream DT that uses the HDMI bindings, so it's
okay to change and move around these properties.

Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm/msm/mdp4: Fix issue with LCDC/LVDS port parsing
Archit Taneja [Tue, 13 Sep 2016 15:21:34 +0000 (20:51 +0530)]
drm/msm/mdp4: Fix issue with LCDC/LVDS port parsing

The LVDS port is the first in the list of the output ports in MDP4.
The driver assumed that if the port and its corresponding endpoint
is defined, then there should be a panel node too. This isn't
necessary since boards may not really use a LVDS panel. Don't fail
if there isn't a panel node available.

While we're at it, use of_graph_get_endpoint_by_regs instead of
of_graph_get_next_endpoint to make it more explicit that the LVDS
output is at port 0.

Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agodrm: Only use compat ioctl for addfb2 on X86/IA64
Kristian H. Kristensen [Tue, 13 Sep 2016 21:20:45 +0000 (14:20 -0700)]
drm: Only use compat ioctl for addfb2 on X86/IA64

Similar to struct drm_update_draw, struct drm_mode_fb_cmd2 has an
unaligned 64 bit field (modifier). This get packed differently between
32 bit and 64 bit modes on architectures that can handle unaligned 64
bit access (X86 and IA64).  Other architectures pack the structs the
same and don't need the compat wrapper. Use the same condition for
drm_mode_fb_cmd2 as we use for drm_update_draw.

Note that only the modifier will be packed differently between compat
and non-compat versions.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
[seanpaul added not at bottom of commit msg re: modifier]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1473801645-116011-1-git-send-email-hoegsberg@chromium.org
7 years agodrm/qxl: squash lines for simple wrapper functions
Masahiro Yamada [Wed, 14 Sep 2016 14:39:11 +0000 (23:39 +0900)]
drm/qxl: squash lines for simple wrapper functions

Remove unneeded variables and assignments.

Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1473863952-7658-5-git-send-email-yamada.masahiro@socionext.com
7 years agodrm/bridge: analogix_dp: squash lines for simple wrapper functions
Masahiro Yamada [Wed, 14 Sep 2016 14:39:10 +0000 (23:39 +0900)]
drm/bridge: analogix_dp: squash lines for simple wrapper functions

Remove unneeded variables and assignments.

Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[seanpaul added analogix prefix to subject]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1473863952-7658-4-git-send-email-yamada.masahiro@socionext.com
7 years agodrm/radeon: squash lines for simple wrapper functions
Masahiro Yamada [Wed, 14 Sep 2016 14:39:09 +0000 (23:39 +0900)]
drm/radeon: squash lines for simple wrapper functions

Remove unneeded variables and assignments.

Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1473863952-7658-3-git-send-email-yamada.masahiro@socionext.com
7 years agodrm/amdgpu: squash lines for simple wrapper functions
Masahiro Yamada [Wed, 14 Sep 2016 14:39:08 +0000 (23:39 +0900)]
drm/amdgpu: squash lines for simple wrapper functions

Remove unneeded variables and assignments.

Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1473863952-7658-2-git-send-email-yamada.masahiro@socionext.com
7 years agodrm/etnaviv: mark whole context as lost in recover worker
Lucas Stach [Thu, 15 Sep 2016 10:57:32 +0000 (12:57 +0200)]
drm/etnaviv: mark whole context as lost in recover worker

If we reset the GPU to get it back into a usable state we lose
all context, not just the MMU one. Mark the whole context as
lost to trigger a restore of the exec and MMU state.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: record correct cmdbuf IOVA in dump
Lucas Stach [Thu, 15 Sep 2016 10:40:11 +0000 (12:40 +0200)]
drm/etnaviv: record correct cmdbuf IOVA in dump

For cmdbufs the CPU IOVA was recorded instead of the GPU one.
Fix this to make it consistent with other BOs and to make
reading the dumps easier.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: space out IOVA layout for cmdbufs on MMUv2
Lucas Stach [Thu, 15 Sep 2016 11:06:43 +0000 (13:06 +0200)]
drm/etnaviv: space out IOVA layout for cmdbufs on MMUv2

At least on the GC3000 the FE MMU is not properly flushing stale TLB
entries. Make sure to map the cmdbufs with a big enough spacing in
the IOVAs to not hit old/prefetched TLB entries when jumping to a
newly mapped cmdbuf.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: fix up model and revision for GC2000+
Lucas Stach [Mon, 15 Aug 2016 16:16:59 +0000 (18:16 +0200)]
drm/etnaviv: fix up model and revision for GC2000+

GC2000+ on the i.MX6QP is just a re-branded GC3000, lets call it by
its real name to avoid confusion in other parts of the driver.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: implement IOMMUv2 translation
Lucas Stach [Fri, 19 Aug 2016 22:16:58 +0000 (00:16 +0200)]
drm/etnaviv: implement IOMMUv2 translation

All other parts are now in place, so implement the actual translation
step and hook it up, so the driver claims support for cores with
the new MMU.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: handle MMU exception in IRQ handler
Lucas Stach [Fri, 19 Aug 2016 22:14:43 +0000 (00:14 +0200)]
drm/etnaviv: handle MMU exception in IRQ handler

Bit 30 of the interrupt status signals an MMU exception. Handle this
condition properly and dump some useful registers.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: add flushing logic for MMUv2
Lucas Stach [Fri, 19 Aug 2016 22:01:24 +0000 (00:01 +0200)]
drm/etnaviv: add flushing logic for MMUv2

Flushing works differently on MMUv2, in that it's only necessary
to set a single bit in the control register to flush all translation
units. A semaphore stall then makes sure that the flush has propagated
properly.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: add function to construct MMUv2 init buffer
Lucas Stach [Fri, 19 Aug 2016 21:53:59 +0000 (23:53 +0200)]
drm/etnaviv: add function to construct MMUv2 init buffer

Both the safe/scratch address and the master TLB address are per pipe
with the CPU mapped registers not properly propagating to the
different translation units.

The only way to correctly configure all translation units is to have
a command stream snipped executed by the FE, before any other execution
can start.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: map cmdbuf through MMU on version 2
Lucas Stach [Fri, 19 Aug 2016 21:49:10 +0000 (23:49 +0200)]
drm/etnaviv: map cmdbuf through MMU on version 2

With MMUv2 all buffers need to be mapped through the MMU once it
is enabled. Align the buffer size to 4K, as the MMU is only able to
map page aligned buffers.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: split out iova search and MMU reaping logic
Lucas Stach [Fri, 19 Aug 2016 21:43:40 +0000 (23:43 +0200)]
drm/etnaviv: split out iova search and MMU reaping logic

With MMUv2 the command buffers need to be mapped through the MMU.
Split out the iova search and MMU reaping logic so it can be reused
for the cmdbuf mapping, where no GEM object is involved.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: split out FE start
Lucas Stach [Wed, 17 Aug 2016 13:27:52 +0000 (15:27 +0200)]
drm/etnaviv: split out FE start

Split out into a new externally visible function, as the IOMMUv2
code needs this functionality, too.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: split out wait for gpu idle
Lucas Stach [Wed, 17 Aug 2016 13:16:57 +0000 (15:16 +0200)]
drm/etnaviv: split out wait for gpu idle

Split out into a new externally visible function, as the IOMMUv2
code needs this functionality, too.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: move gpu_va() to etnaviv mmu
Lucas Stach [Wed, 17 Aug 2016 12:57:51 +0000 (14:57 +0200)]
drm/etnaviv: move gpu_va() to etnaviv mmu

The GPU virtual address for the command buffers differs depending on
the IOMMU version. Move the calculation of the iova into etnaviv
mmu, to enable proper dispatch.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: remove unused iommu_v2 header
Lucas Stach [Tue, 16 Aug 2016 10:12:12 +0000 (12:12 +0200)]
drm/etnaviv: remove unused iommu_v2 header

This has been there from the original merge, but has never been used.
Get rid of it.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: move IOMMU domain allocation into etnaviv MMU
Lucas Stach [Tue, 16 Aug 2016 10:09:08 +0000 (12:09 +0200)]
drm/etnaviv: move IOMMU domain allocation into etnaviv MMU

The GPU code doesn't need to deal with the IOMMU directly, instead
it can all be hidden behind the etnaviv mmu interface. Move the
last remaining part into etnaviv mmu.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: indirect IOMMU restore through etnaviv MMU
Lucas Stach [Tue, 16 Aug 2016 09:54:51 +0000 (11:54 +0200)]
drm/etnaviv: indirect IOMMU restore through etnaviv MMU

So we can call the v2 restore code once it is there.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: move linear window setup into etnaviv_iommuv1_restore
Lucas Stach [Tue, 16 Aug 2016 09:48:49 +0000 (11:48 +0200)]
drm/etnaviv: move linear window setup into etnaviv_iommuv1_restore

It is only relevant for the V1 MMU, so we should not do this in the
common code.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: rename etnaviv_iommu_domain_restore to etnaviv_iommuv1_restore
Lucas Stach [Tue, 16 Aug 2016 09:31:09 +0000 (11:31 +0200)]
drm/etnaviv: rename etnaviv_iommu_domain_restore to etnaviv_iommuv1_restore

This function has external visibility and only handles the Vivant IOMMU
version 1. Rename to make this more clear and allow a clear separation
of the different IOMMU versions.

Also drop the domain parameter, as we can infer it from the GPU we are
dealing with.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: only check if the cmdbuf is inside the linear window on MMUv1
Lucas Stach [Wed, 17 Aug 2016 14:19:53 +0000 (16:19 +0200)]
drm/etnaviv: only check if the cmdbuf is inside the linear window on MMUv1

There is no linear window on MMUv2 and the FE can access the full 4GB
address space either directly (as long as the MMU isn't configured) or
through the MMU, once it is up.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: only try to use the linear window on MMUv1
Lucas Stach [Wed, 17 Aug 2016 14:15:25 +0000 (16:15 +0200)]
drm/etnaviv: only try to use the linear window on MMUv1

As the comment above the code states, the linear window is only
available on MMUv1. Don't try to use it on MMUv2.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: fold various clock enable/disable functions into top ones
Lucas Stach [Mon, 22 Aug 2016 13:26:19 +0000 (15:26 +0200)]
drm/etnaviv: fold various clock enable/disable functions into top ones

The driver doesn't ever enable individual clocks alone, so there
is no need to scatter the clock enable/disable sequences through
multiple functions. Fold them into the top one.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agodrm/etnaviv: remove unneeded variable initialization
Fabio Estevam [Sun, 21 Aug 2016 22:32:15 +0000 (19:32 -0300)]
drm/etnaviv: remove unneeded variable initialization

There is no need to initialize variable 'err' with 0 because it will
be properly assigned later on.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
7 years agodrm/etnaviv: remove unneeded 'fail' label
Fabio Estevam [Sun, 21 Aug 2016 22:32:14 +0000 (19:32 -0300)]
drm/etnaviv: remove unneeded 'fail' label

In the etnaviv_gpu_platform_probe() error path the 'fail' label is
used to just return the error code.

This can be simplified by returning the error code immediately, so
get rid of the unneeded 'fail' label.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
7 years agodrm/etnaviv: check for errors when enabling clocks
Fabio Estevam [Sun, 21 Aug 2016 22:32:13 +0000 (19:32 -0300)]
drm/etnaviv: check for errors when enabling clocks

clk_prepare_enable() may fail, so we should better check for its return
value and propagate it in the case of failure.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
7 years agodrm: Add DP branch device info on debugfs
Mika Kahola [Fri, 9 Sep 2016 11:10:57 +0000 (14:10 +0300)]
drm: Add DP branch device info on debugfs

Read DisplayPort branch device info from through debugfs
interface.

v2: use drm_dp_helper routines to collect data
v3: cleanup to match the drm_dp_helper.c patches introduced
    earlier in this series
v4: move DP branch device info to function 'intel_dp_branch_device_info()'
v5: initial step to move debugging info from intel_dp. to drm_dp_helper.c (Daniel)
v6: read hw and sw revision without using specific drm_dp_helper routines
v7: indentation fixes (Jim Bride)

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-12-git-send-email-mika.kahola@intel.com
7 years agodrm/i915: Update bits per component for display info
Mika Kahola [Fri, 9 Sep 2016 11:10:56 +0000 (14:10 +0300)]
drm/i915: Update bits per component for display info

DisplayPort branch device may define max supported bits per
component. Update display info based on this value if bpc
is defined.

v2: cleanup to match the drm_dp_helper.c patches introduced
    earlier in this series
v3: Fill bpc for connector's display info in separate
    drm_dp_helper function (Daniel)
v4: remove updating bpc for display info as it may be overridden
    when parsing EDID. Instead, check bpc for DP branch device
    during compute_config
v5: Indentation fixes (Jim Bride)

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-11-git-send-email-mika.kahola@intel.com
7 years agodrm/i915: Check pixel rate for DP to VGA dongle
Mika Kahola [Fri, 9 Sep 2016 11:10:55 +0000 (14:10 +0300)]
drm/i915: Check pixel rate for DP to VGA dongle

Filter out a mode that exceeds the max pixel rate setting
for DP to VGA dongle. This is defined in DPCD register 0x81
if detailed cap info i.e. info field is 4 bytes long and
it is available for DP downstream port.

The register defines the pixel rate divided by 8 in MP/s.

v2: DPCD read outs and computation moved to drm (Ville, Daniel)
v3: Sink pixel rate computation moved to drm_dp_max_sink_dotclock()
    function (Daniel)
v4: Use of drm_dp_helper.c routines to compute max pixel clock (Ville)
v5: Use of intel_dp->downstream_ports to read out port capabilities.
    Code restructuring (Ville)
v6: Move DP branch device check to drm_dp_helper.c (Daniel)
v7: Cleanup as suggested by Ville

Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-10-git-send-email-mika.kahola@intel.com
7 years agodrm/i915: Read DP branch device SW revision
Mika Kahola [Fri, 9 Sep 2016 11:10:54 +0000 (14:10 +0300)]
drm/i915: Read DP branch device SW revision

SW revision is mandatory field for DisplayPort branch
devices. This is defined in DPCD register fields 0x50A
and 0x50B.

v2: move drm_dp_ds_revision structure to be part of
    drm_dp_link structure (Daniel)
v3: remove dependency to drm_dp_helper but instead parse
    DPCD and print SW revision info to dmesg (Ville)
v4: commit message fix (Jim Bride)

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-9-git-send-email-mika.kahola@intel.com
7 years agodrm/i915: Read DP branch device HW revision
Mika Kahola [Fri, 9 Sep 2016 11:10:53 +0000 (14:10 +0300)]
drm/i915: Read DP branch device HW revision

HW revision is mandatory field for DisplayPort branch
devices. This is defined in DPCD register field 0x509.

v2: move drm_dp_ds_revision structure to be part of
    drm_dp_link structure (Daniel)
v3: remove dependency to drm_dp_helper but instead parse
    DPCD and print HW revision info to dmesg (Ville)

Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-8-git-send-email-mika.kahola@intel.com
7 years agodrm/i915: Cleanup DisplayPort AUX channel initialization
Mika Kahola [Fri, 9 Sep 2016 11:10:52 +0000 (14:10 +0300)]
drm/i915: Cleanup DisplayPort AUX channel initialization

Let's remove reference to "struct intel_connector *connector"
in intel_dp_aux_init() function as it is no longer required.

Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-7-git-send-email-mika.kahola@intel.com
7 years agodrm: Read DP branch device id
Mika Kahola [Fri, 9 Sep 2016 11:10:51 +0000 (14:10 +0300)]
drm: Read DP branch device id

Read DisplayPort branch device id string.

Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-6-git-send-email-mika.kahola@intel.com
7 years agodrm: Helper to read max bits per component
Mika Kahola [Fri, 9 Sep 2016 11:10:50 +0000 (14:10 +0300)]
drm: Helper to read max bits per component

Helper routine to read out maximum supported bits per
component for DisplayPort legay converters.

v2: Return early if detailed port cap info is not available.
    Replace if-else ladder with switch-case (Ville)

Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-5-git-send-email-mika.kahola@intel.com
7 years agodrm: Helper to read max clock rate
Mika Kahola [Fri, 9 Sep 2016 11:10:49 +0000 (14:10 +0300)]
drm: Helper to read max clock rate

Helper routine to read out maximum supported pixel rate
for DisplayPort legay VGA converter or TMDS clock rate
for other digital legacy converters. The helper returns
clock rate in kHz.

v2: Return early if detailed port cap info is not available.
    Replace if-else ladder with switch-case (Ville)

Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-4-git-send-email-mika.kahola@intel.com
7 years agodrm: Drop VGA from bpc definitions
Mika Kahola [Fri, 9 Sep 2016 11:10:48 +0000 (14:10 +0300)]
drm: Drop VGA from bpc definitions

Drop "VGA" from bits per component definitions as these
are also used by other standards such as DVI, HDMI,
DP++.

Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-3-git-send-email-mika.kahola@intel.com
7 years agodrm: Add missing DP downstream port types
Mika Kahola [Fri, 9 Sep 2016 11:10:47 +0000 (14:10 +0300)]
drm: Add missing DP downstream port types

Add missing DisplayPort downstream port types. The introduced
new port types are DP++ and Wireless.

Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473419458-17080-2-git-send-email-mika.kahola@intel.com
7 years agodrm/i915: Add ddb size field to device info structure
Deepak M [Thu, 15 Sep 2016 09:31:10 +0000 (15:01 +0530)]
drm/i915: Add ddb size field to device info structure

Adding the ddb size into the devide info will avoid
platform checks while computing wm.

v2: Added comment and WARN_ON if ddb size is zero.(Jani)
v3: Added WARN_ON at the right place.(Jani)

Suggested-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Deepak M <m.deepak@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473931870-7724-1-git-send-email-m.deepak@intel.com
7 years agodrm/i915/guc: general tidying up (submission)
Dave Gordon [Mon, 12 Sep 2016 20:19:37 +0000 (21:19 +0100)]
drm/i915/guc: general tidying up (submission)

Renaming to more consistent scheme, and updating comments, mostly
about i915_guc_wq_reserve(), aka i915_guc_wq_check_space().

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473711577-11454-4-git-send-email-david.s.gordon@intel.com
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915/guc: general tidying up (loader)
Dave Gordon [Mon, 12 Sep 2016 20:19:36 +0000 (21:19 +0100)]
drm/i915/guc: general tidying up (loader)

Renaming to more consistent scheme, delete unused definitions

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473711577-11454-3-git-send-email-david.s.gordon@intel.com
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: clarify PMINTRMSK/pm_intr_keep usage
Dave Gordon [Mon, 12 Sep 2016 20:19:35 +0000 (21:19 +0100)]
drm/i915: clarify PMINTRMSK/pm_intr_keep usage

No functional changes; just renaming a bit, tweaking a datatype,
prettifying layout, and adding comments, in particular in the
GuC setup code that touches this data.

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473711577-11454-2-git-send-email-david.s.gordon@intel.com
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: Only expand COND once in wait_for()
Dave Gordon [Wed, 14 Sep 2016 12:10:33 +0000 (13:10 +0100)]
drm/i915: Only expand COND once in wait_for()

Commentary from Chris Wilson's original version:

> I was looking at some wait_for() timeouts on a slow system, with lots of
> debug enabled (KASAN, lockdep, mmio_debug). Thinking that we were
> mishandling the timeout, I tried to ensure that we loop at least once
> after first testing COND. However, the double test of COND either side
> of the timeout check makes that unlikely. But we can do an equivalent
> loop, that keeps the COND check after testing for timeout (required so
> that we are not preempted between testing COND and then testing for a
> timeout) without expanding COND twice.
>
> The advantage of only expanding COND once is a dramatic reduction in
> code size:
>
>    text    data     bss     dec     hex
>    1308733    5184    1152 1315069  1410fd before
>    1305341    5184    1152 1311677  1403bd after

but it turned out that due to a missing iniitialiser, gcc had "gone
wild trimming undefined code" :( This version acheives a rather more
modest (but still worthwhile) gain of ~550 bytes.

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Original-idea-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Zanoni, Paulo R <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473855033-26980-1-git-send-email-david.s.gordon@intel.com
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/amdgpu: use explicit limit for VRAM<->GTT moves
Christian König [Mon, 12 Sep 2016 14:08:52 +0000 (16:08 +0200)]
drm/amdgpu: use explicit limit for VRAM<->GTT moves

Use an explicit limit when moving things around to
force address space allocation.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: use explicit GTT limit for evictions
Christian König [Mon, 12 Sep 2016 14:06:18 +0000 (16:06 +0200)]
drm/amdgpu: use explicit GTT limit for evictions

This way the address space gets allocated immediately.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: unbind GTT only when it is bound
Christian König [Fri, 9 Sep 2016 13:39:08 +0000 (15:39 +0200)]
drm/amdgpu: unbind GTT only when it is bound

Doesn't make much sense to clear the GTT when it was never filled.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add AMDGPU_BO_INVALID_OFFSET
Christian König [Wed, 7 Sep 2016 13:10:44 +0000 (15:10 +0200)]
drm/amdgpu: add AMDGPU_BO_INVALID_OFFSET

An invalid offset to be used by custom VRAM/GGT manager when we
don't have an offset for an BO.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: validate size and offset of user fence BO
Christian König [Fri, 9 Sep 2016 09:21:43 +0000 (11:21 +0200)]
drm/amdgpu: validate size and offset of user fence BO

We need to validate the offset to make sure that we don't write after the BO.

Additional to that a page should be enough and can make address space
handling much easier.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/ttm: move placement structures into ttm_placement.h
Christian König [Thu, 8 Sep 2016 13:40:38 +0000 (15:40 +0200)]
drm/ttm: move placement structures into ttm_placement.h

Makes more sense to keep that together.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/ttm: remove unused placement flags
Christian König [Thu, 8 Sep 2016 13:30:33 +0000 (15:30 +0200)]
drm/ttm: remove unused placement flags

Either never used or not used in quite a while.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/ttm: rework handling of private mem types
Christian König [Mon, 12 Sep 2016 11:34:37 +0000 (13:34 +0200)]
drm/ttm: rework handling of private mem types

Instead of keeping a bunch of potentially unused flags, just define
the start for private memory types and remove the rest.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/ttm: use ffs in ttm_mem_type_from_place
Christian König [Mon, 12 Sep 2016 11:16:16 +0000 (13:16 +0200)]
drm/ttm: use ffs in ttm_mem_type_from_place

A bit pointless to search for the first bit set manually.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/radeon: handle runtime pm in fbcon (v2)
Alex Deucher [Wed, 31 Aug 2016 21:29:51 +0000 (17:29 -0400)]
drm/radeon: handle runtime pm in fbcon (v2)

Ported from nouveau.

v2: re-enable runtime autosuspend in the error case

Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>