[Bug 83436] Sudden framerate drops in multiple games when compiling with -mtune=generic (as well with -mtune=pentium-mmx and older CPUs)

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=83436

egon2003  changed:

   What|Removed |Added

 CC||erik.badman at gmail.com

--- Comment #36 from egon2003  ---
I think I have this aswell. Mesa from git updated today. Mesa is compiled with
march=native. Unigine Heaven and Interstellar Marines is where I notice it
mostly, other games seem to work ok.

Everytime I fire the gun in Interstellar Marines fps goes to almost 0 for about
1-2 seconds, fps is pretty good otherwise around 50-90. If there is anything I
can do to help please let me know, I am on IRC as egon2003.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/6c09f020/attachment.html>


[PATCH 7/7] ARM: bcm2835: Add VC4 to the device tree.

2015-08-14 Thread Stephen Warren
On 08/12/2015 06:56 PM, Eric Anholt wrote:
> Signed-off-by: Eric Anholt 

Patch description?


> diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi

>   arm-pmu {
>   compatible = "arm,arm1176-pmu";
>   };
> +
> + hdmi: brcm,vc4-hdmi at 7e902000 {

It'd be nice to keep all the DT nodes with a reg property together, and
sorted in reg order.

As before, I think any DT node for a HW block that may-or-may-not-be
used based on board connectivity/features should be disabled in the SoC
.dtsi file, and enabled in the board's DT file if the feature is useful
for that board.


[Bug 91641] white cursor with planetary annihilation

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=91641

--- Comment #3 from kdj0c at djinvi.net ---
by the way, there was a mod that fixed the cursor issue with mesa drivers. but
it's not working with recent build.

also it's working with nvidia binary driver. So I'm still unsure if this bug is
in the driver or in the game, or in a lib between them.


on a side note, I tried to record a trace with apitrace, but it doesn't record
the cursor.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/f59e927d/attachment.html>


[PATCH 6/7] ARM: bcm2835: Add the DDC I2C controller to the device tree.

2015-08-14 Thread Stephen Warren
On 08/12/2015 06:56 PM, Eric Anholt wrote:
> We need to use it for getting video modes over HDMI.

> diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi

> + i2c2: i2c at 7e805000 {
> + compatible = "brcm,bcm2835-i2c";
> + reg = <0x7e805000 0x1000>;
> + interrupts = <2 21>;
> + clocks = <_i2c>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + };

In an SoC .dtsi file, you'd typically write:

status = "disabled";

... in all nodes that represent IO controllers that interface to
external HW, so that board DT files can/must explicitly choose to enable
the device if it's actually in use on the board. Some systems might not
have HDMI and hence might not hook up the HDMI_SCL/SDA pads.

BCM2835-ARM-Peripherals.pdf states "Note that the BSC2 master is used
dedicated with the HDMI interface and should not be accessed by user
programs.". Does this imply the Linux kernel shouldn't be touching this
I2C controller; that the VC4 firmware might also be attempting to use
it? I wonder how any such sharing of the HW would work.


[Bug 91641] white cursor with planetary annihilation

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=91641

--- Comment #2 from kdj0c at djinvi.net ---
according to the last post of this thread :

https://forums.uberent.com/threads/reproduction-of-cursor-bug.50898/page-2

the post is a bit old, so I'm not sure it's still 100% accurate :

one of the dev said:"For the cursor we use the standard XCursor library with
calls like XcursorImageLoadCursor. We could hide the system cursor and compose
the cursor image ourselves but that has a couple of downsides, primarily that
it adds more lag between when the mouse moves and when the cursor moves."

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/6bec01c0/attachment.html>


[PATCH 3/7] drm/vc4: Add KMS support for Raspberry Pi.

2015-08-14 Thread Stephen Warren
On 08/12/2015 06:56 PM, Eric Anholt wrote:
> This is the start of a full VC4 driver.  Right now this just supports
> configuring the display using a pre-existing video mode (because
> changing the pixel clock isn't available yet, and doesn't work when it
> is).  However, this is enough for fbcon and bringing up X using
> xf86-video-modesetting.

> diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig

> +config DRM_VC4
> + tristate "Broadcom VC4 Graphics"

> + help
> +   Choose this option if you have a system that has a Broadcom
> +   VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835.
> +
> +   This driver requires that "avoid_warnings=2" be present in
> +   the config.txt for the firmware, to keep it from smashing
> +   our display setup.

The need for "avoid_warnings=2" seems like it will trip people up. I
don't think it's in any config.txt I've seen. Can you expand more on that?


[PATCH 2/7] MAINTAINERS: Add myself for the new VC4 (RPi GPU) graphics driver.

2015-08-14 Thread Stephen Warren
On 08/12/2015 06:56 PM, Eric Anholt wrote:

> diff --git a/MAINTAINERS b/MAINTAINERS

> +DRM DRIVERS FOR VC4
> +M:   Eric Anholt 
> +T:   git git://github.com/anholt/linux
> +S:   Maintained
> +F:   drivers/gpu/drm/vc4/*

S: Supported

?


[PATCH 1/7] drm/vc4: Add devicetree bindings for VC4.

2015-08-14 Thread Stephen Warren
On 08/12/2015 06:56 PM, Eric Anholt wrote:
> Signed-off-by: Eric Anholt 

This one definitely needs a patch description, since someone might not
know what a VC4 is, and "git log" won't show the text from the binding
doc itself. I'd suggest adding the initial paragraph of the binding doc
as the patch description, or more.

> diff --git a/Documentation/devicetree/bindings/gpu/brcm,bcm-vc4.txt 
> b/Documentation/devicetree/bindings/gpu/brcm,bcm-vc4.txt

> +Required properties for VC4:
> +- compatible:Should be "brcm,vc4"
> +- crtcs: List of references to pixelvalve scanout engines

s/references to/phandles of/ would be more typical DT language.

> +- hvss:  List of references to HVS video scalers
> +- encoders:  List of references to output encoders (HDMI, SDTV)

Would it make sense to make all those nodes child node of the vc4
object. That way, there's no need to have these lists of objects; they
can be automatically built up as the DT is enumerated. I know that e.g.
the NVIDIA Tegra host1x binding works this way, and I think it may have
been inspired by other similar cases.

Of course, this is only appropriate if the HW modules really are
logically children of the VC4 HW module. Perhaps they aren't. If they
aren't though, I wonder what this "vc4" module actually represents in HW?

> +Required properties for HDMI
> +- compatible:Should be "brcm,vc4-hdmi"
> +- reg:   Physical base address and length of the two register 
> ranges
> +   ("HDMI" and "HD")

I'd add "in that order" right before ")".

> +Example:
> +/ {
> + soc {

Minor nit: Examples often don't include any nodes "above" the nodes
whose bindings are being documented.


[Bug 86720] [radeon] Europa Universalis 4 freezing during game start (10.3.3)

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=86720

--- Comment #27 from Benjamin Bellec  ---
(In reply to noga.dany from comment #26)
> I tried run it with nosb parameters like mentioned above "R600_DEBUG=nosb
> force_s3tc_enable=true /usr/bin/steam %U" and game works, but textures looks
> very bad.

Remove the "force_s3tc_enable=true" in your command.

And be sure to have the s3tc lib installed (libtxc_dxtn). You can check that
with this command:
$ glxinfo |grep s3tc

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/3e0b26a1/attachment.html>


[Bug 91641] white cursor with planetary annihilation

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=91641

--- Comment #1 from Alex Deucher  ---
Does the app use the hw cursor or draw it's own?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/d8bad178/attachment.html>


[Bug 91641] white cursor with planetary annihilation

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=91641

Ilia Mirkin  changed:

   What|Removed |Added

 Attachment #117696|text/plain  |image/jpeg
  mime type||

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/3fa3e6a1/attachment-0001.html>


[Bug 91641] white cursor with planetary annihilation

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=91641

Bug ID: 91641
   Summary: white cursor with planetary annihilation
   Product: Mesa
   Version: 10.6
  Hardware: Other
OS: All
Status: NEW
  Severity: minor
  Priority: medium
 Component: Drivers/Gallium/radeonsi
  Assignee: dri-devel at lists.freedesktop.org
  Reporter: kdj0c at djinvi.net
QA Contact: dri-devel at lists.freedesktop.org

Created attachment 117696
  --> https://bugs.freedesktop.org/attachment.cgi?id=117696=edit
screenshot in the PA menu

the cursor is a big white square in planetary annihilation. (see screenshot
attached).

only the blue arrow should be seen, the white square should be transparent.

HW is radeon HD 7950 with radeonsi driver

OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD TAHITI
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.6.4
OpenGL core profile shading language version string: 3.30

thread on uber forum : 
https://forums.uberent.com/threads/state-of-the-cursor-fix.69376/

tried to add   Option  "SWCursor" "True" to xorg.conf, but doesn't have any
visible effect.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/3b8d8f60/attachment.html>


[Bug 89228] Regression with left for dead 2

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=89228

kdj0c at djinvi.net changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from kdj0c at djinvi.net ---
no more issue on Mesa 10.6.4.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/50f621fa/attachment.html>


[PATCH] drm/bridge: Fix the dw_hdmi object name

2015-08-14 Thread Thierry Reding
On Fri, Aug 14, 2015 at 11:13:16AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Commit 66d5e6d329aed4 ("drm/bridge: Add vendor prefixes") changed
> the object name to dw-hdmi.o, which breaks the build:
> 
> make[4]: *** No rule to make target `drivers/gpu/drm/bridge/dw-hdmi.o', 
> needed by `drivers/gpu/drm/bridge/built-in.o'.  Stop.
> 
> Fix it by using the correct 'dw_hdmi.o' name.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  drivers/gpu/drm/bridge/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Urgh... that's left-over of a change I backed out to avoid any potential
conflicts with Russell's work on the dw-hdmi driver. I've updated the
branch with your fix and resent a new pull request.

Thanks,
Thierry
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/3e31d587/attachment.sig>


[GIT PULL v2] drm/panel: Changes for v4.3-rc1

2015-08-14 Thread Thierry Reding
Hi Dave,

The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:

  Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)

are available in the git repository at:

  git://anongit.freedesktop.org/tegra/linux tags/drm/panel/for-4.3-rc1

for you to fetch changes up to a33ee95f8f456c241897a4b6153610b8488d009d:

  drm/bridge: Put Kconfig entries in a separate menu (2015-08-14 21:35:36 +0200)

This is an updated pull request, fixing an issue that Fabio Estevam
pointed out, right after I had sent out the original pull request.

Thanks,
Thierry


drm/panel: Changes for v4.3-rc1

This introduces support for a couple of new panels and also contains
some work to restructure the directories to get more consistency, to
deal better with more panel and bridge drivers getting added.


Gary Bisson (2):
  of: Add Okaya Electric America vendor prefix
  drm/panel: Add display timing for Okaya RS800480T-7X0GP

Heiko Schocher (1):
  drm/panel: Add support for LG LG4573 480x800 4.3" panel

Philipp Zabel (2):
  drm/panel: simple: Add bus format for HannStar HSD070PWW1 LVDS panel
  drm/panel: simple: Correct minimum hsync length of the HannStar 
HSD070PWW1 panel

Thierry Reding (5):
  drm/exynos: Remove PTN3460 dependency
  drm/panel: Add Samsung prefix to panel drivers
  drm/bridge: Add vendor prefixes
  drm/panel: simple: Add support for AUO B080UAN01
  drm/bridge: Put Kconfig entries in a separate menu

jianwei wang (1):
  drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

 .../devicetree/bindings/panel/auo,b080uan01.txt|   7 +
 .../devicetree/bindings/panel/lg,lg4573.txt|  19 ++
 .../bindings/panel/nec,nl4827hc19-05b.txt  |   7 +
 .../bindings/panel/okaya,rs800480t-7x0gp.txt   |   7 +
 .../devicetree/bindings/vendor-prefixes.txt|   1 +
 arch/arm/configs/exynos_defconfig  |   6 +-
 arch/arm/configs/multi_v7_defconfig|   6 +-
 drivers/gpu/drm/Kconfig|   4 +-
 drivers/gpu/drm/bridge/Kconfig |  24 +-
 drivers/gpu/drm/bridge/Makefile|   4 +-
 .../gpu/drm/bridge/{ptn3460.c => nxp-ptn3460.c}|   0
 .../gpu/drm/bridge/{ps8622.c => parade-ps8622.c}   |   0
 drivers/gpu/drm/exynos/Kconfig |   2 +-
 drivers/gpu/drm/panel/Kconfig  |  16 +-
 drivers/gpu/drm/panel/Makefile |   5 +-
 drivers/gpu/drm/panel/panel-lg-lg4573.c| 298 +
 .../{panel-ld9040.c => panel-samsung-ld9040.c} |   2 +-
 .../{panel-s6e8aa0.c => panel-samsung-s6e8aa0.c}   |   2 +-
 drivers/gpu/drm/panel/panel-simple.c   |  99 ++-
 19 files changed, 481 insertions(+), 28 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/panel/auo,b080uan01.txt
 create mode 100644 Documentation/devicetree/bindings/panel/lg,lg4573.txt
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19-05b.txt
 create mode 100644 
Documentation/devicetree/bindings/panel/okaya,rs800480t-7x0gp.txt
 rename drivers/gpu/drm/bridge/{ptn3460.c => nxp-ptn3460.c} (100%)
 rename drivers/gpu/drm/bridge/{ps8622.c => parade-ps8622.c} (100%)
 create mode 100644 drivers/gpu/drm/panel/panel-lg-lg4573.c
 rename drivers/gpu/drm/panel/{panel-ld9040.c => panel-samsung-ld9040.c} (99%)
 rename drivers/gpu/drm/panel/{panel-s6e8aa0.c => panel-samsung-s6e8aa0.c} (99%)


[Bug 88364] Xorg hangs after videocard switching

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=88364

--- Comment #13 from Liss  ---
kernel 4.2-rc6, no changes

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/fe6492b9/attachment.html>


[PATCH 1/2] drm/amdgpu: wait on page directory changes.

2015-08-14 Thread Christian König
On 14.08.2015 20:08, Bas Nieuwenhuizen wrote:
> Pagetables can be moved and therefore the page directory update can be 
> necessary
> for the current cs even if none of the the bo's are moved. In that scenario
> there is no fence between the sdma0 and gfx ring, so we add one.
>
> Signed-off-by: Bas Nieuwenhuizen 

Nice catch, this patch is Reviewed-by: Christian König 


The other one we found internally already as well.

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 +
>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 ++
>   3 files changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 6934f52..c2383bb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -981,6 +981,7 @@ struct amdgpu_vm {
>   /* contains the page directory */
>   struct amdgpu_bo*page_directory;
>   unsignedmax_pde_used;
> + struct fence*page_directory_fence;
>   
>   /* array of page tables, one for each page directory entry */
>   struct amdgpu_vm_pt *page_tables;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index f428288..01b4a67 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -552,6 +552,10 @@ static int amdgpu_bo_vm_update_pte(struct 
> amdgpu_cs_parser *p,
>   if (r)
>   return r;
>   
> + r = amdgpu_sync_fence(adev, >ibs[0].sync, vm->page_directory_fence);
> + if (r)
> + return r;
> +
>   r = amdgpu_vm_clear_freed(adev, vm);
>   if (r)
>   return r;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index b3f5d04..e02e353 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -495,6 +495,9 @@ int amdgpu_vm_update_page_directory(struct amdgpu_device 
> *adev,
>   if (r)
>   goto error_free;
>   amdgpu_bo_fence(pd, fence, true);
> +
> + fence_put(vm->page_directory_fence);
> + vm->page_directory_fence = fence_get(fence);
>   }
>   
>   if (!amdgpu_enable_scheduler || ib->length_dw == 0) {
> @@ -1287,6 +1290,8 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct 
> amdgpu_vm *vm)
>   return -ENOMEM;
>   }
>   
> + vm->page_directory_fence = NULL;
> +
>   r = amdgpu_bo_create(adev, pd_size, align, true,
>AMDGPU_GEM_DOMAIN_VRAM, 0,
>NULL, >page_directory);
> @@ -1335,6 +1340,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct 
> amdgpu_vm *vm)
>   kfree(vm->page_tables);
>   
>   amdgpu_bo_unref(>page_directory);
> + fence_put(vm->page_directory_fence);
>   
>   for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
>   amdgpu_fence_unref(>ids[i].flushed_updates);



[Bug 86720] [radeon] Europa Universalis 4 freezing during game start (10.3.3)

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=86720

--- Comment #26 from noga.dany at gmail.com ---
I tried run it with nosb parameters like mentioned above "R600_DEBUG=nosb
force_s3tc_enable=true /usr/bin/steam %U" and game works, but textures looks
very bad.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/afe7f92e/attachment.html>


[PATCH RFC v2 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders

2015-08-14 Thread Mark Brown
On Tue, May 26, 2015 at 09:59:07PM +0300, Jyri Sarha wrote:

> +
> + mutex_lock(>current_stream_lock);
> + if (hcp->current_stream && hcp->current_stream->runtime &&
> + snd_pcm_running(hcp->current_stream)) {
> + dev_info(dev, "HDMI audio playback aborted\n");

Does this really need to be dev_info()?

> + if (hcp->hcd.ops->get_eld) {
> + hcp->eld = hcp->hcd.ops->get_eld(hcp->hcd.dev);
> +
> + /* Call snd_pcm_hw_constraint_eld here */
> + }

...

> + dev_dbg(dai->dev, "%s()\n", __func__);
> +
> + mutex_lock(>current_stream_lock);
> + BUG_ON(hcp->current_stream != substream);
> + hcp->current_stream = NULL;
> + mutex_unlock(>current_stream_lock);
> +
> + hcp->hcd.ops->audio_shutdown(hcp->hcd.dev);

Shouldn't the callback be in or before the lock?  Otherwise we could
potentially race with starting a new stream.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/3b3328a5/attachment-0001.sig>


[PATCH v14 3/6] drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

2015-08-14 Thread Jianwei Wang
On Thu, Aug 13, 2015 at 8:23 AM, Thierry Reding
 wrote:
> On Wed, Jul 29, 2015 at 04:30:02PM +0800, Jianwei Wang wrote:
>> This adds support for the NEC NL4827HC19-05B 480x272 panel to the DRM
>> simple panel driver.
>>
>> Signed-off-by: Alison Wang 
>> Signed-off-by: Xiubo Li 
>> Signed-off-by: Jianwei Wang 
>> Acked-by: Daniel Vetter 
>> ---
>>  .../bindings/panel/nec,nl4827hc19_05b.txt  |  7 ++
>>  drivers/gpu/drm/panel/panel-simple.c   | 26 
>> ++
>>  2 files changed, 33 insertions(+)
>>  create mode 100644 
>> Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
>>
>> diff --git a/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt 
>> b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
>> new file mode 100644
>> index 000..20e9473
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/panel/nec,nl4827hc19_05b.txt
>> @@ -0,0 +1,7 @@
>> +NEC LCD Technologies,Ltd. WQVGA TFT LCD panel
>> +
>> +Required properties:
>> +- compatible: should be "nec,nl4827hc19_05b"
>
> Underscores are deprecated in compatible strings, so I've applied this
> with "nec,nl4827hc19-05b".
>
> Thierry

Okay, thanks.

Jianwei


[PATCH 2/2] drm/amdgpu: do not redundantly update page tables.

2015-08-14 Thread Bas Nieuwenhuizen
Signed-off-by: Bas Nieuwenhuizen 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index e02e353..9a1da86 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -844,7 +844,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
struct ttm_mem_reg *mem)
 {
struct amdgpu_vm *vm = bo_va->vm;
-   struct amdgpu_bo_va_mapping *mapping;
+   struct amdgpu_bo_va_mapping *mapping, *next;
uint32_t flags;
uint64_t addr;
int r;
@@ -864,11 +864,14 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
list_splice_init(_va->valids, _va->invalids);
spin_unlock(>status_lock);

-   list_for_each_entry(mapping, _va->invalids, list) {
+   list_for_each_entry_safe(mapping, next, _va->invalids, list) {
r = amdgpu_vm_bo_update_mapping(adev, vm, mapping, addr,
flags, _va->last_pt_update);
if (r)
return r;
+
+   list_del_init(>list);
+   list_add(>list, _va->valids);
}

spin_lock(>status_lock);
-- 
2.5.0



[PATCH 1/2] drm/amdgpu: wait on page directory changes.

2015-08-14 Thread Bas Nieuwenhuizen
Pagetables can be moved and therefore the page directory update can be necessary
for the current cs even if none of the the bo's are moved. In that scenario
there is no fence between the sdma0 and gfx ring, so we add one.

Signed-off-by: Bas Nieuwenhuizen 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 ++
 3 files changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 6934f52..c2383bb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -981,6 +981,7 @@ struct amdgpu_vm {
/* contains the page directory */
struct amdgpu_bo*page_directory;
unsignedmax_pde_used;
+   struct fence*page_directory_fence;

/* array of page tables, one for each page directory entry */
struct amdgpu_vm_pt *page_tables;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index f428288..01b4a67 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -552,6 +552,10 @@ static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser 
*p,
if (r)
return r;

+   r = amdgpu_sync_fence(adev, >ibs[0].sync, vm->page_directory_fence);
+   if (r)
+   return r;
+
r = amdgpu_vm_clear_freed(adev, vm);
if (r)
return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index b3f5d04..e02e353 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -495,6 +495,9 @@ int amdgpu_vm_update_page_directory(struct amdgpu_device 
*adev,
if (r)
goto error_free;
amdgpu_bo_fence(pd, fence, true);
+
+   fence_put(vm->page_directory_fence);
+   vm->page_directory_fence = fence_get(fence);
}

if (!amdgpu_enable_scheduler || ib->length_dw == 0) {
@@ -1287,6 +1290,8 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct 
amdgpu_vm *vm)
return -ENOMEM;
}

+   vm->page_directory_fence = NULL;
+
r = amdgpu_bo_create(adev, pd_size, align, true,
 AMDGPU_GEM_DOMAIN_VRAM, 0,
 NULL, >page_directory);
@@ -1335,6 +1340,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct 
amdgpu_vm *vm)
kfree(vm->page_tables);

amdgpu_bo_unref(>page_directory);
+   fence_put(vm->page_directory_fence);

for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
amdgpu_fence_unref(>ids[i].flushed_updates);
-- 
2.5.0



[PATCH 1/7] prime_mmap: Add new test for calling mmap() on dma-buf fds

2015-08-14 Thread Tiago Vignatti
Hi Daniel,

On 08/13/2015 04:04 AM, Daniel Vetter wrote:
> On Wed, Aug 12, 2015 at 08:29:14PM -0300, Tiago Vignatti wrote:
>> +/* Map too big */
>> +handle = gem_create(fd, BO_SIZE);
>> +fill_bo(handle, BO_SIZE);
>> +dma_buf_fd = prime_handle_to_fd(fd, handle);
>> +igt_assert(errno == 0);
>> +ptr = mmap(NULL, BO_SIZE * 2, PROT_READ, MAP_SHARED, dma_buf_fd, 0);
>> +igt_assert(ptr == MAP_FAILED && errno == EINVAL);
>> +errno = 0;
>> +close(dma_buf_fd);
>> +gem_close(fd, handle);
>
> That only checks for one of the conditions, trying to map something
> offset/overlapping the end of the buffer, but small enough needs to be
> tested separately.

you mean test for smaller length with a non-zero offset? I don't think I 
get what you wanted to say here maybe.

> Also I think a testcase for invalid buffer2fd flags would be good, just
> for completeness - we seem to be missing that one.

you mean test for different flags than the ones supported by 
DRM_IOCTL_PRIME_HANDLE_TO_FD?

Tiago


[PATCH v2.1 1/3] vga_switcheroo: Add support for switching only the DDC

2015-08-14 Thread Lukas Wunner
Originally by Seth Forshee , 2012-10-04:
During graphics driver initialization it's useful to be able to mux only
the DDC to the inactive client in order to read the EDID. Add a
switch_ddc callback to allow capable handlers to provide this
functionality, and add vga_switcheroo_switch_ddc() to allow DRM to mux
only the DDC.

Modified by Dave Airlie , 2012-12-22:
I can't figure out why I didn't like this, but I rewrote this [...] to
lock/unlock the ddc lines [...]. I think I'd prefer something like that
otherwise the interface got really ugly.

Modified by Lukas Wunner , 2015-08-14:
Don't grab vgasr_mutex in lock_ddc/unlock_ddc to avoid the following
deadlock scenarios: (a) During switch (with vgasr_mutex already held),
GPU is woken and probes its outputs, tries to re-acquire vgasr_mutex
to lock DDC lines. (b) Likewise during switch, GPU is suspended and
calls cancel_delayed_work_sync to stop output polling, if poll task
is running at this moment we may wait forever for it to finish.
If we don't grab vgasr_mutex the only bad thing that can happen is
that the handler suddenly disappears. So block handler deregistration
until DDC lines are unlocked again.

WARN_ON_ONCE if unlock_ddc is called without calling lock_ddc first.
Lock ddc_lock in stage2 to avoid race condition where reading the
EDID and switching happens simultaneously. Switch DDC lines on
MIGD / MDIS commands and on runtime suspend. Fix bug in stage2
where no client had the active attribute set if switching failed.
Fix erroneous interface documentation.

If the inactive client registers before the active client then
old_ddc_owner cannot be determined with find_active_client()
(null pointer dereference). Therefore change semantics of the
->switch_ddc handler callback to return old_ddc_owner.

v2.1: Overhaul locking, squash commits (requested by Daniel Vetter)

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88861
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61115
Tested-by: Lukas Wunner 
[MBP  9,1 2012  intel IVB + nvidia GK107  pre-retina]

Cc: Seth Forshee 
Cc: Dave Airlie 
Signed-off-by: Lukas Wunner 
---
 drivers/gpu/vga/vga_switcheroo.c | 73 +---
 include/linux/vga_switcheroo.h   |  6 
 2 files changed, 74 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 37ac7b5..ac4ac12 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -9,12 +9,13 @@

  Switcher interface - methods require for ATPX and DCM
  - switchto - this throws the output MUX switch
- - discrete_set_power - sets the power state for the discrete card
+ - switch_ddc - switch only DDC lines, return old DDC owner
+ - power_state - sets the power state for either GPU

  GPU driver interface
  - set_gpu_state - this should do the equiv of s/r for the card
  - this should *not* set the discrete power state
- - switch_check  - check if the device is in a position to switch now
+ - can_switch - check if the device is in a position to switch now
  */

 #include 
@@ -57,6 +58,8 @@ struct vgasr_priv {
struct list_head clients;

struct vga_switcheroo_handler *handler;
+   struct mutex ddc_lock;
+   int old_ddc_owner;
 };

 #define ID_BIT_AUDIO   0x100
@@ -70,6 +73,7 @@ static void vga_switcheroo_debugfs_fini(struct vgasr_priv 
*priv);
 /* only one switcheroo per system */
 static struct vgasr_priv vgasr_priv = {
.clients = LIST_HEAD_INIT(vgasr_priv.clients),
+   .ddc_lock = __MUTEX_INITIALIZER(vgasr_priv.ddc_lock),
 };

 static bool vga_switcheroo_ready(void)
@@ -122,12 +126,14 @@ EXPORT_SYMBOL(vga_switcheroo_register_handler);
 void vga_switcheroo_unregister_handler(void)
 {
mutex_lock(_mutex);
+   mutex_lock(_priv.ddc_lock);
vgasr_priv.handler = NULL;
if (vgasr_priv.active) {
pr_info("vga_switcheroo: disabled\n");
vga_switcheroo_debugfs_fini(_priv);
vgasr_priv.active = false;
}
+   mutex_unlock(_priv.ddc_lock);
mutex_unlock(_mutex);
 }
 EXPORT_SYMBOL(vga_switcheroo_unregister_handler);
@@ -256,6 +262,43 @@ void vga_switcheroo_client_fb_set(struct pci_dev *pdev,
 }
 EXPORT_SYMBOL(vga_switcheroo_client_fb_set);

+int vga_switcheroo_lock_ddc(struct pci_dev *pdev)
+{
+   int id;
+
+   mutex_lock(_priv.ddc_lock);
+
+   if (!vgasr_priv.handler || !vgasr_priv.handler->switch_ddc)
+   return vgasr_priv.old_ddc_owner = -ENODEV;
+
+   id = vgasr_priv.handler->get_client_id(pdev);
+   return vgasr_priv.old_ddc_owner = vgasr_priv.handler->switch_ddc(id);
+}
+EXPORT_SYMBOL(vga_switcheroo_lock_ddc);
+
+int vga_switcheroo_unlock_ddc(struct pci_dev *pdev)
+{
+   int ret, id;
+
+   if (WARN_ON_ONCE(!mutex_is_locked(_priv.ddc_lock)))
+   return -EINVAL;
+
+   if (vgasr_priv.old_ddc_owner < 0) {
+   mutex_unlock(_priv.ddc_lock);
+

[PATCH v2.1 3/3] drm/edid: Switch DDC when reading the EDID

2015-08-14 Thread Lukas Wunner
Originally by Seth Forshee , 2012-10-04:
Some dual graphics machines support muxing the DDC separately from the
display, so make use of this functionality when reading the EDID on the
inactive GPU. Also serialize drm_get_edid() with a mutex to avoid races
on the DDC mux state.

Modified by Dave Airlie , 2012-12-22:
I can't figure out why I didn't like this, but I rewrote this [...] to
lock/unlock the ddc lines [...]. I think I'd prefer something like that
otherwise the interface got really ugly.

Modified by Lukas Wunner , 2015-03-27:
Unlock DDC lines if drm_probe_ddc() fails.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88861
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61115
Tested-by: Pierre Moreau 
[MBP  5,3 2009  nvidia 9400M + 9600M GT   pre-retina]
Tested-by: Paul Hordiienko 
[MBP  6,2 2010  intel ILK + nvidia GT216  pre-retina]
Tested-by: William Brown 
[MBP  8,2 2011  intel SNB + amd turks pre-retina]
Tested-by: Lukas Wunner 
[MBP  9,1 2012  intel IVB + nvidia GK107  pre-retina]
Tested-by: Bruno Bierbaumer 
[MBP 11,3 2013  intel HSW + nvidia GK107  retina -- work in progress]

Cc: Seth Forshee 
Cc: Dave Airlie 
Signed-off-by: Lukas Wunner 
---
 drivers/gpu/drm/drm_edid.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index e6e05bb..cdb2fa1 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1377,13 +1378,21 @@ struct edid *drm_get_edid(struct drm_connector 
*connector,
  struct i2c_adapter *adapter)
 {
struct edid *edid;
+   struct pci_dev *pdev = connector->dev->pdev;

-   if (!drm_probe_ddc(adapter))
+   vga_switcheroo_lock_ddc(pdev);
+
+   if (!drm_probe_ddc(adapter)) {
+   vga_switcheroo_unlock_ddc(pdev);
return NULL;
+   }

edid = drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter);
if (edid)
drm_get_displayid(connector, edid);
+
+   vga_switcheroo_unlock_ddc(pdev);
+
return edid;
 }
 EXPORT_SYMBOL(drm_get_edid);
-- 
2.1.0



[PULL] drm-intel-next

2015-08-14 Thread Daniel Vetter
Hi Dave,

drm-intel-next-2015-07-31:
- kerneldoc for tiling/swizzling/fencing code
- bxt hpd port A w/a
- various other fixes all over

... not much, everyone's on vacation.

Cheers, Daniel


The following changes since commit e0548f1979bfee900fb0671a5dd3a2f217dce5df:

  drm/i915: Update DRIVER_DATE to 20150717 (2015-07-17 22:24:32 +0200)

are available in the git repository at:

  git://anongit.freedesktop.org/drm-intel tags/drm-intel-next-2015-07-31

for you to fetch changes up to 5d8a0d0b44c207690adda723b8d60158c18fec8a:

  drm/i915: Update DRIVER_DATE to 20150731 (2015-07-31 09:52:56 +0200)


- kerneldoc for tiling/swizzling/fencing code
- bxt hpd port A w/a
- various other fixes all over

... not much, everyone's on vacation.


Alex Dai (1):
  drm/i915: Add GuC-related module parameters

Arun Siluvery (1):
  drm/i915: Add provision to extend Golden context batch

Chris Wilson (1):
  drm/i915: Keep the mm.bound_list in rough LRU order

Daniel Vetter (9):
  Partially revert "drm/i915: s/mdelay/msleep/" in ilk rps code
  drm/i915: Clean up Makefile
  drm/i915: Extract i915_gem_fence.c
  drm/i915: kerneldoc for fences
  drm/i915: Remove bogus kerneldoc include directive
  drm/i915: Move low-level swizzling code to i915_gem_fence.c
  drm/i915: kerneldoc for tiling IOCTL and swizzle functions
  drm/i915: Fake AGP is dead
  drm/i915: Update DRIVER_DATE to 20150731

Dave Gordon (2):
  drm/i915: Add i915_gem_object_create_from_data()
  drm/i915: Add GuC-related header files

Hanno Böck (2):
  drm/i915: Properly sort MI coomand table
  drm/i915: Fix command parser table validator

Imre Deak (3):
  drm/i915: combine i9xx_get_hpd_pins and pch_get_hpd_pins
  drm/i915: don't use HPD_PORT_A as an alias for HPD_NONE
  drm/i915/bxt: add support for HPD long/short pulse detection on 
HPD_PORT_A pin

Mika Kuoppala (1):
  drm/i915: Do kunmap if renderstate parsing fails

Rodrigo Vivi (2):
  drm/i915: Try to stop sink crc calculation on error.
  drm/i915: Don't return error on sink crc stop.

Sudip Mukherjee (2):
  drm/i915: remove unnecessary null test
  drm/i915: remove redundant if check

 Documentation/DocBook/drm.tmpl   |  18 +-
 drivers/gpu/drm/i915/Makefile|  19 +-
 drivers/gpu/drm/i915/i915_cmd_parser.c   |   4 +-
 drivers/gpu/drm/i915/i915_debugfs.c  |  25 +-
 drivers/gpu/drm/i915/i915_dma.c  |  10 -
 drivers/gpu/drm/i915/i915_drv.c  |   4 -
 drivers/gpu/drm/i915/i915_drv.h  |  35 +-
 drivers/gpu/drm/i915/i915_gem.c  | 448 ++-
 drivers/gpu/drm/i915/i915_gem_fence.c| 787 +++
 drivers/gpu/drm/i915/i915_gem_render_state.c |  55 +-
 drivers/gpu/drm/i915/i915_gem_render_state.h |   2 +
 drivers/gpu/drm/i915/i915_gem_tiling.c   | 303 ++-
 drivers/gpu/drm/i915/i915_guc_reg.h  | 102 
 drivers/gpu/drm/i915/i915_irq.c  |  77 ++-
 drivers/gpu/drm/i915/i915_params.c   |   9 +
 drivers/gpu/drm/i915/i915_reg.h  |   5 +
 drivers/gpu/drm/i915/intel_dp.c  |  13 +-
 drivers/gpu/drm/i915/intel_guc_fwif.h| 245 +
 drivers/gpu/drm/i915/intel_hotplug.c |  20 +-
 drivers/gpu/drm/i915/intel_lrc.c |   6 +
 drivers/gpu/drm/i915/intel_pm.c  |   6 +-
 21 files changed, 1409 insertions(+), 784 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/i915_gem_fence.c
 create mode 100644 drivers/gpu/drm/i915/i915_guc_reg.h
 create mode 100644 drivers/gpu/drm/i915/intel_guc_fwif.h

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


[PATCH v2.1 2/3] apple-gmux: Add switch_ddc support

2015-08-14 Thread Lukas Wunner
Originally by Seth Forshee , 2012-10-04:
The gmux allows muxing the DDC independently from the display, so
support this functionality. This will allow reading the EDID for the
inactive GPU, fixing issues with machines that either don't have a VBT
or have invalid mode data in the VBT.

Modified by Lukas Wunner , 2015-03-27:
If the inactive client registers before the active client then
old_ddc_owner cannot be determined with find_active_client()
(null pointer dereference). Therefore change semantics of the
->switch_ddc handler callback to return old_ddc_owner.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88861
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61115
Tested-by: Pierre Moreau 
[MBP  5,3 2009  nvidia 9400M + 9600M GT   pre-retina]
Tested-by: Paul Hordiienko 
[MBP  6,2 2010  intel ILK + nvidia GT216  pre-retina]
Tested-by: William Brown 
[MBP  8,2 2011  intel SNB + amd turks pre-retina]
Tested-by: Lukas Wunner 
[MBP  9,1 2012  intel IVB + nvidia GK107  pre-retina]
Tested-by: Bruno Bierbaumer 
[MBP 11,3 2013  intel HSW + nvidia GK107  retina -- work in progress]

Cc: Seth Forshee 
Signed-off-by: Lukas Wunner 
---
 drivers/platform/x86/apple-gmux.c | 25 +++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/apple-gmux.c 
b/drivers/platform/x86/apple-gmux.c
index 0dec3f5..08bdf1e 100644
--- a/drivers/platform/x86/apple-gmux.c
+++ b/drivers/platform/x86/apple-gmux.c
@@ -273,14 +273,34 @@ static const struct backlight_ops gmux_bl_ops = {
.update_status = gmux_update_status,
 };

+static int gmux_switch_ddc(enum vga_switcheroo_client_id id)
+{
+   enum vga_switcheroo_client_id old_ddc_owner;
+
+   if (gmux_read8(apple_gmux_data, GMUX_PORT_SWITCH_DDC) == 1)
+   old_ddc_owner = VGA_SWITCHEROO_IGD;
+   else
+   old_ddc_owner = VGA_SWITCHEROO_DIS;
+
+   pr_debug("Switching gmux DDC from %d to %d\n", old_ddc_owner, id);
+
+   if (id == old_ddc_owner)
+   return old_ddc_owner;
+
+   if (id == VGA_SWITCHEROO_IGD)
+   gmux_write8(apple_gmux_data, GMUX_PORT_SWITCH_DDC, 1);
+   else
+   gmux_write8(apple_gmux_data, GMUX_PORT_SWITCH_DDC, 2);
+
+   return old_ddc_owner;
+}
+
 static int gmux_switchto(enum vga_switcheroo_client_id id)
 {
if (id == VGA_SWITCHEROO_IGD) {
-   gmux_write8(apple_gmux_data, GMUX_PORT_SWITCH_DDC, 1);
gmux_write8(apple_gmux_data, GMUX_PORT_SWITCH_DISPLAY, 2);
gmux_write8(apple_gmux_data, GMUX_PORT_SWITCH_EXTERNAL, 2);
} else {
-   gmux_write8(apple_gmux_data, GMUX_PORT_SWITCH_DDC, 2);
gmux_write8(apple_gmux_data, GMUX_PORT_SWITCH_DISPLAY, 3);
gmux_write8(apple_gmux_data, GMUX_PORT_SWITCH_EXTERNAL, 3);
}
@@ -347,6 +367,7 @@ gmux_active_client(struct apple_gmux_data *gmux_data)
 }

 static struct vga_switcheroo_handler gmux_handler = {
+   .switch_ddc = gmux_switch_ddc,
.switchto = gmux_switchto,
.power_state = gmux_set_power_state,
.get_client_id = gmux_get_client_id,
-- 
2.1.0



[PATCH RFC v3 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders

2015-08-14 Thread Mark Brown
On Fri, Aug 14, 2015 at 12:30:41PM +0300, Jyri Sarha wrote:

> +struct hdmi_codec_ops {
> + /* For runtime clock configuration from ASoC machine driver.
> +  * A direct forward from set_sysclk in struct snd_soc_dai_ops.
> +  * Optional */
> + int (*set_clk)(struct device *dev, int clk_id, int freq);

I'd be much happier if we were using the clock API as the external
interface here, it's where we want to be internally too and it's going
to be easier to not introduce any external dependencies on the ASoC
internal stuff.

> + /* Called when ASoC starts an audio stream setup. The call
> +  * provides an audio abort callback for stoping an ongoing
> +  * stream if the HDMI audio becomes unavailable.
> +  * Optional */
> + int (*audio_startup)(struct device *dev,
> +  void (*abort_cb)(struct device *dev));

I'm a bit confused about what is going to use abort_cb() and why they
wouldn't just call shutdown instead?

> +/* HDMI codec initalization data */
> +struct hdmi_codec_pdata {
> + struct device *dev; /* The HDMI encoder registering the codec */

Shouldn't this just be dev->parent?

> +enum {
> + DAI_ID_I2C = 0,
> + DAI_ID_SPDIF,
> +};

I2C?  :P
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/b55546a5/attachment-0001.sig>


[PATCH RFC v3 2/7] ASoC: hdmi: Remove obsolete dummy HDMI codec

2015-08-14 Thread Mark Brown
On Fri, Aug 14, 2015 at 12:30:40PM +0300, Jyri Sarha wrote:
> The hdmi stub codec has not been used since refactoring of OMAP HDMI
> audio support.

grep tells me that the OMAP HDMI4 and HDMI5 drivers are still
registering this device in -next... 
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/8d991d7f/attachment-0001.sig>


[GIT PULL] drm/panel: Changes for v4.3-rc1

2015-08-14 Thread Thierry Reding
Hi Dave,

The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:

  Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)

are available in the git repository at:

  git://anongit.freedesktop.org/tegra/linux tags/drm/panel/for-4.3-rc1

for you to fetch changes up to b6b8d6ac240bc4e902321d526f10406d476d1fcd:

  drm/bridge: Put Kconfig entries in a separate menu (2015-08-13 14:57:41 +0200)

Thanks,
Thierry


drm/panel: Changes for v4.3-rc1

This introduces support for a couple of new panels and also contains
some work to restructure the directories to get more consistency, to
deal better with more panel and bridge drivers getting added.


Gary Bisson (2):
  of: Add Okaya Electric America vendor prefix
  drm/panel: Add display timing for Okaya RS800480T-7X0GP

Heiko Schocher (1):
  drm/panel: Add support for LG LG4573 480x800 4.3" panel

Philipp Zabel (2):
  drm/panel: simple: Add bus format for HannStar HSD070PWW1 LVDS panel
  drm/panel: simple: Correct minimum hsync length of the HannStar 
HSD070PWW1 panel

Thierry Reding (5):
  drm/exynos: Remove PTN3460 dependency
  drm/panel: Add Samsung prefix to panel drivers
  drm/bridge: Add vendor prefixes
  drm/panel: simple: Add support for AUO B080UAN01
  drm/bridge: Put Kconfig entries in a separate menu

jianwei wang (1):
  drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel

 .../devicetree/bindings/panel/auo,b080uan01.txt|   7 +
 .../devicetree/bindings/panel/lg,lg4573.txt|  19 ++
 .../bindings/panel/nec,nl4827hc19-05b.txt  |   7 +
 .../bindings/panel/okaya,rs800480t-7x0gp.txt   |   7 +
 .../devicetree/bindings/vendor-prefixes.txt|   1 +
 arch/arm/configs/exynos_defconfig  |   6 +-
 arch/arm/configs/multi_v7_defconfig|   6 +-
 drivers/gpu/drm/Kconfig|   4 +-
 drivers/gpu/drm/bridge/Kconfig |  24 +-
 drivers/gpu/drm/bridge/Makefile|   6 +-
 .../gpu/drm/bridge/{ptn3460.c => nxp-ptn3460.c}|   0
 .../gpu/drm/bridge/{ps8622.c => parade-ps8622.c}   |   0
 drivers/gpu/drm/exynos/Kconfig |   2 +-
 drivers/gpu/drm/panel/Kconfig  |  16 +-
 drivers/gpu/drm/panel/Makefile |   5 +-
 drivers/gpu/drm/panel/panel-lg-lg4573.c| 298 +
 .../{panel-ld9040.c => panel-samsung-ld9040.c} |   2 +-
 .../{panel-s6e8aa0.c => panel-samsung-s6e8aa0.c}   |   2 +-
 drivers/gpu/drm/panel/panel-simple.c   |  99 ++-
 19 files changed, 482 insertions(+), 29 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/panel/auo,b080uan01.txt
 create mode 100644 Documentation/devicetree/bindings/panel/lg,lg4573.txt
 create mode 100644 
Documentation/devicetree/bindings/panel/nec,nl4827hc19-05b.txt
 create mode 100644 
Documentation/devicetree/bindings/panel/okaya,rs800480t-7x0gp.txt
 rename drivers/gpu/drm/bridge/{ptn3460.c => nxp-ptn3460.c} (100%)
 rename drivers/gpu/drm/bridge/{ps8622.c => parade-ps8622.c} (100%)
 create mode 100644 drivers/gpu/drm/panel/panel-lg-lg4573.c
 rename drivers/gpu/drm/panel/{panel-ld9040.c => panel-samsung-ld9040.c} (99%)
 rename drivers/gpu/drm/panel/{panel-s6e8aa0.c => panel-samsung-s6e8aa0.c} (99%)


[GIT PULL] drm/tegra: Changes for v4.3-rc1

2015-08-14 Thread Thierry Reding
Hi Dave,

The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:

  Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)

are available in the git repository at:

  git://anongit.freedesktop.org/tegra/linux tags/drm/tegra/for-4.3-rc1

for you to fetch changes up to 459cc2c6800b545a482e428a631d99bca8da7790:

  drm/tegra: sor: Add HDMI support (2015-08-13 13:49:37 +0200)

Thanks,
Thierry


drm/tegra: Changes for v4.3-rc1

There are a bunch of non-critical fixes here that I've collected over
the past few months, but the biggest part is Tegra210 support, in the
DC, DSI and SOR/HDMI drivers.

Also this finally restores DPMS with atomic mode-setting, something
that has been broken since the conversion and which I had originally
expected to take far less longer to fix.


Thierry Reding (41):
  gpu: host1x: mipi: Parameterize to support future SoCs
  gpu: host1x: mipi: Fix clock lane register for DSI
  gpu: host1x: mipi: Clear calibration status
  gpu: host1x: mipi: Constify OF match table
  gpu: host1x: mipi: Add Tegra132 support
  gpu: host1x: mipi: Add Tegra210 support
  gpu: host1x: mipi: Power down regulators when unused
  drm/tegra: Allow VBLANK to be disabled
  drm/tegra: Use SIMPLE_DEV_PM_OPS
  drm/tegra: output: Support low-active hotplug detect
  drm/tegra: dc: Reset VBLANK to off
  drm/tegra: dc: Add Tegra210 support
  drm/tegra: dc: Implement CRC debugfs interface
  drm/tegra: dc: Clarify comment about cursor treatment
  drm/tegra: dc: Remove gratuituous blank line
  drm/tegra: dc: Request syncpoint earlier
  drm/tegra: dc: Record statistics
  drm/tegra: dc: Rename register for consistency
  drm/tegra: dc: Don't explicitly set owner module
  drm/tegra: dc: Rename BASE_COLOR_SIZE* fields
  drm/tegra: dsi: Use proper back-porch for non-sync video mode
  drm/tegra: dsi: Add Tegra124 support
  drm/tegra: dsi: Add Tegra132 support
  drm/tegra: dsi: Add Tegra210 support
  drm/tegra: dpaux: Provide error message in probe
  drm/tegra: dpaux: Configure pads as I2C by default
  drm/tegra: dpaux: Disable interrupt when detached
  drm/tegra: sor: Rename registers for consistency
  drm/tegra: sor: Provide error messages in probe
  drm/tegra: sor: Set minor after debugfs initialization
  drm/tegra: sor: Reset the correct debugfs fields
  drm/tegra: sor: Constify display mode
  drm/tegra: sor: Write correct head state registers
  drm/tegra: sor: Use DRM debugfs infrastructure for CRC
  drm/tegra: rgb: Restore DPMS
  drm/tegra: hdmi: Restore DPMS
  drm/tegra: dsi: Restore DPMS
  drm/tegra: sor: Restore DPMS
  drm/tegra: dc: Implement atomic DPMS
  drm/tegra: sor: Add Tegra210 eDP support
  drm/tegra: sor: Add HDMI support

 .../bindings/gpu/nvidia,tegra20-host1x.txt |8 +-
 drivers/gpu/drm/tegra/dc.c |  294 ++--
 drivers/gpu/drm/tegra/dc.h |   24 +-
 drivers/gpu/drm/tegra/dpaux.c  |   63 +-
 drivers/gpu/drm/tegra/dpaux.h  |2 +
 drivers/gpu/drm/tegra/drm.c|   16 +-
 drivers/gpu/drm/tegra/drm.h|   10 +
 drivers/gpu/drm/tegra/dsi.c|  126 +-
 drivers/gpu/drm/tegra/dsi.h|4 +
 drivers/gpu/drm/tegra/hdmi.c   |   78 +-
 drivers/gpu/drm/tegra/output.c |   20 +-
 drivers/gpu/drm/tegra/rgb.c|   49 +-
 drivers/gpu/drm/tegra/sor.c| 1664 +++-
 drivers/gpu/drm/tegra/sor.h|  298 ++--
 drivers/gpu/host1x/mipi.c  |  253 ++-
 15 files changed, 2104 insertions(+), 805 deletions(-)


[PATCH RFC 5/5] drm/msm: mdp4 lvds: Check the panel node in detect_panel()

2015-08-14 Thread Srinivas Kandagatla
This patch checks if the panel node is disabled in DT or not, this would
let us return proper error code so that the driver could stop panel
specific intialization.

Signed-off-by: Srinivas Kandagatla 
---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c 
b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
index ad02b8b..167f402 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
@@ -262,6 +262,11 @@ static struct drm_panel *detect_panel(struct drm_device 
*dev)

of_node_put(endpoint);

+   if (!of_device_is_available(panel_node)) {
+   dev_err(dev->dev, "panel is not enabled in DT\n");
+   return ERR_PTR(-ENODEV);
+   }
+
panel = of_drm_find_panel(panel_node);
if (!panel) {
of_node_put(panel_node);
-- 
1.9.1



[PATCH RFC 4/5] drm/msm: mdp4 lvds: continue if the panel is not connected

2015-08-14 Thread Srinivas Kandagatla
Two issues:

1> Intializing panel specific bits without actual panel presence.
2> Bailing out if the detect_panel() return -ENODEV.

With the existing code if detect_panel() returns an error code the
driver would bail out without doing anything, However it could continue
intializing hdmi related things. This patch adds two things.

1> moves the panel specific intialization only if the panel is detected
2> let the driver continue with hdmi intialization if detect_panel()
return -ENODEV.

Signed-off-by: Srinivas Kandagatla 
---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 72 +++--
 1 file changed, 41 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c 
b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
index 601dcc0..ad02b8b 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
@@ -313,45 +313,55 @@ static int modeset_init(struct mdp4_kms *mdp4_kms)
if (IS_ERR(panel)) {
ret = PTR_ERR(panel);
dev_err(dev->dev, "failed to detect LVDS panel: %d\n", ret);
-   goto fail;
-   }
+   /**
+* Only fail if there is panel but not ready yet
+* continue with other stuff if there is no panel connected.
+*/
+   if (ret == -EPROBE_DEFER)
+   goto fail;
+   } else {
+   plane = mdp4_plane_init(dev, RGB2, true);
+   if (IS_ERR(plane)) {
+   dev_err(dev->dev,
+   "failed to construct plane for RGB2\n");
+   ret = PTR_ERR(plane);
+   goto fail;
+   }

-   plane = mdp4_plane_init(dev, RGB2, true);
-   if (IS_ERR(plane)) {
-   dev_err(dev->dev, "failed to construct plane for RGB2\n");
-   ret = PTR_ERR(plane);
-   goto fail;
-   }
+   crtc  = mdp4_crtc_init(dev, plane, priv->num_crtcs, 0, DMA_P);
+   if (IS_ERR(crtc)) {
+   dev_err(dev->dev,
+   "failed to construct crtc for DMA_P\n");
+   ret = PTR_ERR(crtc);
+   goto fail;
+   }

-   crtc  = mdp4_crtc_init(dev, plane, priv->num_crtcs, 0, DMA_P);
-   if (IS_ERR(crtc)) {
-   dev_err(dev->dev, "failed to construct crtc for DMA_P\n");
-   ret = PTR_ERR(crtc);
-   goto fail;
-   }
+   encoder = mdp4_lcdc_encoder_init(dev, panel);
+   if (IS_ERR(encoder)) {
+   dev_err(dev->dev,
+   "failed to construct LCDC encoder\n");
+   ret = PTR_ERR(encoder);
+   goto fail;
+   }

-   encoder = mdp4_lcdc_encoder_init(dev, panel);
-   if (IS_ERR(encoder)) {
-   dev_err(dev->dev, "failed to construct LCDC encoder\n");
-   ret = PTR_ERR(encoder);
-   goto fail;
-   }
+   /* LCDC can be hooked to DMA_P: */
+   encoder->possible_crtcs = 1 << priv->num_crtcs;

-   /* LCDC can be hooked to DMA_P: */
-   encoder->possible_crtcs = 1 << priv->num_crtcs;
+   priv->crtcs[priv->num_crtcs++] = crtc;
+   priv->encoders[priv->num_encoders++] = encoder;

-   priv->crtcs[priv->num_crtcs++] = crtc;
-   priv->encoders[priv->num_encoders++] = encoder;
+   connector = mdp4_lvds_connector_init(dev, panel, encoder);
+   if (IS_ERR(connector)) {
+   ret = PTR_ERR(connector);
+   dev_err(dev->dev,
+   "failed to initialize LVDS connector: %d\n",
+   ret);
+   goto fail;
+   }

-   connector = mdp4_lvds_connector_init(dev, panel, encoder);
-   if (IS_ERR(connector)) {
-   ret = PTR_ERR(connector);
-   dev_err(dev->dev, "failed to initialize LVDS connector: %d\n", 
ret);
-   goto fail;
+   priv->connectors[priv->num_connectors++] = connector;
}

-   priv->connectors[priv->num_connectors++] = connector;
-
/*
 * Setup DTV/HDMI path: RGB1 -> DMA_E -> DTV -> HDMI:
 */
-- 
1.9.1



[PATCH RFC 3/5] drm/panel: simple-panel: Add panel picker support.

2015-08-14 Thread Srinivas Kandagatla
This patch adds panel picker support to simple-panel.

The idea of panel picker is to select the correct panel timings if it
supports probing edid via DDC bus, edid contains manufacture ID
and Manufacturer product code, so it can match against the panel_picker
entries to get the correct panel timings.

>From DT point of view the panel picker uses generic compatible string
"panel-simple", keeping the panel specific compatible strings still
supported.

Panels can be static entry in the DT, but practically development boards
like IFC6410 where developers can connect any LVDS panel which makes it
difficult to maintian the dt support for those panels in dts file.
With this dynamic probing via panel picker makes it easy to support such
use-cases.
This patch also adds panel presence detection based, if there is no
panel detected or panel picker could not find the panel then the driver
would mark the panel DT node as disabled so that the drm driver would
be able to take right decision based on that panel node status.

Signed-off-by: Srinivas Kandagatla 
---
 drivers/gpu/drm/panel/panel-simple.c | 83 +++-
 1 file changed, 81 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index f94201b..6c503b2 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -70,6 +71,18 @@ struct panel_desc {
u32 bus_format;
 };

+#define PANEL_PICKER_ENTRY(vend, pid, pdesc) \
+   .vendor = vend, \
+   .product_id = (pid), \
+   .data = (pdesc)
+
+/* Panel picker entry with vendor and product id */
+struct panel_picker_entry {
+   char vendor[4]; /* Vendor string */
+   int product_id; /* product id field */
+   const struct panel_desc *data;
+};
+
 struct panel_simple {
struct drm_panel base;
bool prepared;
@@ -84,6 +97,8 @@ struct panel_simple {
struct gpio_desc *enable_gpio;
 };

+static const struct panel_desc *panel_picker_find_panel(struct edid *edid);
+
 static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
 {
return container_of(panel, struct panel_simple, base);
@@ -276,11 +291,28 @@ static const struct drm_panel_funcs panel_simple_funcs = {
.get_timings = panel_simple_get_timings,
 };

+static void __init simple_panel_node_disable(struct device_node *node)
+{
+   struct property *prop;
+
+   prop = kzalloc(sizeof(*prop), GFP_KERNEL);
+   if (!prop)
+   return;
+
+   prop->name = "status";
+   prop->value = "disabled";
+   prop->length = strlen((char *)prop->value)+1;
+
+   of_update_property(node, prop);
+}
+
+
 static int panel_simple_probe(struct device *dev, const struct panel_desc 
*desc)
 {
struct device_node *backlight, *ddc;
struct panel_simple *panel;
int err;
+   struct edid *edid;

panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
if (!panel)
@@ -288,7 +320,6 @@ static int panel_simple_probe(struct device *dev, const 
struct panel_desc *desc)

panel->enabled = false;
panel->prepared = false;
-   panel->desc = desc;

panel->supply = devm_regulator_get(dev, "power");
if (IS_ERR(panel->supply))
@@ -316,7 +347,25 @@ static int panel_simple_probe(struct device *dev, const 
struct panel_desc *desc)
panel->ddc = of_find_i2c_adapter_by_node(ddc);
of_node_put(ddc);

-   if (!panel->ddc) {
+   if (panel->ddc) {
+   /* detect panel presence */
+   if (!drm_probe_ddc(panel->ddc)) {
+   err = -ENODEV;
+   goto nodev;
+   }
+
+   /* get panel from edid */
+   if (of_device_is_compatible(dev->of_node,
+   "panel-simple")) {
+   edid = drm_get_edid_early(panel->ddc);
+   if (edid) {
+   desc = panel_picker_find_panel(edid);
+   } else {
+   err = -ENODEV;
+   goto nodev;
+   }
+   }
+   } else {
err = -EPROBE_DEFER;
goto free_backlight;
}
@@ -325,6 +374,7 @@ static int panel_simple_probe(struct device *dev, const 
struct panel_desc *desc)
drm_panel_init(>base);
panel->base.dev = dev;
panel->base.funcs = _simple_funcs;
+   panel->desc = desc;

err = drm_panel_add(>base);
if (err < 0)
@@ -334,6 +384,10 @@ static int panel_simple_probe(struct device *dev, const 
struct 

[PATCH RFC 2/5] drm/edid: export edid_vendor()

2015-08-14 Thread Srinivas Kandagatla
This patch exports edid_vendor() match function, so that other drivers
could use it for matching the vendor id.

Signed-off-by: Srinivas Kandagatla 
---
 drivers/gpu/drm/drm_edid.c | 4 ++--
 include/drm/drm_crtc.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 30359cd..e0376ad 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1417,7 +1417,7 @@ EXPORT_SYMBOL(drm_edid_duplicate);
  *
  * Returns true if @vendor is in @edid, false otherwise
  */
-static bool edid_vendor(struct edid *edid, char *vendor)
+bool edid_vendor(struct edid *edid, char *vendor)
 {
char edid_vendor[3];

@@ -1428,7 +1428,7 @@ static bool edid_vendor(struct edid *edid, char *vendor)

return !strncmp(edid_vendor, vendor, 3);
 }
-
+EXPORT_SYMBOL(edid_vendor);
 /**
  * edid_get_quirks - return quirk flags for a given EDID
  * @edid: EDID to process
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 35d8763..bb6dc61 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1332,6 +1332,7 @@ extern struct edid *drm_get_edid(struct drm_connector 
*connector,
 struct i2c_adapter *adapter);
 extern struct edid *drm_get_edid_early(struct i2c_adapter *adapter);
 extern struct edid *drm_edid_duplicate(const struct edid *edid);
+extern bool edid_vendor(struct edid *edid, char *vendor);
 extern int drm_add_edid_modes(struct drm_connector *connector, struct edid 
*edid);
 extern void drm_mode_config_init(struct drm_device *dev);
 extern void drm_mode_config_reset(struct drm_device *dev);
-- 
1.9.1



[PATCH RFC 1/5] drm/edid: Add support to get edid early

2015-08-14 Thread Srinivas Kandagatla
This patch adds support to get edid way early before the connector is
created, this is mainly used for panel drivers to auto-probe the panel
based on the vendor and product id from EDID.

Signed-off-by: Srinivas Kandagatla 
---
 drivers/gpu/drm/drm_edid.c | 8 
 include/drm/drm_crtc.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 7087da3..30359cd 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1388,6 +1388,14 @@ struct edid *drm_get_edid(struct drm_connector 
*connector,
 }
 EXPORT_SYMBOL(drm_get_edid);

+struct edid *drm_get_edid_early(struct i2c_adapter *adapter)
+{
+   struct drm_connector dummy_connector;
+
+   return drm_get_edid(_connector, adapter);
+}
+EXPORT_SYMBOL(drm_get_edid_early);
+
 /**
  * drm_edid_duplicate - duplicate an EDID and the extensions
  * @edid: EDID to duplicate
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 57ca8cc..35d8763 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1330,6 +1330,7 @@ extern void drm_reinit_primary_mode_group(struct 
drm_device *dev);
 extern bool drm_probe_ddc(struct i2c_adapter *adapter);
 extern struct edid *drm_get_edid(struct drm_connector *connector,
 struct i2c_adapter *adapter);
+extern struct edid *drm_get_edid_early(struct i2c_adapter *adapter);
 extern struct edid *drm_edid_duplicate(const struct edid *edid);
 extern int drm_add_edid_modes(struct drm_connector *connector, struct edid 
*edid);
 extern void drm_mode_config_init(struct drm_device *dev);
-- 
1.9.1



[PATCH RFC 0/5] drm/panel: simple: Add panel picker support.

2015-08-14 Thread Srinivas Kandagatla
Hi All,

This patchset adds support to Panel Picker. The idea of panel picker
is to pick a panel and its timing based on "Manufacturer ID" and
"Manufacturer product code" which is available in the EDID.

For now I added only one panel picker entry as a proof of concept,
as we move on we could add more entires to the list.

Reason why I started to look in to this side is
- to have a DT for panel which could work with multiple panels.
- to detect the panel presence.

Simple panel driver supports more than 25 panels, having compatible string
for each to get the panel descriptor. The problem with such approch is that
if we connect a panel to a board whose compatible string is different to
the one mentioned in DT, it would not work, eventhough the simple panel
driver supports it. Maybe we are saying that if we replace a panel
on your phone with different manufacturer it would need a software upgrade? :-)

For example when I submitted a DT patch to add LVDS panel support to IFC6410,
people started asking about two things, 
- How can it work with other panels, as they have different panels then mine.
- Why is the hdmi display resolution changed with a LVDS panel DT entry?
  (this is due to drm driver does not know the panel presence)

>From DT point of view the panel picker uses generic compatible string
"panel-simple", keeping the panel specific compatible strings still
supported.

This patch also adds panel presence detection based, if there is no
panel detected or panel picker could not find the panel then the driver
would mark the panel DT node as disabled so that the drm driver would
be able to take right decision based on that panel node status.

There might be other solutions to this issue, but given the fact that most
of boards we use we do not have access to bootloader code to modify the dt
at runtime, so with that considered we came up with this solution which
works on IFC6410 and would work on other boards too.

I have also included the mdp4 fixes in this series too so that people can
test it on IFC6410.

These are WIP patches to get more inputs and comments.

Thanks,
srini

Srinivas Kandagatla (5):
  drm/edid: Add support to get edid early
  drm/edid: export edid_vendor()
  drm/panel: simple-panel: Add panel picker support.
  drm/msm: mdp4 lvds: continue if the panel is not connected
  drm/msm: mdp4 lvds: Check the panel node in detect_panel()

 drivers/gpu/drm/drm_edid.c  | 12 -
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 77 ++
 drivers/gpu/drm/panel/panel-simple.c| 83 -
 include/drm/drm_crtc.h  |  2 +
 4 files changed, 139 insertions(+), 35 deletions(-)

-- 
1.9.1



[alsa-devel] [PATCH v2 1/9] drm: bridge/dw_hdmi-ahb-audio: add audio driver

2015-08-14 Thread Takashi Iwai
On Fri, 14 Aug 2015 16:04:25 +0200,
Russell King wrote:
> 
> Add ALSA based HDMI AHB audio driver for dw_hdmi.  The only buffer
> format supported by the hardware is its own special IEC958 based format,
> which is not compatible with any ALSA format.  To avoid doing too much
> data manipulation within the driver, we support only ALSAs IEC958 LE and
> 24-bit PCM formats for 2 to 6 channels, which we convert to its hardware
> format.
> 
> A more desirable solution would be to have this conversion in userspace,
> but ALSA does not appear to allow such transformations outside of
> libasound itself.
> 
> Signed-off-by: Russell King 
> ---
> v2: updated with Takashi Iwai's comments... and with a fixed Cc: line.

Reviewed-by: Takashi Iwai 


thanks,

Takashi


>  drivers/gpu/drm/bridge/Kconfig |  10 +
>  drivers/gpu/drm/bridge/Makefile|   1 +
>  drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c | 579 
> +
>  drivers/gpu/drm/bridge/dw_hdmi-audio.h |  13 +
>  drivers/gpu/drm/bridge/dw_hdmi.c   |  24 ++
>  drivers/gpu/drm/bridge/dw_hdmi.h   |   3 +
>  6 files changed, 630 insertions(+)
>  create mode 100644 drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c
>  create mode 100644 drivers/gpu/drm/bridge/dw_hdmi-audio.h
> 
> diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
> index acef3223772c..56ed35fe0734 100644
> --- a/drivers/gpu/drm/bridge/Kconfig
> +++ b/drivers/gpu/drm/bridge/Kconfig
> @@ -3,6 +3,16 @@ config DRM_DW_HDMI
>   depends on DRM
>   select DRM_KMS_HELPER
>  
> +config DRM_DW_HDMI_AHB_AUDIO
> + tristate "Synopsis Designware AHB Audio interface"
> + depends on DRM_DW_HDMI && SND
> + select SND_PCM
> + select SND_PCM_IEC958
> + help
> +   Support the AHB Audio interface which is part of the Synopsis
> +   Designware HDMI block.  This is used in conjunction with
> +   the i.MX6 HDMI driver.
> +
>  config DRM_PTN3460
>   tristate "PTN3460 DP/LVDS bridge"
>   depends on DRM
> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
> index 8dfebd984370..eb80dbbb8365 100644
> --- a/drivers/gpu/drm/bridge/Makefile
> +++ b/drivers/gpu/drm/bridge/Makefile
> @@ -3,3 +3,4 @@ ccflags-y := -Iinclude/drm
>  obj-$(CONFIG_DRM_PS8622) += ps8622.o
>  obj-$(CONFIG_DRM_PTN3460) += ptn3460.o
>  obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o
> +obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw_hdmi-ahb-audio.o
> diff --git a/drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c 
> b/drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c
> new file mode 100644
> index ..bf379310008a
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c
> @@ -0,0 +1,579 @@
> +/*
> + * DesignWare HDMI audio driver
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * Written and tested against the Designware HDMI Tx found in iMX6.
> + */
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "dw_hdmi-audio.h"
> +
> +#define DRIVER_NAME "dw-hdmi-ahb-audio"
> +
> +/* Provide some bits rather than bit offsets */
> +enum {
> + HDMI_AHB_DMA_CONF0_SW_FIFO_RST = BIT(7),
> + HDMI_AHB_DMA_CONF0_EN_HLOCK = BIT(3),
> + HDMI_AHB_DMA_START_START = BIT(0),
> + HDMI_AHB_DMA_STOP_STOP = BIT(0),
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_ERROR = BIT(5),
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_LOST = BIT(4),
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_RETRY = BIT(3),
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_DONE = BIT(2),
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFFULL = BIT(1),
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFEMPTY = BIT(0),
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_ALL =
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_ERROR |
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_LOST |
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_RETRY |
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_DONE |
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFFULL |
> + HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFEMPTY,
> + HDMI_IH_AHBDMAAUD_STAT0_ERROR = BIT(5),
> + HDMI_IH_AHBDMAAUD_STAT0_LOST = BIT(4),
> + HDMI_IH_AHBDMAAUD_STAT0_RETRY = BIT(3),
> + HDMI_IH_AHBDMAAUD_STAT0_DONE = BIT(2),
> + HDMI_IH_AHBDMAAUD_STAT0_BUFFFULL = BIT(1),
> + HDMI_IH_AHBDMAAUD_STAT0_BUFFEMPTY = BIT(0),
> + HDMI_IH_AHBDMAAUD_STAT0_ALL =
> + HDMI_IH_AHBDMAAUD_STAT0_ERROR |
> + HDMI_IH_AHBDMAAUD_STAT0_LOST |
> + HDMI_IH_AHBDMAAUD_STAT0_RETRY |
> + HDMI_IH_AHBDMAAUD_STAT0_DONE |
> + HDMI_IH_AHBDMAAUD_STAT0_BUFFFULL |
> + HDMI_IH_AHBDMAAUD_STAT0_BUFFEMPTY,
> + HDMI_AHB_DMA_CONF0_INCR16 = 2 << 1,
> + HDMI_AHB_DMA_CONF0_INCR8 = 1 << 1,
> + HDMI_AHB_DMA_CONF0_INCR4 = 0,
> + 

[PATCH 12/13] drm/armada: Use drm_crtc_vblank_*() API

2015-08-14 Thread Thierry Reding
On Fri, Aug 14, 2015 at 02:59:16PM +0100, Russell King - ARM Linux wrote:
> On Wed, Aug 12, 2015 at 05:00:34PM +0200, Thierry Reding wrote:
> > From: Thierry Reding 
> > 
> > Non-legacy drivers should only use this API to allow per-CRTC data to be
> > eventually moved into struct drm_crtc.
> > 
> > Cc: Russell King <rmk+kernel at arm.linux.org.uk>
> > Signed-off-by: Thierry Reding 
> 
> What I don't like about the new APIs is that they lookup the CRTC number
> by searching the crtc list on every call to them.  If that's going to be
> fixed, then I'm happy with this change, but if it's going to remain for
> a significant time, I'm really not happy.

This is a temporary measure. The goal is to eventually split off the
VBLANK data into a per-CRTC structure, at which point there will be no
longer any need for the CRTC index.

Thierry
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/f8477908/attachment.sig>


linux-next: build warnings after merge of the drm-misc tree

2015-08-14 Thread Stephen Rothwell
Hi all,

After merging the drm-misc tree, today's linux-next build (arm
multi_v7_defconfig) produced these warnings:

drivers/gpu/drm/exynos/exynos_drm_drv.c:290:2: warning: initialization from 
incompatible pointer type
  .get_vblank_counter = drm_vblank_count,
  ^
drivers/gpu/drm/exynos/exynos_drm_drv.c:290:2: warning: (near initialization 
for 'exynos_drm_driver.get_vblank_counter')
drivers/gpu/drm/rcar-du/rcar_du_drv.c:262:2: warning: initialization from 
incompatible pointer type
  .get_vblank_counter = drm_vblank_count,
  ^
drivers/gpu/drm/rcar-du/rcar_du_drv.c:262:2: warning: (near initialization for 
'rcar_du_driver.get_vblank_counter')
drivers/gpu/drm/msm/msm_drv.c:981:2: warning: initialization from incompatible 
pointer type
  .get_vblank_counter = drm_vblank_count,
  ^
drivers/gpu/drm/msm/msm_drv.c:981:2: warning: (near initialization for 
'msm_driver.get_vblank_counter')

Introduced by commit

  b90180b057f7 ("drm/irq: More pipe/crtc consistency cleanups")

-- 
Cheers,
Stephen Rothwellsfr at canb.auug.org.au


[ANNOUNCE] libdrm 2.4.63

2015-08-14 Thread Marek Olšák
[- xorg-announce]

Hi Jammy,

You can push it whenever you like. I can also make a new libdrm
release whenever I like. There is no strict schedule for libdrm. If
you want another release (e.g. Catalyst needs it, etc.), just let me
know.

Libdrm releases are mostly driven by needs of other projects (e.g.
Mesa). Here I needed libdrm_amdgpu, so I had to release it, so that I
can add a libdrm_amdgpu 2.4.63 dependency into Mesa's configure.ac.

Marek


On Fri, Aug 14, 2015 at 2:53 PM, Zhou, Jammy  wrote:
> Hi Marek,
>
> It looks like the 32bit VA support for libdrm_amdgpu in my recent series are 
> not included.  Do you think we should wait for the next release to include 
> them?
>
> Regards,
> Jammy
>
> -Original Message-
> From: dri-devel [mailto:dri-devel-bounces at lists.freedesktop.org] On Behalf 
> Of Marek Ol?ák
> Sent: Friday, August 14, 2015 8:28 PM
> To: xorg-announce at lists.freedesktop.org; dri-devel at lists.freedesktop.org
> Subject: [ANNOUNCE] libdrm 2.4.63
>
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
> Libdrm 2.4.63 has been released. It contains the new libdrm_amdgpu library.
>
> Alan Coopersmith (1):
>   include  &  directly for major() and minor()
>
> Alex Deucher (10):
>   drm: consolidate common list implementations (v2)
>   drm: add util_math.h
>   drm: add libdrm_amdgpu (v7)
>   drm: add tests/amdgpu (v3)
>   amdgpu: update to the latest kernel header
>   fix configuration when amdgpu is disabled
>   fix amdgpu cunit configure test harder
>   move up cunit workaround for ubuntu/debian
>   add a note about which version of cunit is fixed for debian/ubuntu
>   radeon: add new OLAND pci id
>
> Alexandr Akulich (1):
>   libdrm/amdgpu: Fixed drm.h include.
>
> Anuj Phogat (2):
>   i965/gen9: Pass alignment as function parameter in 
> drm_intel_gem_bo_alloc_internal()
>   Set alignment value in drm_intel_add_validate_buffer()
>
> Chris Wilson (1):
>   drm: Detect no-op drmModeAtomicRequest and return early
>
> Christian König (16):
>   amdgpu: cleanup public interface v2
>   amdgpu: add public bo list interface v3
>   amdgpu: compare the primary device names instead
>   amdgpu: remove bo_vas hash table v2
>   amdgpu: add helper for VM mapping v2
>   amdgpu: stop checking flag masks
>   amdgpu: explicitly unmap GPU mapping on BO destruction
>   amdgpu: remove flink export workaround v2
>   amdgpu: cleanup VA IOCTL handling
>   amdgpu: remove pointer arithmetic from command submission
>   amdgpu: add CS dependencies v2
>   gitignore: add some generated amdgpu files
>   amdgpu: cleanup public interface style
>   amdgpu: remove reference to AMD specific error codes
>   amdgpu: use common fence structure for dependencies as well.
>   amdgpu: fix bs buffer size for vce test
>
> Emil Velikov (15):
>   configure: default --enable-valgrind to auto
>   freedreno: zero is a valid fd number, treat it as such
>   omap: zero is a valid fd number, treat it as such
>   xf86drm: fix incorrect fd comparison in drmOpenOnce{,WithType}
>   Consistently check the fd value
>   man: remove .man_fixup workaround
>   Force enable amdgpu for the dist build/check.
>   amdgpu/util_hash: hide private symbols from global namespace
>   amdgpu/util_hash_table: hide private symbols from global namespace
>   amdgpu: add a bunch of missing config.h includes
>   amdgpu: cosmetic chances in license boilerplate
>   amdgpu: squash trivial documentation typo
>   amdgpu/amdgpu_vamgr: hide private symbols from global namespace
>   amdgpu: hide the final internal functions from global namespace
>   amdgpu: add symbols check test
>
> Jack Xiao (2):
>   amdgpu: fix round down/up page size error
>   amdgpu: add zero timeout check in amdgpu_cs_query_fence_status
>
> Jammy Zhou (24):
>   amdgpu: remove active_rb_pipes from amdgpu_gpu_info
>   amdgpu: remove AMDGPU_GEM_CREATE_CPU_GTT_UC
>   amdgpu: fix 32-on-64 support (v2)
>   amdgpu: add ctx_id for wait_cs
>   amdgpu: reuse the kernel IB flags v2
>   amdgpu: validate the upper limit of virtual address v2
>   amdgpu: fix the number of IB size enums
>   amdgpu: remove unused AMDGPU_IB_RESOURCE_PRIORITY
>   amdgpu: replace alloca with calloc v2
>   amdgpu: add amdgpu_bo_list_update interface v2
>   amdgpu: add IB sharing support v2
>   tests/amdgpu: add shared IB submission test v2
>   amdgpu: get rid of IB pool management v3
>   tests/amdgpu: manage IB in client side
>   amdgpu: add amdgpu_query_gds_info
>   amdgpu: cleanup gds specific alloc/free functions
>   amdgpu: merge amdgpu_drm.h from kernel
>   amdgpu: do NULL check for bo handle in amdgpu_bo_query_info
>   amdgpu: improve the amdgpu_cs_query_fence_status interface
>   drm: fix the ALIGN macro to avoid value clamp
>   tests/amdgpu: remove 

[PATCH v2 1/9] drm: bridge/dw_hdmi-ahb-audio: add audio driver

2015-08-14 Thread Russell King
Add ALSA based HDMI AHB audio driver for dw_hdmi.  The only buffer
format supported by the hardware is its own special IEC958 based format,
which is not compatible with any ALSA format.  To avoid doing too much
data manipulation within the driver, we support only ALSAs IEC958 LE and
24-bit PCM formats for 2 to 6 channels, which we convert to its hardware
format.

A more desirable solution would be to have this conversion in userspace,
but ALSA does not appear to allow such transformations outside of
libasound itself.

Signed-off-by: Russell King 
---
v2: updated with Takashi Iwai's comments... and with a fixed Cc: line.

 drivers/gpu/drm/bridge/Kconfig |  10 +
 drivers/gpu/drm/bridge/Makefile|   1 +
 drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c | 579 +
 drivers/gpu/drm/bridge/dw_hdmi-audio.h |  13 +
 drivers/gpu/drm/bridge/dw_hdmi.c   |  24 ++
 drivers/gpu/drm/bridge/dw_hdmi.h   |   3 +
 6 files changed, 630 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c
 create mode 100644 drivers/gpu/drm/bridge/dw_hdmi-audio.h

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index acef3223772c..56ed35fe0734 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -3,6 +3,16 @@ config DRM_DW_HDMI
depends on DRM
select DRM_KMS_HELPER

+config DRM_DW_HDMI_AHB_AUDIO
+   tristate "Synopsis Designware AHB Audio interface"
+   depends on DRM_DW_HDMI && SND
+   select SND_PCM
+   select SND_PCM_IEC958
+   help
+ Support the AHB Audio interface which is part of the Synopsis
+ Designware HDMI block.  This is used in conjunction with
+ the i.MX6 HDMI driver.
+
 config DRM_PTN3460
tristate "PTN3460 DP/LVDS bridge"
depends on DRM
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index 8dfebd984370..eb80dbbb8365 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -3,3 +3,4 @@ ccflags-y := -Iinclude/drm
 obj-$(CONFIG_DRM_PS8622) += ps8622.o
 obj-$(CONFIG_DRM_PTN3460) += ptn3460.o
 obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o
+obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw_hdmi-ahb-audio.o
diff --git a/drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c 
b/drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c
new file mode 100644
index ..bf379310008a
--- /dev/null
+++ b/drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c
@@ -0,0 +1,579 @@
+/*
+ * DesignWare HDMI audio driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Written and tested against the Designware HDMI Tx found in iMX6.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "dw_hdmi-audio.h"
+
+#define DRIVER_NAME "dw-hdmi-ahb-audio"
+
+/* Provide some bits rather than bit offsets */
+enum {
+   HDMI_AHB_DMA_CONF0_SW_FIFO_RST = BIT(7),
+   HDMI_AHB_DMA_CONF0_EN_HLOCK = BIT(3),
+   HDMI_AHB_DMA_START_START = BIT(0),
+   HDMI_AHB_DMA_STOP_STOP = BIT(0),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_ERROR = BIT(5),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_LOST = BIT(4),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_RETRY = BIT(3),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_DONE = BIT(2),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFFULL = BIT(1),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFEMPTY = BIT(0),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_ALL =
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_ERROR |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_LOST |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_RETRY |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_DONE |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFFULL |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFEMPTY,
+   HDMI_IH_AHBDMAAUD_STAT0_ERROR = BIT(5),
+   HDMI_IH_AHBDMAAUD_STAT0_LOST = BIT(4),
+   HDMI_IH_AHBDMAAUD_STAT0_RETRY = BIT(3),
+   HDMI_IH_AHBDMAAUD_STAT0_DONE = BIT(2),
+   HDMI_IH_AHBDMAAUD_STAT0_BUFFFULL = BIT(1),
+   HDMI_IH_AHBDMAAUD_STAT0_BUFFEMPTY = BIT(0),
+   HDMI_IH_AHBDMAAUD_STAT0_ALL =
+   HDMI_IH_AHBDMAAUD_STAT0_ERROR |
+   HDMI_IH_AHBDMAAUD_STAT0_LOST |
+   HDMI_IH_AHBDMAAUD_STAT0_RETRY |
+   HDMI_IH_AHBDMAAUD_STAT0_DONE |
+   HDMI_IH_AHBDMAAUD_STAT0_BUFFFULL |
+   HDMI_IH_AHBDMAAUD_STAT0_BUFFEMPTY,
+   HDMI_AHB_DMA_CONF0_INCR16 = 2 << 1,
+   HDMI_AHB_DMA_CONF0_INCR8 = 1 << 1,
+   HDMI_AHB_DMA_CONF0_INCR4 = 0,
+   HDMI_AHB_DMA_CONF0_BURST_MODE = BIT(0),
+   HDMI_AHB_DMA_MASK_DONE = BIT(7),
+   HDMI_REVISION_ID = 0x0001,
+   HDMI_IH_AHBDMAAUD_STAT0 = 0x0109,
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0 = 0x0189,
+   HDMI_AHB_DMA_CONF0 = 0x3600,
+   HDMI_AHB_DMA_START = 

[PATCH 12/13] drm/armada: Use drm_crtc_vblank_*() API

2015-08-14 Thread Russell King - ARM Linux
On Wed, Aug 12, 2015 at 05:00:34PM +0200, Thierry Reding wrote:
> From: Thierry Reding 
> 
> Non-legacy drivers should only use this API to allow per-CRTC data to be
> eventually moved into struct drm_crtc.
> 
> Cc: Russell King 
> Signed-off-by: Thierry Reding 

What I don't like about the new APIs is that they lookup the CRTC number
by searching the crtc list on every call to them.  If that's going to be
fixed, then I'm happy with this change, but if it's going to remain for
a significant time, I'm really not happy.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.


[RFC 11/13] drm/dp: Add helper to dump DPCD

2015-08-14 Thread Jani Nikula
On Wed, 12 Aug 2015, Thierry Reding  wrote:
> From: Thierry Reding 
>
> The new drm_dp_dpcd_dump() helper dumps the contents of a DPCD to a
> seq_file and can be used to make the DPCD available via debugfs for
> example.

See i915/i915_debugfs.c for one DPCD dump implementation.

Around the time that was added, there was also some discussion (and
patches [1]) to expose a read/write debugfs interface to DPCD, letting
userspace access arbitrary DPCD registers.

Just this week there was some discussion about revisiting that. It was
about accessing some proprietary panel features, but there's also the
ease of debugging without having to keep updating the kernel to dump
more.

I think it would be great to agree on a common debugfs interface to
access DPCD arbitrarily. Last time I checked, the blocker to that was
access to the aux channel from generic code; it's always driver
specific. SMOP. ;)

I could put some effort into this (maybe Rafael too?), as long as we
could agree on the interface. As I wrote in the referenced thread, I
wasn't thrilled about what was proposed.

BR,
Jani.


[1] http://mid.gmane.org/1428493301-20293-1-git-send-email-durgadoss.r at 
intel.com



>
> Signed-off-by: Thierry Reding 
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 146 
> 
>  include/drm/drm_dp_helper.h |   2 +
>  2 files changed, 148 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index 8968201ea93c..ea74884c9cb3 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -27,6 +27,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  
> @@ -292,6 +293,151 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  }
>  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>  
> +/**
> + * drm_dp_dpcd_dump() - dump DPCD content
> + * @aux: DisplayPort AUX channel
> + * @s: destination for DPCD dump
> + *
> + * Reads registers from the DPCD via a DisplayPort AUX channel and dumps them
> + * to a seq_file.
> + */
> +void drm_dp_dpcd_dump(struct drm_dp_aux *aux, struct seq_file *s)
> +{
> +#define DUMP_REG(aux, offset) ({ \
> + u8 value;   \
> + int err;\
> + err = drm_dp_dpcd_readb(aux, offset, );   \
> + if (err < 0) {  \
> + dev_err((aux)->dev, "failed to read %s: %d\n",  \
> + #offset, err);  \
> + return; \
> + }   \
> + seq_printf(s, "%-35s 0x%04x 0x%02x\n", #offset, offset, \
> +value);  \
> + })
> +
> + DUMP_REG(aux, DP_DPCD_REV);
> + DUMP_REG(aux, DP_MAX_LINK_RATE);
> + DUMP_REG(aux, DP_MAX_LANE_COUNT);
> + DUMP_REG(aux, DP_MAX_DOWNSPREAD);
> + DUMP_REG(aux, DP_NORP);
> + DUMP_REG(aux, DP_DOWNSTREAMPORT_PRESENT);
> + DUMP_REG(aux, DP_MAIN_LINK_CHANNEL_CODING);
> + DUMP_REG(aux, DP_DOWN_STREAM_PORT_COUNT);
> + DUMP_REG(aux, DP_RECEIVE_PORT_0_CAP_0);
> + DUMP_REG(aux, DP_RECEIVE_PORT_0_BUFFER_SIZE);
> + DUMP_REG(aux, DP_RECEIVE_PORT_1_CAP_0);
> + DUMP_REG(aux, DP_RECEIVE_PORT_1_BUFFER_SIZE);
> + DUMP_REG(aux, DP_I2C_SPEED_CAP);
> + DUMP_REG(aux, DP_EDP_CONFIGURATION_CAP);
> + DUMP_REG(aux, DP_TRAINING_AUX_RD_INTERVAL);
> + DUMP_REG(aux, DP_ADAPTER_CAP);
> + DUMP_REG(aux, DP_SUPPORTED_LINK_RATES);
> + DUMP_REG(aux, DP_FAUX_CAP);
> + DUMP_REG(aux, DP_MSTM_CAP);
> + DUMP_REG(aux, DP_NUMBER_OF_AUDIO_ENDPOINTS);
> + DUMP_REG(aux, DP_AV_GRANULARITY);
> + DUMP_REG(aux, DP_AUD_DEC_LAT0);
> + DUMP_REG(aux, DP_AUD_DEC_LAT1);
> + DUMP_REG(aux, DP_AUD_PP_LAT0);
> + DUMP_REG(aux, DP_AUD_PP_LAT1);
> + DUMP_REG(aux, DP_VID_INTER_LAT);
> + DUMP_REG(aux, DP_VID_PROG_LAT);
> + DUMP_REG(aux, DP_REP_LAT);
> + DUMP_REG(aux, DP_AUD_DEL_INS0);
> + DUMP_REG(aux, DP_AUD_DEL_INS1);
> + DUMP_REG(aux, DP_AUD_DEL_INS2);
> + DUMP_REG(aux, DP_RECEIVER_ALPM_CAP);
> + DUMP_REG(aux, DP_AUD_DEL_INS0);
> + DUMP_REG(aux, DP_GUID);
> + DUMP_REG(aux, DP_PSR_SUPPORT);
> + DUMP_REG(aux, DP_PSR_CAPS);
> + DUMP_REG(aux, DP_DOWNSTREAM_PORT_0);
> + DUMP_REG(aux, DP_LINK_BW_SET);
> + DUMP_REG(aux, DP_LANE_COUNT_SET);
> + DUMP_REG(aux, DP_TRAINING_PATTERN_SET);
> + DUMP_REG(aux, DP_TRAINING_LANE0_SET);
> + DUMP_REG(aux, DP_TRAINING_LANE1_SET);
> + DUMP_REG(aux, DP_TRAINING_LANE2_SET);
> + DUMP_REG(aux, DP_TRAINING_LANE3_SET);
> + DUMP_REG(aux, DP_DOWNSPREAD_CTRL);
> + DUMP_REG(aux, DP_MAIN_LINK_CHANNEL_CODING_SET);
> + DUMP_REG(aux, 

[PATCH v2 1/9] drm: bridge/dw_hdmi-ahb-audio: add audio driver David Airlie <airl...@linux.ie>, Sascha Hauer <s.ha...@pengutronix.de>, linux-ker...@vger.kernel.org, dri-devel@lists.freedesktop.org, Ja

2015-08-14 Thread Russell King
Add ALSA based HDMI AHB audio driver for dw_hdmi.  The only buffer
format supported by the hardware is its own special IEC958 based format,
which is not compatible with any ALSA format.  To avoid doing too much
data manipulation within the driver, we support only ALSAs IEC958 LE and
24-bit PCM formats for 2 to 6 channels, which we convert to its hardware
format.

A more desirable solution would be to have this conversion in userspace,
but ALSA does not appear to allow such transformations outside of
libasound itself.

Signed-off-by: Russell King 
---
v2: updated with Takashi Iwai's comments.

 drivers/gpu/drm/bridge/Kconfig |  10 +
 drivers/gpu/drm/bridge/Makefile|   1 +
 drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c | 579 +
 drivers/gpu/drm/bridge/dw_hdmi-audio.h |  13 +
 drivers/gpu/drm/bridge/dw_hdmi.c   |  24 ++
 drivers/gpu/drm/bridge/dw_hdmi.h   |   3 +
 6 files changed, 630 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c
 create mode 100644 drivers/gpu/drm/bridge/dw_hdmi-audio.h

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index acef3223772c..56ed35fe0734 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -3,6 +3,16 @@ config DRM_DW_HDMI
depends on DRM
select DRM_KMS_HELPER

+config DRM_DW_HDMI_AHB_AUDIO
+   tristate "Synopsis Designware AHB Audio interface"
+   depends on DRM_DW_HDMI && SND
+   select SND_PCM
+   select SND_PCM_IEC958
+   help
+ Support the AHB Audio interface which is part of the Synopsis
+ Designware HDMI block.  This is used in conjunction with
+ the i.MX6 HDMI driver.
+
 config DRM_PTN3460
tristate "PTN3460 DP/LVDS bridge"
depends on DRM
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index 8dfebd984370..eb80dbbb8365 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -3,3 +3,4 @@ ccflags-y := -Iinclude/drm
 obj-$(CONFIG_DRM_PS8622) += ps8622.o
 obj-$(CONFIG_DRM_PTN3460) += ptn3460.o
 obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o
+obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw_hdmi-ahb-audio.o
diff --git a/drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c 
b/drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c
new file mode 100644
index ..bf379310008a
--- /dev/null
+++ b/drivers/gpu/drm/bridge/dw_hdmi-ahb-audio.c
@@ -0,0 +1,579 @@
+/*
+ * DesignWare HDMI audio driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Written and tested against the Designware HDMI Tx found in iMX6.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "dw_hdmi-audio.h"
+
+#define DRIVER_NAME "dw-hdmi-ahb-audio"
+
+/* Provide some bits rather than bit offsets */
+enum {
+   HDMI_AHB_DMA_CONF0_SW_FIFO_RST = BIT(7),
+   HDMI_AHB_DMA_CONF0_EN_HLOCK = BIT(3),
+   HDMI_AHB_DMA_START_START = BIT(0),
+   HDMI_AHB_DMA_STOP_STOP = BIT(0),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_ERROR = BIT(5),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_LOST = BIT(4),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_RETRY = BIT(3),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_DONE = BIT(2),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFFULL = BIT(1),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFEMPTY = BIT(0),
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_ALL =
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_ERROR |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_LOST |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_RETRY |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_DONE |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFFULL |
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0_BUFFEMPTY,
+   HDMI_IH_AHBDMAAUD_STAT0_ERROR = BIT(5),
+   HDMI_IH_AHBDMAAUD_STAT0_LOST = BIT(4),
+   HDMI_IH_AHBDMAAUD_STAT0_RETRY = BIT(3),
+   HDMI_IH_AHBDMAAUD_STAT0_DONE = BIT(2),
+   HDMI_IH_AHBDMAAUD_STAT0_BUFFFULL = BIT(1),
+   HDMI_IH_AHBDMAAUD_STAT0_BUFFEMPTY = BIT(0),
+   HDMI_IH_AHBDMAAUD_STAT0_ALL =
+   HDMI_IH_AHBDMAAUD_STAT0_ERROR |
+   HDMI_IH_AHBDMAAUD_STAT0_LOST |
+   HDMI_IH_AHBDMAAUD_STAT0_RETRY |
+   HDMI_IH_AHBDMAAUD_STAT0_DONE |
+   HDMI_IH_AHBDMAAUD_STAT0_BUFFFULL |
+   HDMI_IH_AHBDMAAUD_STAT0_BUFFEMPTY,
+   HDMI_AHB_DMA_CONF0_INCR16 = 2 << 1,
+   HDMI_AHB_DMA_CONF0_INCR8 = 1 << 1,
+   HDMI_AHB_DMA_CONF0_INCR4 = 0,
+   HDMI_AHB_DMA_CONF0_BURST_MODE = BIT(0),
+   HDMI_AHB_DMA_MASK_DONE = BIT(7),
+   HDMI_REVISION_ID = 0x0001,
+   HDMI_IH_AHBDMAAUD_STAT0 = 0x0109,
+   HDMI_IH_MUTE_AHBDMAAUD_STAT0 = 0x0189,
+   HDMI_AHB_DMA_CONF0 = 0x3600,
+   HDMI_AHB_DMA_START = 0x3601,
+   HDMI_AHB_DMA_STOP 

linux-next: build warnings after merge of the drm-misc tree

2015-08-14 Thread Thierry Reding
On Fri, Aug 14, 2015 at 03:35:32PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the drm-misc tree, today's linux-next build (arm
> multi_v7_defconfig) produced these warnings:
> 
> drivers/gpu/drm/exynos/exynos_drm_drv.c:290:2: warning: initialization from 
> incompatible pointer type
>   .get_vblank_counter = drm_vblank_count,
>   ^
> drivers/gpu/drm/exynos/exynos_drm_drv.c:290:2: warning: (near initialization 
> for 'exynos_drm_driver.get_vblank_counter')
> drivers/gpu/drm/rcar-du/rcar_du_drv.c:262:2: warning: initialization from 
> incompatible pointer type
>   .get_vblank_counter = drm_vblank_count,
>   ^
> drivers/gpu/drm/rcar-du/rcar_du_drv.c:262:2: warning: (near initialization 
> for 'rcar_du_driver.get_vblank_counter')
> drivers/gpu/drm/msm/msm_drv.c:981:2: warning: initialization from 
> incompatible pointer type
>   .get_vblank_counter = drm_vblank_count,
>   ^
> drivers/gpu/drm/msm/msm_drv.c:981:2: warning: (near initialization for 
> 'msm_driver.get_vblank_counter')
> 
> Introduced by commit
> 
>   b90180b057f7 ("drm/irq: More pipe/crtc consistency cleanups")

Yes, that patch turned out to be incomplete. Daniel suggested to remove
it from drm-misc for now and I'll address this fully in a larger patch
for 4.4.

Thierry
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/68acf0fa/attachment.sig>


[PATCH] drm/sti: Do not export symbols

2015-08-14 Thread Benjamin Gaignard
This patch break sti driver compilation when it is compile as module.
The root cause is that sti driver is split in 4 modules (hdmi, dvo,
compositor and driver)...
Maybe that is something we could fix since binding issue has been fix
in previous patch.

Benjamin


[PATCH] drm/amdgpu: Avoid possibly uninitialized variable

2015-08-14 Thread Christian König
On 14.08.2015 13:52, Thierry Reding wrote:
> From: Thierry Reding 
>
> The min_ctx_size is only initialized for H265, so garbage will end up in
> buf_sizes[4] for all other stream types. Better initialize the value to
> 0 to avoid unpleasant surprises.
>
> Signed-off-by: Thierry Reding 

Reviewed-by: Christian König 

We already stumbled over this internally as well, not sure if Alex is 
going to merge your patch or the internal version.

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index f5c22556ec2c..91e79c3f2403 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -374,7 +374,7 @@ static int amdgpu_uvd_cs_msg_decode(uint32_t *msg, 
> unsigned buf_sizes[])
>   unsigned height_in_mb = ALIGN(height / 16, 2);
>   unsigned fs_in_mb = width_in_mb * height_in_mb;
>   
> - unsigned image_size, tmp, min_dpb_size, num_dpb_buffer, min_ctx_size;
> + unsigned image_size, tmp, min_dpb_size, num_dpb_buffer, min_ctx_size = 
> 0;
>   
>   image_size = width * height;
>   image_size += image_size / 2;



[PATCH 3/3] drm/sti: Select FW_LOADER

2015-08-14 Thread Benjamin Gaignard
you can add my ack-by on this patch

2015-08-14 12:50 GMT+02:00 Thierry Reding :
> From: Thierry Reding 
>
> Select FW_LOADER explicitly to satify the direct dependency of
> FW_LOADER_USER_HELPER_FALLBACK.
>
> Cc: Benjamin Gaignard 
> Signed-off-by: Thierry Reding 
> ---
>  drivers/gpu/drm/sti/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/sti/Kconfig b/drivers/gpu/drm/sti/Kconfig
> index fbccc105819b..0a9048c47b95 100644
> --- a/drivers/gpu/drm/sti/Kconfig
> +++ b/drivers/gpu/drm/sti/Kconfig
> @@ -6,6 +6,7 @@ config DRM_STI
> select DRM_GEM_CMA_HELPER
> select DRM_KMS_CMA_HELPER
> select DRM_PANEL
> +   select FW_LOADER
> select FW_LOADER_USER_HELPER_FALLBACK
> help
>   Choose this option to enable DRM on STM stiH41x chipset
> --
> 2.4.5
>



-- 
Benjamin Gaignard

Graphic Working Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog


[ANNOUNCE] libdrm 2.4.63

2015-08-14 Thread Marek Olšák

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Libdrm 2.4.63 has been released. It contains the new libdrm_amdgpu library.

Alan Coopersmith (1):
  include  &  directly for major() and minor()

Alex Deucher (10):
  drm: consolidate common list implementations (v2)
  drm: add util_math.h
  drm: add libdrm_amdgpu (v7)
  drm: add tests/amdgpu (v3)
  amdgpu: update to the latest kernel header
  fix configuration when amdgpu is disabled
  fix amdgpu cunit configure test harder
  move up cunit workaround for ubuntu/debian
  add a note about which version of cunit is fixed for debian/ubuntu
  radeon: add new OLAND pci id

Alexandr Akulich (1):
  libdrm/amdgpu: Fixed drm.h include.

Anuj Phogat (2):
  i965/gen9: Pass alignment as function parameter in 
drm_intel_gem_bo_alloc_internal()
  Set alignment value in drm_intel_add_validate_buffer()

Chris Wilson (1):
  drm: Detect no-op drmModeAtomicRequest and return early

Christian König (16):
  amdgpu: cleanup public interface v2
  amdgpu: add public bo list interface v3
  amdgpu: compare the primary device names instead
  amdgpu: remove bo_vas hash table v2
  amdgpu: add helper for VM mapping v2
  amdgpu: stop checking flag masks
  amdgpu: explicitly unmap GPU mapping on BO destruction
  amdgpu: remove flink export workaround v2
  amdgpu: cleanup VA IOCTL handling
  amdgpu: remove pointer arithmetic from command submission
  amdgpu: add CS dependencies v2
  gitignore: add some generated amdgpu files
  amdgpu: cleanup public interface style
  amdgpu: remove reference to AMD specific error codes
  amdgpu: use common fence structure for dependencies as well.
  amdgpu: fix bs buffer size for vce test

Emil Velikov (15):
  configure: default --enable-valgrind to auto
  freedreno: zero is a valid fd number, treat it as such
  omap: zero is a valid fd number, treat it as such
  xf86drm: fix incorrect fd comparison in drmOpenOnce{,WithType}
  Consistently check the fd value
  man: remove .man_fixup workaround
  Force enable amdgpu for the dist build/check.
  amdgpu/util_hash: hide private symbols from global namespace
  amdgpu/util_hash_table: hide private symbols from global namespace
  amdgpu: add a bunch of missing config.h includes
  amdgpu: cosmetic chances in license boilerplate
  amdgpu: squash trivial documentation typo
  amdgpu/amdgpu_vamgr: hide private symbols from global namespace
  amdgpu: hide the final internal functions from global namespace
  amdgpu: add symbols check test

Jack Xiao (2):
  amdgpu: fix round down/up page size error
  amdgpu: add zero timeout check in amdgpu_cs_query_fence_status

Jammy Zhou (24):
  amdgpu: remove active_rb_pipes from amdgpu_gpu_info
  amdgpu: remove AMDGPU_GEM_CREATE_CPU_GTT_UC
  amdgpu: fix 32-on-64 support (v2)
  amdgpu: add ctx_id for wait_cs
  amdgpu: reuse the kernel IB flags v2
  amdgpu: validate the upper limit of virtual address v2
  amdgpu: fix the number of IB size enums
  amdgpu: remove unused AMDGPU_IB_RESOURCE_PRIORITY
  amdgpu: replace alloca with calloc v2
  amdgpu: add amdgpu_bo_list_update interface v2
  amdgpu: add IB sharing support v2
  tests/amdgpu: add shared IB submission test v2
  amdgpu: get rid of IB pool management v3
  tests/amdgpu: manage IB in client side
  amdgpu: add amdgpu_query_gds_info
  amdgpu: cleanup gds specific alloc/free functions
  amdgpu: merge amdgpu_drm.h from kernel
  amdgpu: do NULL check for bo handle in amdgpu_bo_query_info
  amdgpu: improve the amdgpu_cs_query_fence_status interface
  drm: fix the ALIGN macro to avoid value clamp
  tests/amdgpu: remove the duplicate IB allocation for VCE test
  amdgpu: add flags parameter for amdgpu_va_range_alloc
  amdgpu: add amdgpu_bo_va_op for va map/unmap support v3
  amdgpu: expose the PCI revision ID

Jonathan Gray (3):
  xf86drmMode: Implement drmCheckModesettingSupported() for OpenBSD
  xf86drm: correct the OpenBSD DRM_MAJOR define
  xf86drm: use the correct device minor names on OpenBSD

Joonyoung Shim (1):
  Build vbltest irrespective of the presence of libudev.

Julien Cristau (1):
  Fix headers inclusion in xf86drmMode.c

Ken Wang (8):
  amdgpu: make vamgr global
  amdgpu: add max_memory_clock for interface query
  amdgpu: add vram_type and vram_bit_width for interface query
  amdgpu: add ce_ram_size for interface query
  amdgpu: add ib_start_alignment and ib_size_alignment for interface query
  amdgpu: add base_preferred parameter to amdgpu_vamgr_find_va
  amdgpu : move management of user fence from libdrm to UMD
  test/amdgpu : fix a bug in VCE/UVD test introduced by previous change

Kristian Høgsberg Kristensen (1):
  intel: Drop aub dumping functionality

Leo Liu (2):
  

[PATCH 0/4] Add support for Hyperlinks and Markup on kernel-doc

2015-08-14 Thread Danilo Cesar Lemes de Paula
On 08/13/2015 08:20 PM, Jonathan Corbet wrote:
> On Thu, 13 Aug 2015 20:09:35 -0300
> Danilo Cesar Lemes de Paula  wrote:
> 
>> Did you find time to take a look on this?
> 
> No.  Just when I thought things couldn't get crazier, my laptop died.  
> 
>   https://plus.google.com/+JonathanCorbet/posts/FBHp48dPb95
> 
> What spare time I had has been dedicated to recovering from that in time
> to give my talk next week.

Those evil machines... =)

>  
>> I understand that there's some discussion behind the curtains regarding
>> the markdown support, but the cross-reference-hyperlink patch is also in
>> the same patch series. It doesn't change any text in the docbook unless
>> there's really a cross-reference link to it. Different from the markdown
>> support (when people start to use markdown to write docs it will be hard
>> to go back), the cross-link stuff doesn't require/create any change to
>> current documentation, it is pretty safe to use.
>>
>> Would you mind to share your plans about this?
> 
> No behind-the-curtains discussions happening, or, let's say, if there
> are, I've not been invited either.

I meant the Kernel summit mailing list, but looks like that thread died
even before my patches.

> 
> I'd like to get back to the cross-reference stuff.  Last I tried, it
> failed while building the media docs; have you been able to look at
> that?  

I did, and I didn't find anything.
Media API already spits lots of warnings without my patch. I did send
those warnings to a file and count them. My patch produces the same
amount of warnings as the original branch.
I did, however, use a clean build to test that. Daniel Vetter complained
that the Documentation was being rebuilt all the time, something wrong
with the dependencies. I did fix that in v2. Maybe the errors you got
were related to it?


> 
> Longer term, as you may know from the kernel summit discussions, I'd
> really like to get rid of a lot of the XML gunk and put in something more
> straightforward, be it based on Markdown or something else.  Doing that,
> however, requires that I find the time to implement something that's
> convincingly better.  It may happen soon, but I sure can't guarantee it.
> 
> Meanwhile, I think it would be a horrible mistake to delay useful work
> because I have a gleam in my eye to do something different one of these
> years, so I'll not do that.  I fully expect to merge all of the stuff
> you've done, I just need to have a good look at it and test it out a
> bit.  As I said before, I can't promise that for the 4.3 merge window,
> but I'll try.
> 
> Apologies,

No need to apologize, just wanted to know what was going on.

Danilo Cesar


[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Emil Velikov
On 14/08/15 13:45, Zhou, Jammy wrote:
> That's okay. Shall we get this patch merged now if no other objections?
> 
First we should fix the funny vendor/device/etc id issue. Otherwise the
API is bugged badly.

-Emil


[Bug 91291] kernel panic and freeze on resume in [radeon] [ttm]

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=91291

--- Comment #7 from Kamil Páral  ---
For the record, this got reported here:
https://bugzilla.kernel.org/show_bug.cgi?id=102321

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/a3d8f41b/attachment-0001.html>


[git pull] vmwgfx-fixes-4.2

2015-08-14 Thread Thomas Hellstrom
On 08/14/2015 02:04 PM, Thomas Hellstrom wrote:
> Dave, 
> A single commit Cc'd stable. Causes deadlocks under graphics memory pressures.

Dave,

Just saw that this was already in your latest pull request to Linus, so
never mind this.

Thanks,
Thomas



[PATCH] drm/sti: Do not export symbols

2015-08-14 Thread Thierry Reding
From: Thierry Reding 

None of these exported symbols are used outside of the drm-sti driver,
so there is no reason to export them.

Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/sti/sti_drm_crtc.c  | 3 ---
 drivers/gpu/drm/sti/sti_drm_plane.c | 1 -
 drivers/gpu/drm/sti/sti_hqvdp.c | 1 -
 drivers/gpu/drm/sti/sti_layer.c | 2 --
 drivers/gpu/drm/sti/sti_vtg.c   | 6 --
 5 files changed, 13 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_drm_crtc.c 
b/drivers/gpu/drm/sti/sti_drm_crtc.c
index 155b91bf16ba..58bc190b2191 100644
--- a/drivers/gpu/drm/sti/sti_drm_crtc.c
+++ b/drivers/gpu/drm/sti/sti_drm_crtc.c
@@ -259,7 +259,6 @@ int sti_drm_crtc_enable_vblank(struct drm_device *dev, 
unsigned int pipe)

return 0;
 }
-EXPORT_SYMBOL(sti_drm_crtc_enable_vblank);

 void sti_drm_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe)
 {
@@ -279,7 +278,6 @@ void sti_drm_crtc_disable_vblank(struct drm_device *dev, 
unsigned int pipe)
compo->mixer[pipe]->pending_event = NULL;
}
 }
-EXPORT_SYMBOL(sti_drm_crtc_disable_vblank);

 static struct drm_crtc_funcs sti_crtc_funcs = {
.set_config = drm_atomic_helper_set_config,
@@ -300,7 +298,6 @@ bool sti_drm_crtc_is_main(struct drm_crtc *crtc)

return false;
 }
-EXPORT_SYMBOL(sti_drm_crtc_is_main);

 int sti_drm_crtc_init(struct drm_device *drm_dev, struct sti_mixer *mixer,
struct drm_plane *primary, struct drm_plane *cursor)
diff --git a/drivers/gpu/drm/sti/sti_drm_plane.c 
b/drivers/gpu/drm/sti/sti_drm_plane.c
index 64d4ed43dda3..051deee7e44a 100644
--- a/drivers/gpu/drm/sti/sti_drm_plane.c
+++ b/drivers/gpu/drm/sti/sti_drm_plane.c
@@ -248,4 +248,3 @@ struct drm_plane *sti_drm_plane_init(struct drm_device *dev,

return >plane;
 }
-EXPORT_SYMBOL(sti_drm_plane_init);
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index b0eb62de1b2e..9dc0aea7911f 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -816,7 +816,6 @@ struct sti_layer *sti_hqvdp_create(struct device *dev)

return >layer;
 }
-EXPORT_SYMBOL(sti_hqvdp_create);

 static void sti_hqvdp_init_plugs(struct sti_hqvdp *hqvdp)
 {
diff --git a/drivers/gpu/drm/sti/sti_layer.c b/drivers/gpu/drm/sti/sti_layer.c
index 899104f9d4bc..480ec1c974e2 100644
--- a/drivers/gpu/drm/sti/sti_layer.c
+++ b/drivers/gpu/drm/sti/sti_layer.c
@@ -40,7 +40,6 @@ const char *sti_layer_to_str(struct sti_layer *layer)
return "";
}
 }
-EXPORT_SYMBOL(sti_layer_to_str);

 struct sti_layer *sti_layer_create(struct device *dev, int desc,
   void __iomem *baseaddr)
@@ -78,7 +77,6 @@ struct sti_layer *sti_layer_create(struct device *dev, int 
desc,

return layer;
 }
-EXPORT_SYMBOL(sti_layer_create);

 int sti_layer_prepare(struct sti_layer *layer,
  struct drm_crtc *crtc,
diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c
index aa8097137701..ab215d50452a 100644
--- a/drivers/gpu/drm/sti/sti_vtg.c
+++ b/drivers/gpu/drm/sti/sti_vtg.c
@@ -110,7 +110,6 @@ struct sti_vtg *of_vtg_find(struct device_node *np)
}
return NULL;
 }
-EXPORT_SYMBOL(of_vtg_find);

 static void vtg_reset(struct sti_vtg *vtg)
 {
@@ -242,7 +241,6 @@ void sti_vtg_set_config(struct sti_vtg *vtg,
else
vtg_enable_irq(vtg);
 }
-EXPORT_SYMBOL(sti_vtg_set_config);

 /**
  * sti_vtg_get_line_number
@@ -265,7 +263,6 @@ u32 sti_vtg_get_line_number(struct drm_display_mode mode, 
int y)

return start_line + y;
 }
-EXPORT_SYMBOL(sti_vtg_get_line_number);

 /**
  * sti_vtg_get_pixel_number
@@ -281,7 +278,6 @@ u32 sti_vtg_get_pixel_number(struct drm_display_mode mode, 
int x)
 {
return mode.htotal - mode.hsync_start + x;
 }
-EXPORT_SYMBOL(sti_vtg_get_pixel_number);

 int sti_vtg_register_client(struct sti_vtg *vtg,
struct notifier_block *nb, int crtc_id)
@@ -292,7 +288,6 @@ int sti_vtg_register_client(struct sti_vtg *vtg,
vtg->crtc_id = crtc_id;
return raw_notifier_chain_register(>notifier_list, nb);
 }
-EXPORT_SYMBOL(sti_vtg_register_client);

 int sti_vtg_unregister_client(struct sti_vtg *vtg, struct notifier_block *nb)
 {
@@ -301,7 +296,6 @@ int sti_vtg_unregister_client(struct sti_vtg *vtg, struct 
notifier_block *nb)

return raw_notifier_chain_unregister(>notifier_list, nb);
 }
-EXPORT_SYMBOL(sti_vtg_unregister_client);

 static irqreturn_t vtg_irq_thread(int irq, void *arg)
 {
-- 
2.4.5



[PATCH] drm/atmel-hlcdc: Compile suspend/resume for PM_SLEEP only

2015-08-14 Thread Thierry Reding
From: Thierry Reding 

If PM is enabled but PM_SLEEP is disabled, the suspend/resume functions
are still unused and produce a compiler warning.

Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index b6bc5cb9b9ee..303ae68f983d 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -561,7 +561,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device 
*pdev)
return 0;
 }

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int atmel_hlcdc_dc_drm_suspend(struct device *dev)
 {
struct drm_device *drm_dev = dev_get_drvdata(dev);
-- 
2.4.5



[PATCH] drm/amdgpu: Avoid possibly uninitialized variable

2015-08-14 Thread Thierry Reding
From: Thierry Reding 

The min_ctx_size is only initialized for H265, so garbage will end up in
buf_sizes[4] for all other stream types. Better initialize the value to
0 to avoid unpleasant surprises.

Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index f5c22556ec2c..91e79c3f2403 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -374,7 +374,7 @@ static int amdgpu_uvd_cs_msg_decode(uint32_t *msg, unsigned 
buf_sizes[])
unsigned height_in_mb = ALIGN(height / 16, 2);
unsigned fs_in_mb = width_in_mb * height_in_mb;

-   unsigned image_size, tmp, min_dpb_size, num_dpb_buffer, min_ctx_size;
+   unsigned image_size, tmp, min_dpb_size, num_dpb_buffer, min_ctx_size = 
0;

image_size = width * height;
image_size += image_size / 2;
-- 
2.4.5



[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Zhou, Jammy
Oh, I really missed that. I will get it resolved next week.

Regards,
Jammy

-Original Message-
From: Emil Velikov [mailto:emil.l.veli...@gmail.com] 
Sent: Friday, August 14, 2015 9:19 PM
To: Zhou, Jammy
Cc: emil.l.velikov at gmail.com; ML dri-devel
Subject: Re: [PATCH 1/5] drm: add interface to get drm devices on the system v2

On 14/08/15 13:45, Zhou, Jammy wrote:
> That's okay. Shall we get this patch merged now if no other objections?
> 
First we should fix the funny vendor/device/etc id issue. Otherwise the API is 
bugged badly.

-Emil


[Bug 74329] Please expose OES_texture_float and OES_texture_half_float on the ES3 context

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=74329

Marek Olšák  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Marek Olšák  ---
Added in 44dc1d307d7eacef0d6f1618ba0fb7f62e08f8. Closing.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/7282a2f6/attachment.html>


[ANNOUNCE] libdrm 2.4.63

2015-08-14 Thread Zhou, Jammy
Understood. Thanks for the clarification :-)

Regards,
Jammy

-Original Message-
From: Marek Olšák [mailto:mar...@gmail.com] 
Sent: Friday, August 14, 2015 9:26 PM
To: Zhou, Jammy
Cc: dri-devel at lists.freedesktop.org
Subject: Re: [ANNOUNCE] libdrm 2.4.63

[- xorg-announce]

Hi Jammy,

You can push it whenever you like. I can also make a new libdrm release 
whenever I like. There is no strict schedule for libdrm. If you want another 
release (e.g. Catalyst needs it, etc.), just let me know.

Libdrm releases are mostly driven by needs of other projects (e.g.
Mesa). Here I needed libdrm_amdgpu, so I had to release it, so that I can add a 
libdrm_amdgpu 2.4.63 dependency into Mesa's configure.ac.

Marek


On Fri, Aug 14, 2015 at 2:53 PM, Zhou, Jammy  wrote:
> Hi Marek,
>
> It looks like the 32bit VA support for libdrm_amdgpu in my recent series are 
> not included.  Do you think we should wait for the next release to include 
> them?
>
> Regards,
> Jammy
>
> -Original Message-
> From: dri-devel [mailto:dri-devel-bounces at lists.freedesktop.org] On 
> Behalf Of Marek Ol?ák
> Sent: Friday, August 14, 2015 8:28 PM
> To: xorg-announce at lists.freedesktop.org; 
> dri-devel at lists.freedesktop.org
> Subject: [ANNOUNCE] libdrm 2.4.63
>
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
> Libdrm 2.4.63 has been released. It contains the new libdrm_amdgpu library.
>
> Alan Coopersmith (1):
>   include  &  directly for major() and 
> minor()
>
> Alex Deucher (10):
>   drm: consolidate common list implementations (v2)
>   drm: add util_math.h
>   drm: add libdrm_amdgpu (v7)
>   drm: add tests/amdgpu (v3)
>   amdgpu: update to the latest kernel header
>   fix configuration when amdgpu is disabled
>   fix amdgpu cunit configure test harder
>   move up cunit workaround for ubuntu/debian
>   add a note about which version of cunit is fixed for debian/ubuntu
>   radeon: add new OLAND pci id
>
> Alexandr Akulich (1):
>   libdrm/amdgpu: Fixed drm.h include.
>
> Anuj Phogat (2):
>   i965/gen9: Pass alignment as function parameter in 
> drm_intel_gem_bo_alloc_internal()
>   Set alignment value in drm_intel_add_validate_buffer()
>
> Chris Wilson (1):
>   drm: Detect no-op drmModeAtomicRequest and return early
>
> Christian König (16):
>   amdgpu: cleanup public interface v2
>   amdgpu: add public bo list interface v3
>   amdgpu: compare the primary device names instead
>   amdgpu: remove bo_vas hash table v2
>   amdgpu: add helper for VM mapping v2
>   amdgpu: stop checking flag masks
>   amdgpu: explicitly unmap GPU mapping on BO destruction
>   amdgpu: remove flink export workaround v2
>   amdgpu: cleanup VA IOCTL handling
>   amdgpu: remove pointer arithmetic from command submission
>   amdgpu: add CS dependencies v2
>   gitignore: add some generated amdgpu files
>   amdgpu: cleanup public interface style
>   amdgpu: remove reference to AMD specific error codes
>   amdgpu: use common fence structure for dependencies as well.
>   amdgpu: fix bs buffer size for vce test
>
> Emil Velikov (15):
>   configure: default --enable-valgrind to auto
>   freedreno: zero is a valid fd number, treat it as such
>   omap: zero is a valid fd number, treat it as such
>   xf86drm: fix incorrect fd comparison in drmOpenOnce{,WithType}
>   Consistently check the fd value
>   man: remove .man_fixup workaround
>   Force enable amdgpu for the dist build/check.
>   amdgpu/util_hash: hide private symbols from global namespace
>   amdgpu/util_hash_table: hide private symbols from global namespace
>   amdgpu: add a bunch of missing config.h includes
>   amdgpu: cosmetic chances in license boilerplate
>   amdgpu: squash trivial documentation typo
>   amdgpu/amdgpu_vamgr: hide private symbols from global namespace
>   amdgpu: hide the final internal functions from global namespace
>   amdgpu: add symbols check test
>
> Jack Xiao (2):
>   amdgpu: fix round down/up page size error
>   amdgpu: add zero timeout check in amdgpu_cs_query_fence_status
>
> Jammy Zhou (24):
>   amdgpu: remove active_rb_pipes from amdgpu_gpu_info
>   amdgpu: remove AMDGPU_GEM_CREATE_CPU_GTT_UC
>   amdgpu: fix 32-on-64 support (v2)
>   amdgpu: add ctx_id for wait_cs
>   amdgpu: reuse the kernel IB flags v2
>   amdgpu: validate the upper limit of virtual address v2
>   amdgpu: fix the number of IB size enums
>   amdgpu: remove unused AMDGPU_IB_RESOURCE_PRIORITY
>   amdgpu: replace alloca with calloc v2
>   amdgpu: add amdgpu_bo_list_update interface v2
>   amdgpu: add IB sharing support v2
>   tests/amdgpu: add shared IB submission test v2
>   amdgpu: get rid of IB pool management v3
>   tests/amdgpu: manage IB in client side
>   amdgpu: add amdgpu_query_gds_info
>   amdgpu: cleanup gds specific 

[RFC 06/13] drm/dp: Read eDP version from DPCD

2015-08-14 Thread Jani Nikula
On Wed, 12 Aug 2015, Thierry Reding  wrote:
> From: Thierry Reding 
>
> If the sink support eDP, read the eDP revision from it's DPCD.
>
> Signed-off-by: Thierry Reding 
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 30 +-
>  include/drm/drm_dp_helper.h |  1 +
>  2 files changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index 1fe181525604..c711b690508b 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -295,7 +295,7 @@ EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
>   */
>  int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link)
>  {
> - u8 values[7];
> + u8 values[16], value;
>   int err;
>  
>   memset(link, 0, sizeof(*link));
> @@ -323,6 +323,34 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct 
> drm_dp_link *link)
>   if (values[6] & DP_SET_ANSI_8B10B)
>   link->capabilities |= DP_LINK_CAP_ANSI_8B10B;
>  
> + if (values[13] & DP_ALTERNATE_SCRAMBLER_RESET_CAP) {

That's not indicative of eDP, that's indicative of edp && alternate
scrambler support. DPCD_DISPLAY_CONTROL_CAPABLE bit is a better match:

"To allow Source devices to easily identify panels that use DPCD
Addresses 00700h through 007FFh, the DPCD_DISPLAY_CONTROL_CAPABLE bit in
the eDP_CONFIGURATION_CAP register (DPCD Address Dh, bit 3) has been
assigned (eDP v1.2 (and higher)) to indicate this capability, as
described in Table 3-3."

Also, I'd really appreciate using the macros for DPCD offsets. I do not
remember these offsets by heart, and we've defined the macros according
to the spec so it would be faster to look things up there.

> + err = drm_dp_dpcd_readb(aux, DP_EDP_DPCD_REV, );
> + if (err < 0)
> + return err;
> +
> + switch (value) {
> + case DP_EDP_11:
> + link->edp = 0x11;

I'm really not sure if this is a good idea, since DP_EDP_11 ==
0. Essentially you're promoting to use the magic values for the version
checking in code. Sure, we've done that with the DPCD version, but now
link->revision is directly from DPCD, and this would not be.

BR,
Jani.


> + break;
> +
> + case DP_EDP_12:
> + link->edp = 0x12;
> + break;
> +
> + case DP_EDP_13:
> + link->edp = 0x13;
> + break;
> +
> + case DP_EDP_14:
> + link->edp = 0x14;
> + break;
> +
> + default:
> + DRM_ERROR("unsupported eDP version: %02x\n", value);
> + break;
> + }
> + }
> +
>   return 0;
>  }
>  EXPORT_SYMBOL(drm_dp_link_probe);
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 9e70ea8b907d..f9e7f484a225 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -749,6 +749,7 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
>  
>  struct drm_dp_link {
>   unsigned char revision;
> + unsigned char edp;
>   unsigned int rate;
>   unsigned int num_lanes;
>   unsigned long capabilities;
> -- 
> 2.4.5
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Jani Nikula, Intel Open Source Technology Center


vmwgfx GL3 and other -next (4.3) pathches

2015-08-14 Thread Thomas Hellstrom
On 08/13/2015 08:38 AM, Daniel Vetter wrote:
> On Thu, Aug 13, 2015 at 7:04 AM, Thomas Hellstrom  
> wrote:
>>> Out of curiosity I did take a (very) quick look and also tried to find the
>>> corresponding userspace parts. On a quick search I didn't find anything
>>> for libdrm or mesa, neither on mailing lists or already committed. Where
>>> are those pieces?
>>> -Daniel
>> The mesa code is ready and working but undergoing final tidying before
>> upstreaming. The aim is of course to release it well before linux 4.3 is
>> out. However our kernel interface has just undergone very minor change
> In my opinion userspace must be ready for merging (and public) before
> the kernel code can go in. That's at least what I enforce for i915 and
> how all other drivers are handled.
> -Daniel

OK, so the mesa code has now been published here:

http://cgit.freedesktop.org/~thomash/mesa/log/?h=svga-gl3-merge

While it's in principle ready for merging, it lacks some final reviewing
and testing but otherwise should work fine.

/Thomas



[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Emil Velikov
On 14 August 2015 at 13:15, Zhou, Jammy  wrote:
> Okay, I got it. Actually with current implementation, only the number of PCI 
> devices on the system is returned for drmGetDevices(NULL, 0). I extracted 
> related code below. I hope it can address your concern :-)
>
Had a blond moment and got confused with the subsystem_type default
statement. Please ignore my earlier rambling.

-Emil


[RFC 04/13] drm/dp: Enhanced framing capability is DP 1.1+

2015-08-14 Thread Jani Nikula
On Wed, 12 Aug 2015, Thierry Reding  wrote:
> From: Thierry Reding 
>
> The enhanced framing capability was added in DisplayPort 1.1, so any
> code dealing with it needs to be protected accordingly.

I guess we should talk about DPCD 1.1, since "Note: The DPCD revision
number does not necessarily match the DisplayPort version number."

BR,
Jani.


>
> Signed-off-by: Thierry Reding 
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index 45701c650a5d..dcfd6898aebe 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -308,8 +308,9 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct 
> drm_dp_link *link)
>   link->rate = drm_dp_bw_code_to_link_rate(values[1]);
>   link->num_lanes = values[2] & DP_MAX_LANE_COUNT_MASK;
>  
> - if (values[2] & DP_ENHANCED_FRAME_CAP)
> - link->capabilities |= DP_LINK_CAP_ENHANCED_FRAMING;
> + if (link->revision >= 0x11)
> + if (values[2] & DP_ENHANCED_FRAME_CAP)
> + link->capabilities |= DP_LINK_CAP_ENHANCED_FRAMING;
>  
>   if (link->revision >= 0x12)
>   if (values[2] & DP_TPS3_SUPPORTED)
> -- 
> 2.4.5
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Jani Nikula, Intel Open Source Technology Center


[PULL] drm-intel-fixes

2015-08-14 Thread Jani Nikula

Hi Dave, some i915 display fixes. A couple of backports by Maarten from
our -next to v4.2, and a dithering fix from Daniel.

BR,
Jani.

The following changes since commit f7644cbfcdf03528f0f450f3940c4985b2291f49:

  Linux 4.2-rc6 (2015-08-09 15:54:30 -0400)

are available in the git repository at:

  git://anongit.freedesktop.org/drm-intel tags/drm-intel-fixes-2015-08-14

for you to fetch changes up to d2944cf21305c754fa8b2d6c1eea05ad5dad7944:

  drm/i915: Commit planes on each crtc separately. (2015-08-13 12:09:18 +0300)


Daniel Vetter (1):
  drm/i915: Only dither on 6bpc panels

Maarten Lankhorst (2):
  drm/i915: calculate primary visibility changes instead of calling from 
set_config
  drm/i915: Commit planes on each crtc separately.

 drivers/gpu/drm/i915/intel_atomic.c  | 45 +--
 drivers/gpu/drm/i915/intel_display.c | 59 +---
 2 files changed, 23 insertions(+), 81 deletions(-)

-- 
Jani Nikula, Intel Open Source Technology Center


[PULL] topic/drm-fixes

2015-08-14 Thread Jani Nikula

Hi Dave, here's a DP MST fix from Maarten.

BR,
Jani.

The following changes since commit 5677d67ae3949f09f57357241b88222d49b8c782:

  drm: Stop resetting connector state to unknown (2015-07-22 14:52:26 +0200)

are available in the git repository at:

  git://anongit.freedesktop.org/drm-intel tags/topic/drm-fixes-2015-08-14

for you to fetch changes up to 4772ff03df8094fd99d28de5fcf5df3a3e9c68bb:

  drm/dp/mst: Remove port after removing connector. (2015-08-11 12:30:38 +0300)


Maarten Lankhorst (1):
  drm/dp/mst: Remove port after removing connector.

 drivers/gpu/drm/drm_dp_mst_topology.c | 19 +--
 include/drm/drm_crtc.h|  2 --
 2 files changed, 13 insertions(+), 8 deletions(-)

-- 
Jani Nikula, Intel Open Source Technology Center


[PATCH 0/5] Host1x/TegraDRM fixes/improvements

2015-08-14 Thread Mikko Perttunen
Bump.

On 07/08/2015 02:27 PM, Mikko Perttunen wrote:
> Hi, this series has a few small improvements for Host1x and TegraDRM
> that the VIC series will build upon.
> 
> 1/5 is a bug fix to host1x.
> 2/5 is required by VIC code to implement ->is_addr_reg().
> 3/5 deduplicates handling of HOST1X class address registers
> and fixes the checked registers.
> 4/5 is required for the host1x firewall to work when bo's are
> mapped using IOMMU.
> 5/5 adds a TegraDRM allocator that allows drivers to allocate
> non-GEM memory that is still mapped to the TegraDRM domain.
> 
> Arto Merilainen (3):
>   host1x: Store device address to all bufs
>   host1x: Pass register value in firewall
>   drm/tegra: Support kernel mappings with IOMMU
> 
> Mikko Perttunen (2):
>   host1x: Handle HOST1X class address registers directly
>   drm/tegra: Add Tegra DRM allocation API
> 
>  drivers/gpu/drm/tegra/drm.c  | 99 
> +---
>  drivers/gpu/drm/tegra/drm.h  | 13 +-
>  drivers/gpu/drm/tegra/gem.c  | 34 +--
>  drivers/gpu/drm/tegra/gr2d.c | 25 ---
>  drivers/gpu/drm/tegra/gr3d.c | 24 ---
>  drivers/gpu/host1x/job.c | 54 +---
>  include/linux/host1x.h   |  4 +-
>  7 files changed, 193 insertions(+), 60 deletions(-)
> 


[ANNOUNCE] libdrm 2.4.63

2015-08-14 Thread Zhou, Jammy
Hi Marek,

It looks like the 32bit VA support for libdrm_amdgpu in my recent series are 
not included.  Do you think we should wait for the next release to include them?

Regards,
Jammy

-Original Message-
From: dri-devel [mailto:dri-devel-boun...@lists.freedesktop.org] On Behalf Of 
Marek Ol?ák
Sent: Friday, August 14, 2015 8:28 PM
To: xorg-announce at lists.freedesktop.org; dri-devel at lists.freedesktop.org
Subject: [ANNOUNCE] libdrm 2.4.63


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Libdrm 2.4.63 has been released. It contains the new libdrm_amdgpu library.

Alan Coopersmith (1):
  include  &  directly for major() and minor()

Alex Deucher (10):
  drm: consolidate common list implementations (v2)
  drm: add util_math.h
  drm: add libdrm_amdgpu (v7)
  drm: add tests/amdgpu (v3)
  amdgpu: update to the latest kernel header
  fix configuration when amdgpu is disabled
  fix amdgpu cunit configure test harder
  move up cunit workaround for ubuntu/debian
  add a note about which version of cunit is fixed for debian/ubuntu
  radeon: add new OLAND pci id

Alexandr Akulich (1):
  libdrm/amdgpu: Fixed drm.h include.

Anuj Phogat (2):
  i965/gen9: Pass alignment as function parameter in 
drm_intel_gem_bo_alloc_internal()
  Set alignment value in drm_intel_add_validate_buffer()

Chris Wilson (1):
  drm: Detect no-op drmModeAtomicRequest and return early

Christian König (16):
  amdgpu: cleanup public interface v2
  amdgpu: add public bo list interface v3
  amdgpu: compare the primary device names instead
  amdgpu: remove bo_vas hash table v2
  amdgpu: add helper for VM mapping v2
  amdgpu: stop checking flag masks
  amdgpu: explicitly unmap GPU mapping on BO destruction
  amdgpu: remove flink export workaround v2
  amdgpu: cleanup VA IOCTL handling
  amdgpu: remove pointer arithmetic from command submission
  amdgpu: add CS dependencies v2
  gitignore: add some generated amdgpu files
  amdgpu: cleanup public interface style
  amdgpu: remove reference to AMD specific error codes
  amdgpu: use common fence structure for dependencies as well.
  amdgpu: fix bs buffer size for vce test

Emil Velikov (15):
  configure: default --enable-valgrind to auto
  freedreno: zero is a valid fd number, treat it as such
  omap: zero is a valid fd number, treat it as such
  xf86drm: fix incorrect fd comparison in drmOpenOnce{,WithType}
  Consistently check the fd value
  man: remove .man_fixup workaround
  Force enable amdgpu for the dist build/check.
  amdgpu/util_hash: hide private symbols from global namespace
  amdgpu/util_hash_table: hide private symbols from global namespace
  amdgpu: add a bunch of missing config.h includes
  amdgpu: cosmetic chances in license boilerplate
  amdgpu: squash trivial documentation typo
  amdgpu/amdgpu_vamgr: hide private symbols from global namespace
  amdgpu: hide the final internal functions from global namespace
  amdgpu: add symbols check test

Jack Xiao (2):
  amdgpu: fix round down/up page size error
  amdgpu: add zero timeout check in amdgpu_cs_query_fence_status

Jammy Zhou (24):
  amdgpu: remove active_rb_pipes from amdgpu_gpu_info
  amdgpu: remove AMDGPU_GEM_CREATE_CPU_GTT_UC
  amdgpu: fix 32-on-64 support (v2)
  amdgpu: add ctx_id for wait_cs
  amdgpu: reuse the kernel IB flags v2
  amdgpu: validate the upper limit of virtual address v2
  amdgpu: fix the number of IB size enums
  amdgpu: remove unused AMDGPU_IB_RESOURCE_PRIORITY
  amdgpu: replace alloca with calloc v2
  amdgpu: add amdgpu_bo_list_update interface v2
  amdgpu: add IB sharing support v2
  tests/amdgpu: add shared IB submission test v2
  amdgpu: get rid of IB pool management v3
  tests/amdgpu: manage IB in client side
  amdgpu: add amdgpu_query_gds_info
  amdgpu: cleanup gds specific alloc/free functions
  amdgpu: merge amdgpu_drm.h from kernel
  amdgpu: do NULL check for bo handle in amdgpu_bo_query_info
  amdgpu: improve the amdgpu_cs_query_fence_status interface
  drm: fix the ALIGN macro to avoid value clamp
  tests/amdgpu: remove the duplicate IB allocation for VCE test
  amdgpu: add flags parameter for amdgpu_va_range_alloc
  amdgpu: add amdgpu_bo_va_op for va map/unmap support v3
  amdgpu: expose the PCI revision ID

Jonathan Gray (3):
  xf86drmMode: Implement drmCheckModesettingSupported() for OpenBSD
  xf86drm: correct the OpenBSD DRM_MAJOR define
  xf86drm: use the correct device minor names on OpenBSD

Joonyoung Shim (1):
  Build vbltest irrespective of the presence of libudev.

Julien Cristau (1):
  Fix headers inclusion in xf86drmMode.c

Ken Wang (8):
  amdgpu: make vamgr global
  amdgpu: add max_memory_clock for interface query
  amdgpu: add vram_type and vram_bit_width for 

[PATCH 3/3] drm/sti: Select FW_LOADER

2015-08-14 Thread Thierry Reding
From: Thierry Reding 

Select FW_LOADER explicitly to satify the direct dependency of
FW_LOADER_USER_HELPER_FALLBACK.

Cc: Benjamin Gaignard 
Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/sti/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/sti/Kconfig b/drivers/gpu/drm/sti/Kconfig
index fbccc105819b..0a9048c47b95 100644
--- a/drivers/gpu/drm/sti/Kconfig
+++ b/drivers/gpu/drm/sti/Kconfig
@@ -6,6 +6,7 @@ config DRM_STI
select DRM_GEM_CMA_HELPER
select DRM_KMS_CMA_HELPER
select DRM_PANEL
+   select FW_LOADER
select FW_LOADER_USER_HELPER_FALLBACK
help
  Choose this option to enable DRM on STM stiH41x chipset
-- 
2.4.5



[PATCH 2/3] drm/amdgpu: Select BACKLIGHT_LCD_SUPPORT

2015-08-14 Thread Thierry Reding
From: Thierry Reding 

Explicitly select BACKLIGHT_LCD_SUPPORT to satisfy the direct dependency
of BACKLIGHT_CLASS_DEVICE.

Cc: Alex Deucher 
Cc: Christian König 
Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index c4b6b0f5ad53..23143158fb81 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -156,6 +156,7 @@ config DRM_AMDGPU
select POWER_SUPPLY
select HWMON
select BACKLIGHT_CLASS_DEVICE
+   select BACKLIGHT_LCD_SUPPORT
select INTERVAL_TREE
help
  Choose this option if you have a recent AMD Radeon graphics card.
-- 
2.4.5



[PATCH 1/3] drm/radeon: Select BACKLIGHT_LCD_SUPPORT

2015-08-14 Thread Thierry Reding
From: Thierry Reding 

Explicitly select BACKLIGHT_LCD_SUPPORT to satisfy the direct dependency
of BACKLIGHT_CLASS_DEVICE.

Cc: Alex Deucher 
Cc: Christian König 
Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index b645fa0e8f44..c4b6b0f5ad53 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -132,6 +132,7 @@ config DRM_RADEON
select POWER_SUPPLY
select HWMON
select BACKLIGHT_CLASS_DEVICE
+   select BACKLIGHT_LCD_SUPPORT
select INTERVAL_TREE
help
  Choose this option if you have an ATI Radeon graphics card.  There
-- 
2.4.5



[PATCH] Revert "drm/nouveau/fifo/gk104: kick channels when deactivating them"

2015-08-14 Thread Alexandre Courbot
On Wed, Aug 12, 2015 at 6:59 PM, Afzal Mohammed  
wrote:
> Hi,
>
> On Wed, Aug 12, 2015 at 04:40:57PM +0900, Alexandre Courbot wrote:
>
>> Great, thanks. Are you also on an optimus configuration with the
>> NVIDIA card being the secondary GPU?
>
> Spec says graphic processor is NVIDIA GeForce NV14P-GV2 GT40M, system
> is Lenovo E431 laptop.
>
> I am a stranger here, started Kernel journey towards north and reached
> south since the system wasn't booting :), don't know how to find it is
> an optimus configuration, if above details aren't enough, let me know
> how to find out.

Thanks for the details!

An optimus configuration means that display and basic acceleration is
provided by an integrated Intel graphics, and the NVIDIA GPU can be
switched on/off dynamically to provide more power when needed.

According to your laptop reference, this seems to be the kind of
configuration you have. It is relevant because this issue seems to
happen when the NVIDIA GPU is switched off during boot.


[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Zhou, Jammy
That's okay. Shall we get this patch merged now if no other objections?

Regards,
Jammy

-Original Message-
From: Emil Velikov [mailto:emil.l.veli...@gmail.com] 
Sent: Friday, August 14, 2015 8:29 PM
To: Zhou, Jammy
Cc: ML dri-devel
Subject: Re: [PATCH 1/5] drm: add interface to get drm devices on the system v2

On 14 August 2015 at 13:15, Zhou, Jammy  wrote:
> Okay, I got it. Actually with current implementation, only the number 
> of PCI devices on the system is returned for drmGetDevices(NULL, 0). I 
> extracted related code below. I hope it can address your concern :-)
>
Had a blond moment and got confused with the subsystem_type default statement. 
Please ignore my earlier rambling.

-Emil


[PATCH] drm/i915: Fix build warning on 32-bit

2015-08-14 Thread Thierry Reding
From: Thierry Reding 

The gtt.stolen_size field is of type size_t, and so should be printed
using %zu to avoid build warnings on either 32-bit and 64-bit builds.

Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c 
b/drivers/gpu/drm/i915/i915_gem_stolen.c
index a36cb95ec798..f361c4a56995 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -348,7 +348,7 @@ int i915_gem_init_stolen(struct drm_device *dev)
 * memory, so just consider the start. */
reserved_total = stolen_top - reserved_base;

-   DRM_DEBUG_KMS("Memory reserved for graphics device: %luK, usable: 
%luK\n",
+   DRM_DEBUG_KMS("Memory reserved for graphics device: %zuK, usable: 
%luK\n",
  dev_priv->gtt.stolen_size >> 10,
  (dev_priv->gtt.stolen_size - reserved_total) >> 10);

-- 
2.4.5



[PATCH RFC v3 7/7] ARM: dts: am335x-boneblack: Add HDMI audio support

2015-08-14 Thread Jyri Sarha
Add HDMI audio support. Adds mcasp0_pins, clk_mcasp0_fixed,
clk_mcasp0, mcasp0, sound node, and updates the tda19988 node to
follow the new binding.

Signed-off-by: Jyri Sarha 
---
 arch/arm/boot/dts/am335x-boneblack.dts | 90 --
 1 file changed, 86 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-boneblack.dts 
b/arch/arm/boot/dts/am335x-boneblack.dts
index eadbba3..7d3e899 100644
--- a/arch/arm/boot/dts/am335x-boneblack.dts
+++ b/arch/arm/boot/dts/am335x-boneblack.dts
@@ -64,6 +64,16 @@
0x1b0 0x03  /* xdma_event_intr0, OMAP_MUX_MODE3 | 
AM33XX_PIN_OUTPUT */
>;
};
+
+   mcasp0_pins: mcasp0_pins {
+   pinctrl-single,pins = <
+   0x1ac (PIN_INPUT_PULLUP | MUX_MODE0)/* 
mcasp0_ahclkx.mcasp0_ahclkx */
+   0x19c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* 
mcasp0_ahclkr.mcasp0_axr2 */
+   0x194 (PIN_OUTPUT_PULLUP | MUX_MODE0)   /* 
mcasp0_fsx.mcasp0_fsx */
+   0x190 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 
mcasp0_aclkx.mcasp0_aclkx */
+   0x06c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* 
gpmc_a11.GPIO1_27 */
+   >;
+   };
 };

  {
@@ -76,17 +86,89 @@
 };

  {
-   tda19988 {
+   tda19988: tda19988 {
compatible = "nxp,tda998x";
reg = <0x70>;
+
+   #sound-dai-cells = <0>;
+
pinctrl-names = "default", "off";
pinctrl-0 = <_hdmi_bonelt_pins>;
pinctrl-1 = <_hdmi_bonelt_off_pins>;

-   port {
-   hdmi_0: endpoint at 0 {
-   remote-endpoint = <_0>;
+   ports {
+   #address-cells = <1>; 
+   #size-cells = <0>;
+   port at 0 {
+   port-type = "rgb";
+   reg = <0x230145>;
+   hdmi_0: endpoint at 0 {
+   remote-endpoint = <_0>;
+   };
};
+   port at 1 {
+   port-type = "i2s";
+   reg = <0x03>;
+   tda19988_i2s: endpoint {
+   remote-endpoint = <_i2s>;
+   };
+   };
+   };
+   };
+};
+
+ {
+   system-power-controller;
+};
+
+{
+   #sound-dai-cells = <0>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+   status = "okay";
+   op-mode = <0>;  /* MCASP_IIS_MODE */
+   tdm-slots = <2>;
+   serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+   0 0 1 0
+   >;
+   tx-num-evt = <1>;
+   rx-num-evt = <1>;
+
+   port {
+   mcasp0_i2s: endpoint {
+   remote-endpoint = <_i2s>;
+   };
+   };
+};
+
+/ {
+   clk_mcasp0_fixed: clk_mcasp0_fixed {
+   #clock-cells = <0>;
+   compatible = "fixed-clock";
+   clock-frequency = <24576000>;
+   };
+
+   clk_mcasp0: clk_mcasp0 {
+   #clock-cells = <0>;
+   compatible = "gpio-gate-clock";
+   clocks = <_mcasp0_fixed>;
+   enable-gpios = < 27 0>; /* BeagleBone Black Clk enable on 
GPIO1_27 */
+   };
+
+   sound {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "TI BeagleBone Black";
+   simple-audio-card,format = "i2s";
+   simple-audio-card,bitclock-master = <_master>;
+   simple-audio-card,frame-master = <_master>;
+
+   dailink0_master: simple-audio-card,cpu {
+   sound-dai = <>;
+   clocks = <_mcasp0>;
+   };
+
+   simple-audio-card,codec {
+   sound-dai = <>;
};
};
 };
-- 
1.9.1



[PATCH RFC v3 6/7] drm/i2c: tda998x: Register ASoC HDMI codec for audio functionality

2015-08-14 Thread Jyri Sarha
Register ASoC HDMI codec for audio functionality. This is an initial
ASoC audio implementation for tda998x driver and it does not use all
the features provided by hdmi-codec.

HDMI audio info-frame and audio stream header is generated by the ASoC
HDMI codec. The codec also applies constraints for available
sample-rates.

Implementation of audio_startup for hdmi_codec_ops would enable
tda998x driver to abort ongoing playback if the HDMI cable is
unplugged or re-plugged to a device without audio capability.

Signed-off-by: Jyri Sarha 
---
 drivers/gpu/drm/i2c/Kconfig   |   1 +
 drivers/gpu/drm/i2c/tda998x_drv.c | 241 +-
 2 files changed, 214 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/i2c/Kconfig b/drivers/gpu/drm/i2c/Kconfig
index 22c7ed6..088f278 100644
--- a/drivers/gpu/drm/i2c/Kconfig
+++ b/drivers/gpu/drm/i2c/Kconfig
@@ -28,6 +28,7 @@ config DRM_I2C_SIL164
 config DRM_I2C_NXP_TDA998X
tristate "NXP Semiconductors TDA998X HDMI encoder"
default m if DRM_TILCDC
+   select SND_SOC_HDMI_CODEC if SND_SOC
help
  Support for NXP Semiconductors TDA998X HDMI encoders.

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
b/drivers/gpu/drm/i2c/tda998x_drv.c
index 4dc2dc0..8444e18 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -49,6 +50,8 @@ struct tda998x_priv {
u8 vip_cntrl_2;
struct tda998x_encoder_params params;

+   struct platform_device *audio_pdev;
+
wait_queue_head_t wq_edid;
volatile int wq_edid_wait;
struct drm_encoder *encoder;
@@ -435,7 +438,7 @@ out:
 }

 static void
-reg_write_range(struct tda998x_priv *priv, uint16_t reg, uint8_t *p, int cnt)
+reg_write_range(struct tda998x_priv *priv, uint16_t reg, const u8 *p, int cnt)
 {
struct i2c_client *client = priv->hdmi;
uint8_t buf[cnt+1];
@@ -619,7 +622,7 @@ tda998x_write_if(struct tda998x_priv *priv, uint8_t bit, 
uint16_t addr,
 }

 static void
-tda998x_write_aif(struct tda998x_priv *priv, struct tda998x_encoder_params *p)
+tda998x_write_raw_aif(struct tda998x_priv *priv, u8 *audio_frame)
 {
u8 buf[PB(HDMI_AUDIO_INFOFRAME_SIZE) + 1];

@@ -627,10 +630,10 @@ tda998x_write_aif(struct tda998x_priv *priv, struct 
tda998x_encoder_params *p)
buf[HB(0)] = HDMI_INFOFRAME_TYPE_AUDIO;
buf[HB(1)] = 0x01;
buf[HB(2)] = HDMI_AUDIO_INFOFRAME_SIZE;
-   buf[PB(1)] = p->audio_frame[1] & 0x07; /* CC */
-   buf[PB(2)] = p->audio_frame[2] & 0x1c; /* SF */
-   buf[PB(4)] = p->audio_frame[4];
-   buf[PB(5)] = p->audio_frame[5] & 0xf8; /* DM_INH + LSV */
+   buf[PB(1)] = audio_frame[1] & 0x07; /* CC */
+   buf[PB(2)] = audio_frame[2] & 0x1c; /* SF */
+   buf[PB(4)] = audio_frame[4];
+   buf[PB(5)] = audio_frame[5] & 0xf8; /* DM_INH + LSV */

buf[PB(0)] = tda998x_cksum(buf, sizeof(buf));

@@ -638,6 +641,24 @@ tda998x_write_aif(struct tda998x_priv *priv, struct 
tda998x_encoder_params *p)
 sizeof(buf));
 }

+static int tda998x_write_aif(struct tda998x_priv *priv,
+struct hdmi_audio_infoframe *cea)
+{
+   uint8_t buf[HDMI_INFOFRAME_SIZE(AUDIO)];
+   int len;
+
+   len = hdmi_audio_infoframe_pack(cea, buf, sizeof(buf));
+   if (len < 0) {
+   dev_err(>hdmi->dev,
+   "Failed to pack audio infoframe: %d\n", len);
+   return len;
+   }
+
+   /* Write the audio information packet */
+   tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, buf, len);
+   return 0;
+}
+
 static void
 tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode)
 {
@@ -670,19 +691,24 @@ static void tda998x_audio_mute(struct tda998x_priv *priv, 
bool on)
}
 }

-static void
+static int
 tda998x_configure_audio(struct tda998x_priv *priv,
-   struct drm_display_mode *mode, struct tda998x_encoder_params *p)
+   int mode_clock,
+   int ena_ap,
+   int dai_format,
+   int sample_width,
+   int sample_rate,
+   const u8 *status)
 {
uint8_t buf[6], clksel_aip, clksel_fs, cts_n, adiv;
uint32_t n;

/* Enable audio ports */
-   reg_write(priv, REG_ENA_AP, p->audio_cfg);
-   reg_write(priv, REG_ENA_ACLK, p->audio_clk_cfg);
+   reg_write(priv, REG_ENA_AP, ena_ap);
+   reg_write(priv, REG_ENA_ACLK, dai_format == AFMT_SPDIF ? 0 : 1);

/* Set audio input source */
-   switch (p->audio_format) {
+   switch (dai_format) {
case AFMT_SPDIF:
reg_write(priv, REG_MUX_AP, MUX_AP_SELECT_SPDIF);
clksel_aip = AIP_CLKSEL_AIP_SPDIF;
@@ -694,12 +720,25 @@ tda998x_configure_audio(struct tda998x_priv *priv,

[PATCH RFC v3 5/7] drm/i2c: tda998x: Remove include/sound/tda998x.h and fix graph parsing

2015-08-14 Thread Jyri Sarha
Move struct tda998x_audio definition to tda998x_drv.c and remove
include/sound/tda998x.h. There is no external use for struct
tda998x_audio.

Fix graph parsing to allow ports to be inside a separate "ports"-node as
specified in Documentation/devicetree/bindings/graph.txt.

Signed-off-by: Jyri Sarha 
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 59 +--
 include/sound/tda998x.h   |  8 --
 2 files changed, 32 insertions(+), 35 deletions(-)
 delete mode 100644 include/sound/tda998x.h

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
b/drivers/gpu/drm/i2c/tda998x_drv.c
index 0952eac..4dc2dc0 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -27,10 +27,14 @@
 #include 
 #include 
 #include 
-#include 

 #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)

+struct tda998x_audio {
+   u8 ports[2];/* AP value */
+   u8 port_types[2];   /* AFMT_xxx */
+};
+
 struct tda998x_priv {
struct i2c_client *cec;
struct i2c_client *hdmi;
@@ -1240,9 +1244,10 @@ static int tda998x_parse_ports(struct tda998x_priv *priv,
 {
struct device_node *of_port;
const char *port_type;
-   int ret, audio_index, reg, afmt;
+   int ret, audio_index, reg, afmt, rgb_initialized;

audio_index = 0;
+   rgb_initialized = 0;
for_each_child_of_node(np, of_port) {
if (!of_port->name
 || of_node_cmp(of_port->name, "port") != 0)
@@ -1252,11 +1257,17 @@ static int tda998x_parse_ports(struct tda998x_priv 
*priv,
if (ret < 0)
continue;
ret = of_property_read_u32(of_port, "reg", );
+   if (ret < 0) {
+   dev_err(>hdmi->dev, "missing reg for %s\n",
+   port_type);
+   return ret;
+   }
if (strcmp(port_type, "rgb") == 0) {
if (!ret) { /* video reg is optional */
priv->vip_cntrl_0 = reg >> 16;
priv->vip_cntrl_1 = reg >> 8;
priv->vip_cntrl_2 = reg;
+   rgb_initialized = 1;
}
continue;
}
@@ -1266,11 +1277,6 @@ static int tda998x_parse_ports(struct tda998x_priv *priv,
afmt = AFMT_SPDIF;
else
continue;
-   if (ret < 0) {
-   dev_err(>hdmi->dev, "missing reg for %s\n",
-   port_type);
-   return ret;
-   }
if (audio_index >= ARRAY_SIZE(priv->audio.ports)) {
dev_err(>hdmi->dev, "too many audio ports\n");
break;
@@ -1279,13 +1285,13 @@ static int tda998x_parse_ports(struct tda998x_priv 
*priv,
priv->audio.port_types[audio_index] = afmt;
audio_index++;
}
-   return 0;
+   return rgb_initialized;
 }

 static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
 {
struct device_node *np = client->dev.of_node;
-   struct device_node *of_port;
+   struct device_node *ports;
u32 video;
int rev_lo, rev_hi, ret;
unsigned short cec_addr;
@@ -1392,24 +1398,15 @@ static int tda998x_create(struct i2c_client *client, 
struct tda998x_priv *priv)

/* get the device tree parameters */
if (np) {
-   of_port = of_get_child_by_name(np, "port");
-   if (of_port) {  /* graph of ports */
-   of_node_put(of_port);
-   ret = tda998x_parse_ports(priv, np);
-   if (ret < 0)
-   goto fail;
-
-   /* initialize the default audio configuration */
-   if (priv->audio.ports[0]) {
-   priv->params.audio_cfg = priv->audio.ports[0];
-   priv->params.audio_format =
-   priv->audio.port_types[0];
-   priv->params.audio_clk_cfg =
-   priv->params.audio_format ==
-   AFMT_SPDIF ? 0 : 1;
-   }
-   } else {
-
+   ports = of_get_child_by_name(np, "ports");
+   if (!ports)
+   ports = of_node_get(np);
+   /* graph of ports */
+   ret = tda998x_parse_ports(priv, ports);
+   of_node_put(ports);
+   if (ret < 0)
+   goto fail;
+   if (ret == 0) {
/* optional video properties */
ret = 

[PATCH RFC v3 4/7] drm/i2c: tda998x: Add support of a DT graph of ports

2015-08-14 Thread Jyri Sarha
From: Jean-Francois Moine 

Two kinds of ports may be declared in a DT graph of ports: video and audio.
This patch accepts the port value from a video port as an alternative
to the video-ports property.
It also accepts audio ports in the case the transmitter is not used as
a slave encoder.
The new file include/sound/tda998x.h prepares to the definition of
a tda998x CODEC.

Signed-off-by: Jean-Francois Moine 
Signed-off-by: Jyri Sarha 
---
 .../devicetree/bindings/drm/i2c/tda998x.txt| 51 
 drivers/gpu/drm/i2c/tda998x_drv.c  | 90 +++---
 include/sound/tda998x.h|  8 ++
 3 files changed, 140 insertions(+), 9 deletions(-)
 create mode 100644 include/sound/tda998x.h

diff --git a/Documentation/devicetree/bindings/drm/i2c/tda998x.txt 
b/Documentation/devicetree/bindings/drm/i2c/tda998x.txt
index e9e4bce..35f6a80 100644
--- a/Documentation/devicetree/bindings/drm/i2c/tda998x.txt
+++ b/Documentation/devicetree/bindings/drm/i2c/tda998x.txt
@@ -16,6 +16,35 @@ Optional properties:

   - video-ports: 24 bits value which defines how the video controller
output is wired to the TDA998x input - default: <0x230145>
+   This property is not used when ports are defined.
+
+Optional nodes:
+
+  - port: up to three ports.
+   The ports are defined according to [1].
+
+Video port.
+   There may be only one video port.
+   This one must contain the following property:
+
+   - port-type: must be "rgb"
+
+   and may contain the optional property:
+
+   - reg: 24 bits value which defines how the video controller
+   output is wired to the TDA998x input (video pins)
+   When absent, the default value is <0x230145>.
+
+Audio ports.
+   There may be one or two audio ports.
+   These ones must contain the following properties:
+
+   - port-type: must be "i2s" or "spdif"
+
+   - reg: 8 bits value which defines how the audio controller
+   output is wired to the TDA998x input (audio pins)
+
+[1] Documentation/devicetree/bindings/graph.txt

 Example:

@@ -26,4 +55,26 @@ Example:
interrupts = <27 2>;/* falling edge */
pinctrl-0 = <_camera>;
pinctrl-names = "default";
+
+   port at 230145 {
+   port-type = "rgb";
+   reg = <0x230145>;
+   hdmi_0: endpoint {
+   remote-endpoint = <_0>;
+   };
+   };
+   port at 3 { /* AP1 = I2S */
+   port-type = "i2s";
+   reg = <0x03>;
+   tda998x_i2s: endpoint {
+   remote-endpoint = <_i2s>;
+   };
+   };
+   port at 4 {  /* AP2 = S/PDIF */
+   port-type = "spdif";
+   reg = <0x04>;
+   tda998x_spdif: endpoint {
+   remote-endpoint = <_spdif1>;
+   };
+   };
};
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
b/drivers/gpu/drm/i2c/tda998x_drv.c
index 424228b..0952eac 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 

 #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)

@@ -47,6 +48,8 @@ struct tda998x_priv {
wait_queue_head_t wq_edid;
volatile int wq_edid_wait;
struct drm_encoder *encoder;
+
+   struct tda998x_audio audio;
 };

 #define to_tda998x_priv(x)  ((struct tda998x_priv 
*)to_encoder_slave(x)->slave_priv)
@@ -774,6 +777,8 @@ static void tda998x_encoder_set_config(struct tda998x_priv 
*priv,
(p->mirr_f ? VIP_CNTRL_2_MIRR_F : 0);

priv->params = *p;
+   priv->audio.port_types[0] = p->audio_format;
+   priv->audio.ports[0] = p->audio_cfg;
 }

 static void tda998x_encoder_dpms(struct tda998x_priv *priv, int mode)
@@ -1230,9 +1235,57 @@ static struct drm_encoder_slave_funcs 
tda998x_encoder_slave_funcs = {

 /* I2C driver functions */

+static int tda998x_parse_ports(struct tda998x_priv *priv,
+   struct device_node *np)
+{
+   struct device_node *of_port;
+   const char *port_type;
+   int ret, audio_index, reg, afmt;
+
+   audio_index = 0;
+   for_each_child_of_node(np, of_port) {
+   if (!of_port->name
+|| of_node_cmp(of_port->name, "port") != 0)
+   continue;
+   ret = of_property_read_string(of_port, "port-type",
+   _type);
+   if (ret < 0)
+   continue;
+   ret = of_property_read_u32(of_port, "reg", );
+   if (strcmp(port_type, "rgb") == 0) {
+ 

[PATCH RFC v3 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders

2015-08-14 Thread Jyri Sarha
The hdmi-codec is a platform device driver to be registered from
drivers of external HDMI encoders with I2S and/or spdif interface. The
driver in turn registers an ASoC codec for the HDMI encoder's audio
functionality.

The structures and definitions in the API header are mostly redundant
copies of similar structures in ASoC headers. This is on purpose to
avoid direct dependencies to ASoC structures in video side driver.

Signed-off-by: Jyri Sarha 
---
 include/sound/hdmi-codec.h|  99 +
 sound/soc/codecs/Kconfig  |   5 +
 sound/soc/codecs/Makefile |   2 +
 sound/soc/codecs/hdmi-codec.c | 467 ++
 4 files changed, 573 insertions(+)
 create mode 100644 include/sound/hdmi-codec.h
 create mode 100644 sound/soc/codecs/hdmi-codec.c

diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h
new file mode 100644
index 000..b8a90f7
--- /dev/null
+++ b/include/sound/hdmi-codec.h
@@ -0,0 +1,99 @@
+/*
+ * hdmi-codec.h - HDMI Codec driver API
+ *
+ * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Author: Jyri Sarha 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef __HDMI_CODEC_H__
+#define __HDMI_CODEC_H__
+
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * Protocol between ASoC cpu-dai and HDMI-encoder
+ */
+struct hdmi_codec_daifmt {
+   enum {
+   HDMI_I2S,
+   HDMI_RIGHT_J,
+   HDMI_LEFT_J,
+   HDMI_DSP_A,
+   HDMI_DSP_B,
+   HDMI_AC97,
+   HDMI_SPDIF,
+   } fmt;
+   int bit_clk_inv:1;
+   int frame_clk_inv:1;
+   int bit_clk_master:1;
+   int frame_clk_master:1;
+};
+
+/*
+ * HDMI audio parameters
+ */
+struct hdmi_codec_params {
+   struct hdmi_audio_infoframe cea;
+   struct snd_aes_iec958 iec;
+   int sample_rate;
+   int sample_width;
+   int channels;
+};
+
+struct hdmi_codec_ops {
+   /* For runtime clock configuration from ASoC machine driver.
+* A direct forward from set_sysclk in struct snd_soc_dai_ops.
+* Optional */
+   int (*set_clk)(struct device *dev, int clk_id, int freq);
+
+   /* Called when ASoC starts an audio stream setup. The call
+* provides an audio abort callback for stoping an ongoing
+* stream if the HDMI audio becomes unavailable.
+* Optional */
+   int (*audio_startup)(struct device *dev,
+void (*abort_cb)(struct device *dev));
+
+   /* Configures HDMI-encoder for audio stream.
+* Mandatory */
+   int (*hw_params)(struct device *dev,
+struct hdmi_codec_daifmt *fmt,
+struct hdmi_codec_params *hparms);
+
+   /* Shuts down the audio stream.
+* Mandatory */
+   void (*audio_shutdown)(struct device *dev);
+
+   /* Mute/unmute HDMI audio stream.
+* Optional */
+   int (*digital_mute)(struct device *dev, bool enable);
+
+   /* Provides EDID-Like-Data from connected HDMI device.
+* Optional */
+   int (*get_eld)(struct device *dev, uint8_t *buf, size_t len);
+};
+
+/* HDMI codec initalization data */
+struct hdmi_codec_pdata {
+   struct device *dev; /* The HDMI encoder registering the codec */
+   const struct hdmi_codec_ops *ops;
+   uint i2s:1;
+   uint spdif:1;
+   int max_i2s_channels;
+};
+
+#define HDMI_CODEC_DRV_NAME "hdmi-audio-codec"
+
+#endif /* __HDMI_CODEC_H__ */
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index fc8e729..a5cc574 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -76,6 +76,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_MAX9877 if I2C
select SND_SOC_MC13783 if MFD_MC13XXX
select SND_SOC_ML26124 if I2C
+   select SND_SOC_HDMI_CODEC
select SND_SOC_PCM1681 if I2C
select SND_SOC_PCM1792A if SPI_MASTER
select SND_SOC_PCM3008
@@ -431,6 +432,10 @@ config SND_SOC_BT_SCO
 config SND_SOC_DMIC
tristate

+config SND_SOC_HDMI_CODEC
+   tristate
+   select SND_PCM_ELD
+
 config SND_SOC_ES8328
tristate "Everest Semi ES8328 CODEC"

diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 01b4601..0245e67 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -69,6 +69,7 @@ snd-soc-max98925-objs := max98925.o
 snd-soc-max9850-objs := max9850.o
 snd-soc-mc13783-objs := mc13783.o
 snd-soc-ml26124-objs := ml26124.o
+snd-soc-hdmi-codec-objs := hdmi-codec.o
 snd-soc-pcm1681-objs := 

[PATCH RFC v3 2/7] ASoC: hdmi: Remove obsolete dummy HDMI codec

2015-08-14 Thread Jyri Sarha
The hdmi stub codec has not been used since refactoring of OMAP HDMI
audio support.

Signed-off-by: Jyri Sarha 
---
 sound/soc/codecs/Kconfig  |   4 --
 sound/soc/codecs/Makefile |   2 -
 sound/soc/codecs/hdmi.c   | 109 --
 3 files changed, 115 deletions(-)
 delete mode 100644 sound/soc/codecs/hdmi.c

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index efaafce..fc8e729 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -76,7 +76,6 @@ config SND_SOC_ALL_CODECS
select SND_SOC_MAX9877 if I2C
select SND_SOC_MC13783 if MFD_MC13XXX
select SND_SOC_ML26124 if I2C
-   select SND_SOC_HDMI_CODEC
select SND_SOC_PCM1681 if I2C
select SND_SOC_PCM1792A if SPI_MASTER
select SND_SOC_PCM3008
@@ -432,9 +431,6 @@ config SND_SOC_BT_SCO
 config SND_SOC_DMIC
tristate

-config SND_SOC_HDMI_CODEC
-   tristate "HDMI stub CODEC"
-
 config SND_SOC_ES8328
tristate "Everest Semi ES8328 CODEC"

diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index cf160d9..01b4601 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -69,7 +69,6 @@ snd-soc-max98925-objs := max98925.o
 snd-soc-max9850-objs := max9850.o
 snd-soc-mc13783-objs := mc13783.o
 snd-soc-ml26124-objs := ml26124.o
-snd-soc-hdmi-codec-objs := hdmi.o
 snd-soc-pcm1681-objs := pcm1681.o
 snd-soc-pcm1792a-codec-objs := pcm1792a.o
 snd-soc-pcm3008-objs := pcm3008.o
@@ -256,7 +255,6 @@ obj-$(CONFIG_SND_SOC_MAX98925)  += snd-soc-max98925.o
 obj-$(CONFIG_SND_SOC_MAX9850)  += snd-soc-max9850.o
 obj-$(CONFIG_SND_SOC_MC13783)  += snd-soc-mc13783.o
 obj-$(CONFIG_SND_SOC_ML26124)  += snd-soc-ml26124.o
-obj-$(CONFIG_SND_SOC_HDMI_CODEC) += snd-soc-hdmi-codec.o
 obj-$(CONFIG_SND_SOC_PCM1681)  += snd-soc-pcm1681.o
 obj-$(CONFIG_SND_SOC_PCM1792A) += snd-soc-pcm1792a-codec.o
 obj-$(CONFIG_SND_SOC_PCM3008)  += snd-soc-pcm3008.o
diff --git a/sound/soc/codecs/hdmi.c b/sound/soc/codecs/hdmi.c
deleted file mode 100644
index bd42ad3..000
--- a/sound/soc/codecs/hdmi.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * ALSA SoC codec driver for HDMI audio codecs.
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Ricardo Neri 
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-#include 
-#include 
-#include 
-#include 
-
-#define DRV_NAME "hdmi-audio-codec"
-
-static const struct snd_soc_dapm_widget hdmi_widgets[] = {
-   SND_SOC_DAPM_INPUT("RX"),
-   SND_SOC_DAPM_OUTPUT("TX"),
-};
-
-static const struct snd_soc_dapm_route hdmi_routes[] = {
-   { "Capture", NULL, "RX" },
-   { "TX", NULL, "Playback" },
-};
-
-static struct snd_soc_dai_driver hdmi_codec_dai = {
-   .name = "hdmi-hifi",
-   .playback = {
-   .stream_name = "Playback",
-   .channels_min = 2,
-   .channels_max = 8,
-   .rates = SNDRV_PCM_RATE_32000 |
-   SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
-   SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
-   SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
-   .formats = SNDRV_PCM_FMTBIT_S16_LE |
-   SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE,
-   .sig_bits = 24,
-   },
-   .capture = {
-   .stream_name = "Capture",
-   .channels_min = 2,
-   .channels_max = 2,
-   .rates = SNDRV_PCM_RATE_32000 |
-   SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
-   SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
-   SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
-   .formats = SNDRV_PCM_FMTBIT_S16_LE |
-   SNDRV_PCM_FMTBIT_S24_LE,
-   },
-
-};
-
-#ifdef CONFIG_OF
-static const struct of_device_id hdmi_audio_codec_ids[] = {
-   { .compatible = "linux,hdmi-audio", },
-   { }
-};
-MODULE_DEVICE_TABLE(of, hdmi_audio_codec_ids);
-#endif
-
-static struct snd_soc_codec_driver hdmi_codec = {
-   .dapm_widgets = hdmi_widgets,
-   .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets),
-   .dapm_routes = hdmi_routes,
-   .num_dapm_routes = ARRAY_SIZE(hdmi_routes),
-   .ignore_pmdown_time = true,
-};
-
-static int hdmi_codec_probe(struct 

[PATCH RFC v3 1/7] drm/edid: add function to help find SADs, DO NOT MERGE

2015-08-14 Thread Jyri Sarha
From: Russell King - ARM Linux 

Add a function to find the start of the SADs in the ELD.  This
complements the helper to retrieve the SAD count.

Signed-off-by: Russell King 

This should already be coming in from drm-next.

Signed-off-by: Jyri Sarha 
---
 include/drm/drm_edid.h | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 7990501..53c53c4 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -348,6 +348,25 @@ static inline int drm_eld_mnl(const uint8_t *eld)
 }

 /**
+ * drm_eld_sad - Get ELD SAD structures.
+ * @eld: pointer to an eld memory structure with sad_count set
+ */
+static inline const uint8_t *drm_eld_sad(const uint8_t *eld)
+{
+   unsigned int ver, mnl;
+
+   ver = (eld[DRM_ELD_VER] & DRM_ELD_VER_MASK) >> DRM_ELD_VER_SHIFT;
+   if (ver != 2 && ver != 31)
+   return NULL;
+
+   mnl = drm_eld_mnl(eld);
+   if (mnl > 16)
+   return NULL;
+
+   return eld + DRM_ELD_CEA_SAD(mnl, 0);
+}
+
+/**
  * drm_eld_sad_count - Get ELD SAD count.
  * @eld: pointer to an eld memory structure with sad_count set
  */
-- 
1.9.1



[PATCH RFC v3 0/7] Implement generic ASoC HDMI codec and use it in tda998x

2015-08-14 Thread Jyri Sarha
This is my third RFC patch series on the subject. This time also the
tda998x driver patches are a serious attempt to come up with an
initial implementation for HDMI audio ASoC support.

Russell's "drm/edid: add function to help find SADs" is here just to
produce a working patch-set on top of mainline. It should be getting in
trough drm-next at some point.

The binding for tda998x is taken from Jean Francois' patch series[1] on
the same subject. The implementation of the of-node parsing has some
minor changes from my self.

Here is what I think at least could or should still be done, but non of
that stuff does not sounds critical right now.

Missing from tda998x driver side
- hdmi_codec_ops audio_startup() implementation for audio abort support
- multi channel audio support (I would need specs and preferably some
  HW to test for this).

Missing from ASoC side generic implementation:
- channel_allocation handling is completely left for the video side driver,
  see if ASoC side could help in any way
- snd_soc_jack functionality to handle hdmi cable plug/unplug events

[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2015-July/095596.html

Best regards,
Jyri

Jean-Francois Moine (1):
  drm/i2c: tda998x: Add support of a DT graph of ports

Jyri Sarha (5):
  ASoC: hdmi: Remove obsolete dummy HDMI codec
  ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders
  drm/i2c: tda998x: Remove include/sound/tda998x.h and fix graph parsing
  drm/i2c: tda998x: Register ASoC HDMI codec for audio functionality
  ARM: dts: am335x-boneblack: Add HDMI audio support

Russell King - ARM Linux (1):
  drm/edid: add function to help find SADs, DO NOT MERGE

 .../devicetree/bindings/drm/i2c/tda998x.txt|  51 +++
 arch/arm/boot/dts/am335x-boneblack.dts |  90 +++-
 drivers/gpu/drm/i2c/Kconfig|   1 +
 drivers/gpu/drm/i2c/tda998x_drv.c  | 336 +--
 include/drm/drm_edid.h |  19 +
 include/sound/hdmi-codec.h |  99 +
 sound/soc/codecs/Kconfig   |   3 +-
 sound/soc/codecs/Makefile  |   4 +-
 sound/soc/codecs/hdmi-codec.c  | 467 +
 sound/soc/codecs/hdmi.c| 109 -
 10 files changed, 1026 insertions(+), 153 deletions(-)
 create mode 100644 include/sound/hdmi-codec.h
 create mode 100644 sound/soc/codecs/hdmi-codec.c
 delete mode 100644 sound/soc/codecs/hdmi.c

-- 
1.9.1



[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Zhou, Jammy
Okay, I got it. Actually with current implementation, only the number of PCI 
devices on the system is returned for drmGetDevices(NULL, 0). I extracted 
related code below. I hope it can address your concern :-)

+static int drmParseSubsystemType(const char *str) {
+char link[PATH_MAX + 1] = "";
+char *name;
+
+if (readlink(str, link, PATH_MAX) < 0)
+return -EINVAL;
+
+name = strrchr(link, '/');
+if (!name)
+return -EINVAL;
+
+name++;
+
+if (strncmp(name, "pci", 3) == 0)
+return DRM_BUS_PCI;
+
+return -EINVAL;
+}
...
+subsystem_type = drmParseSubsystemType(path);
+
+if (subsystem_type < 0)
+continue;

Regards,
Jammy

-Original Message-
From: Emil Velikov [mailto:emil.l.veli...@gmail.com] 
Sent: Friday, August 14, 2015 6:05 PM
To: Zhou, Jammy
Cc: ML dri-devel
Subject: Re: [PATCH 1/5] drm: add interface to get drm devices on the system v2

On 14 August 2015 at 10:41, Zhou, Jammy  wrote:
>> What is the point in claiming that you have X+Y devices, if the API does not 
>> provide any information about Y of them ? It seems very misleading imho.
>
> I'm not sure if I understand your question correctly.
Easy - replace X with "pci" and Y with "platform/usb" :)

Or in other words:
user: "hey libdrm, how many devices do we have"
libdrm: "hey user, there are 10 devices here."
user: "great, tell me all about them"
libdrm: "sure... well I cannot tell you anything about 3 of them, but the rest 
are fine"
user: "why did you stay that they are 10, if there is no info for 3 of them ?"

Fwiw it can be argued either way but I'd suspect that the current behaviour is 
not too welcoming.

If people feel for the current behaviour I'kk be ok with it.

Thanks
Emil


i915/kasan: out of bounds access in i915_cmd_parser_init_ring

2015-08-14 Thread Dave Airlie
On 14 August 2015 at 11:09, Dave Jones  wrote:
> I finally got around to playing with kasan. It didn't end well.
>
> I added some debugging to validate_cmds_sorted to print out the table
> sizes right before the stack traces.

oops typo,

patch sent.

Dave.


linux-next: manual merge of the drm-misc tree with Linus' tree

2015-08-14 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/drm_irq.c

between commit:

  209e4dbc8dcd ("drm/vblank: Use u32 consistently for vblank counters")

from Linus' tree and commit:

  b90180b057f7 ("drm/irq: More pipe/crtc consistency cleanups")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwellsfr at canb.auug.org.au

diff --cc drivers/gpu/drm/drm_irq.c
index ee14324522ce,70919d48f015..
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@@ -74,11 -74,11 +74,11 @@@ module_param_named(vblankoffdelay, drm_
  module_param_named(timestamp_precision_usec, drm_timestamp_precision, int, 
0600);
  module_param_named(timestamp_monotonic, drm_timestamp_monotonic, int, 0600);

- static void store_vblank(struct drm_device *dev, int crtc,
+ static void store_vblank(struct drm_device *dev, unsigned int pipe,
 -   unsigned vblank_count_inc,
 +   u32 vblank_count_inc,
 struct timeval *t_vblank)
  {
-   struct drm_vblank_crtc *vblank = >vblank[crtc];
+   struct drm_vblank_crtc *vblank = >vblank[pipe];
u32 tslot;

assert_spin_locked(>vblank_time_lock);


[Intel-gfx] [PATCH] drm/i915: Fix build warning on 32-bit

2015-08-14 Thread Chris Wilson
On Fri, Aug 14, 2015 at 12:35:23PM +0200, Thierry Reding wrote:
> From: Thierry Reding 
> 
> The gtt.stolen_size field is of type size_t, and so should be printed
> using %zu to avoid build warnings on either 32-bit and 64-bit builds.

Or better would be to convert stolen.size to u32 so that we know that it
is correctly sized for the hardware irrespective of the compilation
environment.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


linux-next: manual merge of the drm-tegra tree with the drm-misc tree

2015-08-14 Thread Stephen Rothwell
Hi Thierry,

Today's linux-next merge of the drm-tegra tree got conflicts in:

  drivers/gpu/drm/tegra/dsi.c
  drivers/gpu/drm/tegra/hdmi.c
  drivers/gpu/drm/tegra/rgb.c
  drivers/gpu/drm/tegra/sor.c

between commit:

  9a69a9ac20f7 ("drm: Make the connector dpms callback return a value, v2")

from the drm-misc tree and commits:

  171e2e6dd912 ("drm/tegra: dsi: Restore DPMS")
  29871b21c48c ("drm/tegra: hdmi: Restore DPMS")
  32c3dee11e8e ("drm/tegra: rgb: Restore DPMS")
  850bab448034 ("drm/tegra: sor: Restore DPMS")

from the drm-tegra tree.

I fixed it up (the latter commits removed the code updated by the former)
and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwellsfr at canb.auug.org.au


[PATCH] drm/bridge: Fix the dw_hdmi object name

2015-08-14 Thread Fabio Estevam
From: Fabio Estevam 

Commit 66d5e6d329aed4 ("drm/bridge: Add vendor prefixes") changed
the object name to dw-hdmi.o, which breaks the build:

make[4]: *** No rule to make target `drivers/gpu/drm/bridge/dw-hdmi.o', needed 
by `drivers/gpu/drm/bridge/built-in.o'.  Stop.

Fix it by using the correct 'dw_hdmi.o' name.

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/bridge/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index fe490e2..e2eef1c 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -1,5 +1,5 @@
 ccflags-y := -Iinclude/drm

-obj-$(CONFIG_DRM_DW_HDMI) += dw-hdmi.o
+obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
-- 
1.9.1



[PATCH RFC v3 6/7] drm/i2c: tda998x: Register ASoC HDMI codec for audio functionality

2015-08-14 Thread Russell King - ARM Linux
On Fri, Aug 14, 2015 at 12:30:44PM +0300, Jyri Sarha wrote:
> +static int tda998x_write_aif(struct tda998x_priv *priv,
> +  struct hdmi_audio_infoframe *cea)
> +{
> + uint8_t buf[HDMI_INFOFRAME_SIZE(AUDIO)];
> + int len;
> +
> + len = hdmi_audio_infoframe_pack(cea, buf, sizeof(buf));
> + if (len < 0) {
> + dev_err(>hdmi->dev,
> + "Failed to pack audio infoframe: %d\n", len);
> + return len;
> + }
> +
> + /* Write the audio information packet */
> + tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, buf, len);
> + return 0;
> +}
> +

I have such a function already queued up, but I can't push it out at the
moment because of too many conflicts across all my DRM work.  I'm waiting
for after 4.3-rc1 before publishing anything from or accepting anything
else into DRM branches.

>  static void
>  tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode)
>  {
> @@ -670,19 +691,24 @@ static void tda998x_audio_mute(struct tda998x_priv 
> *priv, bool on)
>   }
>  }
>  
> -static void
> +static int
>  tda998x_configure_audio(struct tda998x_priv *priv,
> - struct drm_display_mode *mode, struct tda998x_encoder_params *p)
> + int mode_clock,
> + int ena_ap,
> + int dai_format,
> + int sample_width,
> + int sample_rate,
> + const u8 *status)

I don't think this is an improvement.

> +static int tda998x_audio_get_eld(struct device *dev, uint8_t *buf, size_t 
> len)
> +{
> + struct tda998x_priv *priv = dev_get_drvdata(dev);
> + struct drm_mode_config *config = >encoder->dev->mode_config;
> + struct drm_connector *connector;
> + int ret = -ENODEV;
> +
> + mutex_lock();
> + list_for_each_entry(connector, >connector_list, head) {
> + if (priv->encoder == connector->encoder) {
> + memcpy(buf, connector->eld, 
> +min(sizeof(connector->eld), len));
> + ret = 0;
> + }
> + }
> + mutex_unlock();

Obviously untested.  Should be config->mutex.

But in any case, when I kill the DRM slave encoder code in here, this
becomes unnecessary.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.


[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Emil Velikov
On 14 August 2015 at 10:41, Zhou, Jammy  wrote:
>> What is the point in claiming that you have X+Y devices, if the API does not 
>> provide any information about Y of them ? It seems very misleading imho.
>
> I'm not sure if I understand your question correctly.
Easy - replace X with "pci" and Y with "platform/usb" :)

Or in other words:
user: "hey libdrm, how many devices do we have"
libdrm: "hey user, there are 10 devices here."
user: "great, tell me all about them"
libdrm: "sure... well I cannot tell you anything about 3 of them, but
the rest are fine"
user: "why did you stay that they are 10, if there is no info for 3 of them ?"

Fwiw it can be argued either way but I'd suspect that the current
behaviour is not too welcoming.

If people feel for the current behaviour I'kk be ok with it.

Thanks
Emil


[PATCH RFC v3 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders

2015-08-14 Thread Russell King - ARM Linux
On Fri, Aug 14, 2015 at 12:30:41PM +0300, Jyri Sarha wrote:
> +static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
> + struct snd_pcm_hw_params *params,
> + struct snd_soc_dai *dai)
> +{
> + struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
> + struct hdmi_codec_params hp = {
> + .cea = { 0 },

Unnecessary initialisation - because you are initialising this structure,
all unnamed fields will be zeroed.

> + .iec = {
> + .status = {
> + IEC958_AES0_CON_NOT_COPYRIGHT,
> + IEC958_AES1_CON_GENERAL,
> + IEC958_AES2_CON_SOURCE_UNSPEC,
> + IEC958_AES3_CON_CLOCK_VARIABLE,
> + },

...

> + hdmi_audio_infoframe_init();
> + hp.cea.coding_type = HDMI_AUDIO_CODING_TYPE_PCM;

Something tells me here that you haven't read the HDMI specification.
HDMI says that the coding type will be zero (refer to stream header).
The same goes for much of the CEA audio infoframe.  Please see the
Audio InfoFrame details in the HDMI specification.

> + hp.cea.channels = params_channels(params);
> +
> + switch (params_width(params)) {
> + case 16:
> + hp.iec.status[4] |= IEC958_AES4_CON_WORDLEN_20_16;
> + hp.cea.sample_size = HDMI_AUDIO_SAMPLE_SIZE_16;
> + break;
> + case 18:
> + hp.iec.status[4] |= IEC958_AES4_CON_WORDLEN_22_18;
> + hp.cea.sample_size = HDMI_AUDIO_SAMPLE_SIZE_20;
> + break;
> + case 20:
> + hp.iec.status[4] |= IEC958_AES4_CON_WORDLEN_24_20;
> + hp.cea.sample_size = HDMI_AUDIO_SAMPLE_SIZE_20;
> + break;
> + case 24:
> + case 32:
> + hp.iec.status[4] |= IEC958_AES4_CON_MAX_WORDLEN_24 |
> + IEC958_AES4_CON_WORDLEN_24_20;

Why not use the generic code to generate the AES channel status bits?
See sound/core/pcm_iec958.c.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.


[Bug 91588] [LLVM] (bisected) Unigine Valley: High + AA = incorrect rendering

2015-08-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=91588

--- Comment #6 from Marek Olšák  ---
The problematic commit has been reverted in the release_37 LLVM branch. The
exact fix for master has yet to be tackled, though Tom seems to have an idea
what's wrong there.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/82cd1fc8/attachment.html>


[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Kai Wasserbäch
Emil Velikov wrote on 14.08.2015 10:17:
> On 14 August 2015 at 08:59, Kai Wasserbäch  
> wrote:
>> Zhou, Jammy wrote on 14.08.2015 07:59:
>>> We tried several different ways already for the enumeration interface 
>>> (libpciaccess, libudev, etc). But we ran into some problems with these 
>>> options for example when run Steam games which ships 32bit libraries 
>>> (including libudev) in the steam runtime, so finally we decided to use 
>>> sysfs directly to avoid introducing some additional dependencies into 
>>> libdrm.
>>
>> The reason sounds wrong. There was a similar discussion over at Mesa. I think
>> you (as in hardware/driver vendors like AMD/Intel/Nvidia) need to push Valve 
>> (or
>> the game devs through Valve or directly) to fix their setup. Steam runtime is
>> fine and all, but please only pre-load it, if needed (ie. library foo is 
>> missing
>> on the system and can't be installed through the package manager). IIRC the
>> VMWare guys said in the Mesa discussion, they have a script in place for 
>> their
>> virtualisation products, that checks whether a library needs to be loaded 
>> from
>> their "baseline directory" or from the system.
>>
>> Working around a bug/design flaw in Steam's Linux version doesn't sound like 
>> a
>> supportable solution in the long run. As long as you let them get away with
>> that, you will face this problem over and over with different libraries. 
>> (For me
>> it's usually libstdc++ (needed by LLVM), libncurses and a few X(CB) 
>> libraries I
>> need to remove from Steam, before anything works. Though I do have script for
>> that, that I can run after every upgrade, this is not a solution for 
>> everyone.)
>>
> Helping and applying pressure to resolve the issue is the way to go.
> But until that is resolved it's great to have a solution that does not
> lead to a crash. It feels rude towards you and other users to
> deliberately use the problematic combo and expect from you to remove
> libfoo.so.

Well, I'd rather remove stuff from Steam's runtime than burden you and other
developers with maintaing code that is unnecessrily ugly. (Though that's
obviously just my opinion.)

> When things get sorted out, we can easily replace this (a tad ugly
> implementation) with libudev.

As long as you allow this behaviour by working around it, I don't see Valve/game
developers "invest" in a real solution (because it works now). Businesses
usually only move from a position, when there's outside pressure and a clear
advantage to do so (here: no bug reports about crashing games).

Anyway, this was just my two cents and you can obviously decide in any way you
deem to be the best.

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 630 bytes
Desc: OpenPGP digital signature
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/3868c08d/attachment.sig>


[RFC 11/13] drm/dp: Add helper to dump DPCD

2015-08-14 Thread Rafael Antognolli
On Fri, Aug 14, 2015 at 02:56:55PM +0300, Jani Nikula wrote:
> On Wed, 12 Aug 2015, Thierry Reding  wrote:
> > From: Thierry Reding 
> >
> > The new drm_dp_dpcd_dump() helper dumps the contents of a DPCD to a
> > seq_file and can be used to make the DPCD available via debugfs for
> > example.
> 
> See i915/i915_debugfs.c for one DPCD dump implementation.
> 
> Around the time that was added, there was also some discussion (and
> patches [1]) to expose a read/write debugfs interface to DPCD, letting
> userspace access arbitrary DPCD registers.
> 
> Just this week there was some discussion about revisiting that. It was
> about accessing some proprietary panel features, but there's also the
> ease of debugging without having to keep updating the kernel to dump
> more.
> 
> I think it would be great to agree on a common debugfs interface to
> access DPCD arbitrarily. Last time I checked, the blocker to that was
> access to the aux channel from generic code; it's always driver
> specific. SMOP. ;)

Do you mean it would require the generic code/interface to somehow route
this to the driver specific code? I am not sure yet how this works (if
there's something like it around), but I'll take a look.

> I could put some effort into this (maybe Rafael too?), as long as we
> could agree on the interface. As I wrote in the referenced thread, I
> wasn't thrilled about what was proposed.
> 

Yes, I'm willing to put effort into this, for sure. Any help pointing to
which direction to follow is greatly appreciated.

Thanks,
Rafael

> 
> 
> [1] http://mid.gmane.org/1428493301-20293-1-git-send-email-durgadoss.r at 
> intel.com
> 
> 
> 
> >
> > Signed-off-by: Thierry Reding 
> > ---
> >  drivers/gpu/drm/drm_dp_helper.c | 146 
> > 
> >  include/drm/drm_dp_helper.h |   2 +
> >  2 files changed, 148 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_helper.c 
> > b/drivers/gpu/drm/drm_dp_helper.c
> > index 8968201ea93c..ea74884c9cb3 100644
> > --- a/drivers/gpu/drm/drm_dp_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > @@ -27,6 +27,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> >  
> > @@ -292,6 +293,151 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux 
> > *aux,
> >  }
> >  EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
> >  
> > +/**
> > + * drm_dp_dpcd_dump() - dump DPCD content
> > + * @aux: DisplayPort AUX channel
> > + * @s: destination for DPCD dump
> > + *
> > + * Reads registers from the DPCD via a DisplayPort AUX channel and dumps 
> > them
> > + * to a seq_file.
> > + */
> > +void drm_dp_dpcd_dump(struct drm_dp_aux *aux, struct seq_file *s)
> > +{
> > +#define DUMP_REG(aux, offset) ({   \
> > +   u8 value;   \
> > +   int err;\
> > +   err = drm_dp_dpcd_readb(aux, offset, );   \
> > +   if (err < 0) {  \
> > +   dev_err((aux)->dev, "failed to read %s: %d\n",  \
> > +   #offset, err);  \
> > +   return; \
> > +   }   \
> > +   seq_printf(s, "%-35s 0x%04x 0x%02x\n", #offset, offset, \
> > +  value);  \
> > +   })
> > +
> > +   DUMP_REG(aux, DP_DPCD_REV);
> > +   DUMP_REG(aux, DP_MAX_LINK_RATE);
> > +   DUMP_REG(aux, DP_MAX_LANE_COUNT);
> > +   DUMP_REG(aux, DP_MAX_DOWNSPREAD);
> > +   DUMP_REG(aux, DP_NORP);
> > +   DUMP_REG(aux, DP_DOWNSTREAMPORT_PRESENT);
> > +   DUMP_REG(aux, DP_MAIN_LINK_CHANNEL_CODING);
> > +   DUMP_REG(aux, DP_DOWN_STREAM_PORT_COUNT);
> > +   DUMP_REG(aux, DP_RECEIVE_PORT_0_CAP_0);
> > +   DUMP_REG(aux, DP_RECEIVE_PORT_0_BUFFER_SIZE);
> > +   DUMP_REG(aux, DP_RECEIVE_PORT_1_CAP_0);
> > +   DUMP_REG(aux, DP_RECEIVE_PORT_1_BUFFER_SIZE);
> > +   DUMP_REG(aux, DP_I2C_SPEED_CAP);
> > +   DUMP_REG(aux, DP_EDP_CONFIGURATION_CAP);
> > +   DUMP_REG(aux, DP_TRAINING_AUX_RD_INTERVAL);
> > +   DUMP_REG(aux, DP_ADAPTER_CAP);
> > +   DUMP_REG(aux, DP_SUPPORTED_LINK_RATES);
> > +   DUMP_REG(aux, DP_FAUX_CAP);
> > +   DUMP_REG(aux, DP_MSTM_CAP);
> > +   DUMP_REG(aux, DP_NUMBER_OF_AUDIO_ENDPOINTS);
> > +   DUMP_REG(aux, DP_AV_GRANULARITY);
> > +   DUMP_REG(aux, DP_AUD_DEC_LAT0);
> > +   DUMP_REG(aux, DP_AUD_DEC_LAT1);
> > +   DUMP_REG(aux, DP_AUD_PP_LAT0);
> > +   DUMP_REG(aux, DP_AUD_PP_LAT1);
> > +   DUMP_REG(aux, DP_VID_INTER_LAT);
> > +   DUMP_REG(aux, DP_VID_PROG_LAT);
> > +   DUMP_REG(aux, DP_REP_LAT);
> > +   DUMP_REG(aux, DP_AUD_DEL_INS0);
> > +   DUMP_REG(aux, DP_AUD_DEL_INS1);
> > +   DUMP_REG(aux, DP_AUD_DEL_INS2);
> > +   DUMP_REG(aux, DP_RECEIVER_ALPM_CAP);
> > +   DUMP_REG(aux, DP_AUD_DEL_INS0);
> > +   DUMP_REG(aux, DP_GUID);
> > +   DUMP_REG(aux, 

[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Emil Velikov
On 14 August 2015 at 09:26, Kai Wasserbäch  
wrote:
> Emil Velikov wrote on 14.08.2015 10:17:
>> On 14 August 2015 at 08:59, Kai Wasserbäch  
>> wrote:
>>> Zhou, Jammy wrote on 14.08.2015 07:59:
 We tried several different ways already for the enumeration interface 
 (libpciaccess, libudev, etc). But we ran into some problems with these 
 options for example when run Steam games which ships 32bit libraries 
 (including libudev) in the steam runtime, so finally we decided to use 
 sysfs directly to avoid introducing some additional dependencies into 
 libdrm.
>>>
>>> The reason sounds wrong. There was a similar discussion over at Mesa. I 
>>> think
>>> you (as in hardware/driver vendors like AMD/Intel/Nvidia) need to push 
>>> Valve (or
>>> the game devs through Valve or directly) to fix their setup. Steam runtime 
>>> is
>>> fine and all, but please only pre-load it, if needed (ie. library foo is 
>>> missing
>>> on the system and can't be installed through the package manager). IIRC the
>>> VMWare guys said in the Mesa discussion, they have a script in place for 
>>> their
>>> virtualisation products, that checks whether a library needs to be loaded 
>>> from
>>> their "baseline directory" or from the system.
>>>
>>> Working around a bug/design flaw in Steam's Linux version doesn't sound 
>>> like a
>>> supportable solution in the long run. As long as you let them get away with
>>> that, you will face this problem over and over with different libraries. 
>>> (For me
>>> it's usually libstdc++ (needed by LLVM), libncurses and a few X(CB) 
>>> libraries I
>>> need to remove from Steam, before anything works. Though I do have script 
>>> for
>>> that, that I can run after every upgrade, this is not a solution for 
>>> everyone.)
>>>
>> Helping and applying pressure to resolve the issue is the way to go.
>> But until that is resolved it's great to have a solution that does not
>> lead to a crash. It feels rude towards you and other users to
>> deliberately use the problematic combo and expect from you to remove
>> libfoo.so.
>
> Well, I'd rather remove stuff from Steam's runtime than burden you and other
> developers with maintaing code that is unnecessrily ugly. (Though that's
> obviously just my opinion.)
>
>> When things get sorted out, we can easily replace this (a tad ugly
>> implementation) with libudev.
>
> As long as you allow this behaviour by working around it,
There is a saying (roughly translated to) "The wiser man always steps
back". Or we could/should be like Linus - "F* you $company"

> I don't see Valve/game
> developers "invest" in a real solution (because it works now). Businesses
> usually only move from a position, when there's outside pressure and a clear
> advantage to do so (here: no bug reports about crashing games).
>
There have been plenty of reports opened wrt
libudev/libgcc_s/libstdc++ on their trackers and seemingly limited
interest to fix things.

This is a catch 20/20 afaics. "FOSS drivers do not work thus they are
s**t" is how a sizeable hunk of people think. They rarely consider
what the actual issue might be, because "I installed the nvidia/amd
proprietary drivers and things work now".

> Anyway, this was just my two cents and you can obviously decide in any way you
> deem to be the best.
>
Personally, I'd love if there was no "options" and we can just use
libfoo. Who knows Valve devs might get a wake up call and fix the
problem ?


-Emil
P.S. Fun fact: Valve's annual "TI" Dota2 tournament managed to
accumulate some 66 million USD gross income, over 100 days.


[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Kai Wasserbäch
Zhou, Jammy wrote on 14.08.2015 07:59:
> We tried several different ways already for the enumeration interface 
> (libpciaccess, libudev, etc). But we ran into some problems with these 
> options for example when run Steam games which ships 32bit libraries 
> (including libudev) in the steam runtime, so finally we decided to use sysfs 
> directly to avoid introducing some additional dependencies into libdrm.

The reason sounds wrong. There was a similar discussion over at Mesa. I think
you (as in hardware/driver vendors like AMD/Intel/Nvidia) need to push Valve (or
the game devs through Valve or directly) to fix their setup. Steam runtime is
fine and all, but please only pre-load it, if needed (ie. library foo is missing
on the system and can't be installed through the package manager). IIRC the
VMWare guys said in the Mesa discussion, they have a script in place for their
virtualisation products, that checks whether a library needs to be loaded from
their "baseline directory" or from the system.

Working around a bug/design flaw in Steam's Linux version doesn't sound like a
supportable solution in the long run. As long as you let them get away with
that, you will face this problem over and over with different libraries. (For me
it's usually libstdc++ (needed by LLVM), libncurses and a few X(CB) libraries I
need to remove from Steam, before anything works. Though I do have script for
that, that I can run after every upgrade, this is not a solution for everyone.)

Cheers,
Kai

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 630 bytes
Desc: OpenPGP digital signature
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150814/8fc83d82/attachment-0001.sig>


[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Zhou, Jammy
> There have been plenty of reports opened wrt libudev/libgcc_s/libstdc++ on 
> their trackers and seemingly limited interest to fix things.

Yes, there are a bunch of issues reported for this already. But it looks like 
Valve has no plan to fix these issues. For example,
https://github.com/ValveSoftware/steam-runtime/issues/13

IMHO, we can probably use sysfs first, and when the issue is solved by Valve, 
we can switch to the udev solution later.

Regards,
Jammy

-Original Message-
From: Emil Velikov [mailto:emil.l.veli...@gmail.com] 
Sent: Friday, August 14, 2015 5:08 PM
To: Kai Wasserbäch
Cc: Zhou, Jammy; Daniel Vetter; ML dri-devel
Subject: Re: [PATCH 1/5] drm: add interface to get drm devices on the system v2

On 14 August 2015 at 09:26, Kai Wasserbäch  
wrote:
> Emil Velikov wrote on 14.08.2015 10:17:
>> On 14 August 2015 at 08:59, Kai Wasserbäch  
>> wrote:
>>> Zhou, Jammy wrote on 14.08.2015 07:59:
 We tried several different ways already for the enumeration interface 
 (libpciaccess, libudev, etc). But we ran into some problems with these 
 options for example when run Steam games which ships 32bit libraries 
 (including libudev) in the steam runtime, so finally we decided to use 
 sysfs directly to avoid introducing some additional dependencies into 
 libdrm.
>>>
>>> The reason sounds wrong. There was a similar discussion over at 
>>> Mesa. I think you (as in hardware/driver vendors like 
>>> AMD/Intel/Nvidia) need to push Valve (or the game devs through Valve 
>>> or directly) to fix their setup. Steam runtime is fine and all, but 
>>> please only pre-load it, if needed (ie. library foo is missing on 
>>> the system and can't be installed through the package manager). IIRC 
>>> the VMWare guys said in the Mesa discussion, they have a script in 
>>> place for their virtualisation products, that checks whether a library 
>>> needs to be loaded from their "baseline directory" or from the system.
>>>
>>> Working around a bug/design flaw in Steam's Linux version doesn't 
>>> sound like a supportable solution in the long run. As long as you 
>>> let them get away with that, you will face this problem over and 
>>> over with different libraries. (For me it's usually libstdc++ 
>>> (needed by LLVM), libncurses and a few X(CB) libraries I need to 
>>> remove from Steam, before anything works. Though I do have script 
>>> for that, that I can run after every upgrade, this is not a solution 
>>> for everyone.)
>>>
>> Helping and applying pressure to resolve the issue is the way to go.
>> But until that is resolved it's great to have a solution that does 
>> not lead to a crash. It feels rude towards you and other users to 
>> deliberately use the problematic combo and expect from you to remove 
>> libfoo.so.
>
> Well, I'd rather remove stuff from Steam's runtime than burden you and 
> other developers with maintaing code that is unnecessrily ugly. 
> (Though that's obviously just my opinion.)
>
>> When things get sorted out, we can easily replace this (a tad ugly
>> implementation) with libudev.
>
> As long as you allow this behaviour by working around it,
There is a saying (roughly translated to) "The wiser man always steps back". Or 
we could/should be like Linus - "F* you $company"

> I don't see Valve/game
> developers "invest" in a real solution (because it works now). 
> Businesses usually only move from a position, when there's outside 
> pressure and a clear advantage to do so (here: no bug reports about crashing 
> games).
>
There have been plenty of reports opened wrt libudev/libgcc_s/libstdc++ on 
their trackers and seemingly limited interest to fix things.

This is a catch 20/20 afaics. "FOSS drivers do not work thus they are s**t" is 
how a sizeable hunk of people think. They rarely consider what the actual issue 
might be, because "I installed the nvidia/amd proprietary drivers and things 
work now".

> Anyway, this was just my two cents and you can obviously decide in any 
> way you deem to be the best.
>
Personally, I'd love if there was no "options" and we can just use libfoo. Who 
knows Valve devs might get a wake up call and fix the problem ?


-Emil
P.S. Fun fact: Valve's annual "TI" Dota2 tournament managed to accumulate some 
66 million USD gross income, over 100 days.


[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Zhou, Jammy
> What is the point in claiming that you have X+Y devices, if the API does not 
> provide any information about Y of them ? It seems very misleading imho.

I'm not sure if I understand your question correctly. Do you mean if the Y 
devices will be enumerated with current implementation? If so, I think the 
answer should be 'NO', since other bus types (i.e, platform, USB) are not 
supported yet.

Regards,
Jammy

-Original Message-
From: Emil Velikov [mailto:emil.l.veli...@gmail.com] 
Sent: Friday, August 14, 2015 4:35 PM
To: Zhou, Jammy
Cc: ML dri-devel
Subject: Re: [PATCH 1/5] drm: add interface to get drm devices on the system v2

On 14 August 2015 at 06:53, Zhou, Jammy  wrote:
> Hi Emil,
>
>> If there are any other devices they will still be counted when 
>> drmGetDevices(NULL, 0)... Is that intentional ?
> Yes, I think so, so that this interface can support different kinds of 
> devices in the future. For example, we have some ARM platforms supporting 
> PCIE, in which case we can connect one PCIE graphics card, then there will be 
> one GPU with the platform bus (integrated GPU in the ARM SOC), and one 
> discrete GPU on the PCIE bus.
>
What is the point in claiming that you have X+Y devices, if the API does not 
provide any information about Y of them ? It seems very misleading imho.

>> Something funny is happening here - on my intel system vendor_id is reported 
>> as 0xff86, instead of 0x8086. Subvendor/device are also messed up - ffaa and 
>> ffda instead of 17aa + 21da.
> That's really interesting. Did you try to update the system BIOS?
>
Seems like a C Programming 101 issue to me rather than a BIOS one.The
(signed) char 0x86 gets extended/promoted to 0xff86 and then all hell breaks 
loose. Adding typecast(s) should fix it. That does not excuse me from writing 
is so weird from the start :)

Thanks for tweaking/ironing the bugs out.
Emil


[PATCH 1/5] drm: add interface to get drm devices on the system v2

2015-08-14 Thread Emil Velikov
On 14 August 2015 at 06:53, Zhou, Jammy  wrote:
> Hi Emil,
>
>> If there are any other devices they will still be counted when 
>> drmGetDevices(NULL, 0)... Is that intentional ?
> Yes, I think so, so that this interface can support different kinds of 
> devices in the future. For example, we have some ARM platforms supporting 
> PCIE, in which case we can connect one PCIE graphics card, then there will be 
> one GPU with the platform bus (integrated GPU in the ARM SOC), and one 
> discrete GPU on the PCIE bus.
>
What is the point in claiming that you have X+Y devices, if the API
does not provide any information about Y of them ? It seems very
misleading imho.

>> Something funny is happening here - on my intel system vendor_id is reported 
>> as 0xff86, instead of 0x8086. Subvendor/device are also messed up - ffaa and 
>> ffda instead of 17aa + 21da.
> That's really interesting. Did you try to update the system BIOS?
>
Seems like a C Programming 101 issue to me rather than a BIOS one.The
(signed) char 0x86 gets extended/promoted to 0xff86 and then all hell
breaks loose. Adding typecast(s) should fix it. That does not excuse
me from writing is so weird from the start :)

Thanks for tweaking/ironing the bugs out.
Emil


[PATCH] drm: rcar-du: Fix plane state free in plane reset handler

2015-08-14 Thread Daniel Vetter
On Fri, Aug 14, 2015 at 12:19:03AM +0300, Laurent Pinchart wrote:
> On Friday 07 August 2015 17:30:08 Laurent Pinchart wrote:
> > On Friday 07 August 2015 14:53:22 Thierry Reding wrote:
> > > On Thu, Aug 06, 2015 at 03:23:00AM +0300, Laurent Pinchart wrote:
> > > > The plane reset handler frees the plane state and allocates a new
> > > > default state, but when doing so attempt to free the plane state using
> > > > the base plane state pointer instead of casting it to the
> > > > driver-specific state object that has been allocated. Fix it by using
> > > > the rcar_du_plane_atomic_destroy_state() function to destroy the plane
> > > > state instead of duplicating the code.
> > > > 
> > > > Signed-off-by: Laurent Pinchart
> > > > 
> > > > ---
> > > > 
> > > >  drivers/gpu/drm/rcar-du/rcar_du_plane.c | 45 --
> > > >  1 file changed, 22 insertions(+), 23 deletions(-)
> > > > 
> > > > Should the DRM core free the atomic state before calling the reset
> > > > operation ? That would simplify drivers.
> > > 
> > > The core can't do that because drivers might have subclassed the state.
> > 
> > But the core can call the .atomic_destroy_state() operation, can't it ?
> 
> Thierry, Daniel, any comment on this ?

Doesn't really help you since the kzalloc is still in the helper. Btw this
is all helper code, core won't do here anything at all ;-)

But we could still do it simply as a refactoring and to show drivers how
to implement their _reset with less copypasting.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


  1   2   >