[PATCH] gpu: drm: nouveau: nvif: device: Remove unused function

2015-01-13 Thread Rickard Strandqvist
2015-01-12 0:13 GMT+01:00 Ben Skeggs :
> On Sun, Jan 11, 2015 at 11:53 PM, Rickard Strandqvist
>  wrote:
>
> Hey Rickard,
>
>> Remove the function nvif_device_new() that is not used anywhere.
> It's used, just not by the kernel.  All the code under core/ and nvif/
> is also built into a userspace library (not in the kernel tree,
> obviously) and used by tools / testing apps.
>
> I'll pick up the rest of your nouveau patches though, aside from the
> one Samuel is taking care of.
>
> Thanks,
> Ben.
>
>>
>> This was partially found by using a static code analysis program called 
>> cppcheck.
>>
>> Signed-off-by: Rickard Strandqvist > spectrumdigital.se>
>> ---
>>  drivers/gpu/drm/nouveau/nvif/device.c |   18 --
>>  drivers/gpu/drm/nouveau/nvif/device.h |2 --
>>  2 files changed, 20 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/nouveau/nvif/device.c 
>> b/drivers/gpu/drm/nouveau/nvif/device.c
>> index f477579..8522aa9 100644
>> --- a/drivers/gpu/drm/nouveau/nvif/device.c
>> +++ b/drivers/gpu/drm/nouveau/nvif/device.c
>> @@ -53,24 +53,6 @@ nvif_device_del(struct nvif_device *device)
>> kfree(device);
>>  }
>>
>> -int
>> -nvif_device_new(struct nvif_object *parent, u32 handle, u32 oclass,
>> -   void *data, u32 size, struct nvif_device **pdevice)
>> -{
>> -   struct nvif_device *device = kzalloc(sizeof(*device), GFP_KERNEL);
>> -   if (device) {
>> -   int ret = nvif_device_init(parent, nvif_device_del, handle,
>> -  oclass, data, size, device);
>> -   if (ret) {
>> -   kfree(device);
>> -   device = NULL;
>> -   }
>> -   *pdevice = device;
>> -   return ret;
>> -   }
>> -   return -ENOMEM;
>> -}
>> -
>>  void
>>  nvif_device_ref(struct nvif_device *device, struct nvif_device **pdevice)
>>  {
>> diff --git a/drivers/gpu/drm/nouveau/nvif/device.h 
>> b/drivers/gpu/drm/nouveau/nvif/device.h
>> index 43180f9..8440848 100644
>> --- a/drivers/gpu/drm/nouveau/nvif/device.h
>> +++ b/drivers/gpu/drm/nouveau/nvif/device.h
>> @@ -22,8 +22,6 @@ int  nvif_device_init(struct nvif_object *, void 
>> (*dtor)(struct nvif_device *),
>>   u32 handle, u32 oclass, void *, u32,
>>   struct nvif_device *);
>>  void nvif_device_fini(struct nvif_device *);
>> -int  nvif_device_new(struct nvif_object *, u32 handle, u32 oclass,
>> -void *, u32, struct nvif_device **);
>>  void nvif_device_ref(struct nvif_device *, struct nvif_device **);
>>
>>  /*XXX*/
>> --
>> 1.7.10.4
>>
>> ___
>> dri-devel mailing list
>> dri-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel


Hi Ben

Okay, thanks good to know.


Kind regards
Rickard Strandqvist


[Bug 73530] Asus U38N: Black screen with Radeon driver in Linux

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=73530

--- Comment #74 from Paul Menzel  ---
(In reply to Alex Deucher from comment #73)
> (In reply to Benjamin from comment #72)
> > I'm having the same issue, but it seems to be getting worse with newer
> > kernels. I was able to do the suspend/resume trick to get a working screen,
> > but this seems to have stopped working with kernel 3.16 and 3.17. No amount
> > of suspending/resuming seems to get the screen to appear now, so I've had to
> > stick with 3.15 for the time being. I'm on Arch, so packages are fairly
> > generic, but I can provide any information that would help.
> 
> Can you bisect and see what commit made it worse?  That might help narrow
> down the problem.

Alex, I’ll soon have access to that device again. Unfortunately, doing a 
bisect
for me does not work as there is no clear way to figure out if it worked or
not.

Isn’t there some software, testing “all panel timings” and the user can 
say,
which worked?

That Asus laptop is/was one of the few AMD laptops out there, so it’s sad that
GNU/Linux doesn’t run properly on it.

-- 
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/20150113/14913bfd/attachment.html>


[PATCH] reservation: wait only with non-zero timeout specified (v3)

2015-01-13 Thread Daniel Vetter
On Tue, Jan 13, 2015 at 11:18:19AM +0100, Maarten Lankhorst wrote:
> Op 13-01-15 om 10:22 schreef Christian König:
> > Am 13.01.2015 um 10:04 schrieb Maarten Lankhorst:
> >> Op 13-01-15 om 10:36 schreef Jammy Zhou:
> >>> When the timeout value passed to reservation_object_wait_timeout_rcu
> >>> is zero, no wait should be done if the fences are not signaled.
> >>>
> >>> Return '1' for idle and '0' for busy if the specified timeout is '0'
> >>> to keep consistent with the case of non-zero timeout.
> >>>
> >>> v2: call fence_put if not signaled in the case of timeout==0
> >>>
> >>>
> >> Looks more sane, but where do you need this?
> >
> > The rational is that we want a single function to call from the driver no 
> > matter what timeout we have and get a zero if the call timed out and a non 
> > zero value otherwise.
> >
> > When we called reservation_object_wait_timeout_rcu with a timeout of zero 
> > we got a return value of zero as well independent of whether or not the 
> > fences were signaled. That behavior looked inconsistent and Jammy is trying 
> > to fix this with this patch.
> >
> > We could of course do the check in the calling code as well, but to me it 
> > rather looked like the calling convention of 
> > reservation_object_wait_timeout_rcu should be thought over one more time.
> >
> > Either calling it with timeout=0 is invalid and the driver needs to call 
> > reservation_object_test_signaled_rcu directly instead or we apply this 
> > patch or something similar to get an useful behavior in the case of 
> > timeout=0.
> I think it would be best to leave timeout=0 returning 0. Not handling it 
> differently gives the same semantics as used by fence_wait_time and 
> wait_event_timeout.
> Are there really many cases in which you don't know if timeout = 0 before or 
> not?

Yeah I think with this it's more important to be consistent with all the
other wait_something primitives the kernel exposes.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


[Bug 49322] No picture on display connected via Displayport adaptor to HD 7870

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=49322

--- Comment #5 from Kat  ---
Still present in kernels 
3.19.0-031900rc4
3.13.0-44
3.13.0-43
3.13.0-30
3.13.0-29

Also happens with just the DVI-D connector as well. Black screen only way out
is with ALT+SysReq+REISUB

You can't even switch to TTY1-6 with CTRL+ALT+F1-F6

-- 
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/20150113/23e25a56/attachment.html>


[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #12 from Sandro  ---
glitches disapper from me too with 'high' parameter.

-- 
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/20150113/2205c20a/attachment.html>


[Bug 76490] Hang during boot when DPM is on (R9 270X)

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=76490

--- Comment #30 from Alex Deucher  ---
(In reply to dex+fdobugzilla from comment #29)
> I can confirm the patch works.
> 
> Will this be part of 3.19?

yes and stable kernels.

-- 
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/20150113/76e3ff2d/attachment.html>


[Bug 76490] Hang during boot when DPM is on (R9 270X)

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=76490

--- Comment #29 from dex+fdobugzilla at dragonslave.de ---
I can confirm the patch works.

Will this be part of 3.19?

-- 
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/20150113/683a4751/attachment.html>


[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #11 from Clésio Luiz  ---
(In reply to Alex Deucher from comment #10)
> It looks like maybe the dpm memory reclocking occasionally misses the
> vblank.  Do you still get the glitches if you connect a secondary display or
> disable dynamic clocking?  To disable able dynamic clocking (as root):
> echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level
> to re-enable it (as root):
> echo auto > /sys/class/drm/card0/device/power_dpm_force_performance_level

The High value makes the glitches go away. As soon as I set the Auto value, the
glitches reappear.

I don't have access to a second display to test right now, only tomorrow.

-- 
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/20150113/4b292b74/attachment-0001.html>


[PATCH v9 1/4] drm/i2c: tda998x: Add DT support for audio

2015-01-13 Thread Jyri Sarha
On 01/13/2015 09:26 PM, Russell King - ARM Linux wrote:
> SCLK: _~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_
>WS: __~
> I2S1: llmmllmmllm
> I2S2: llmmllmmllm
> I2S3: llmmllmmllm
> I2S4: llmmllmmllm
>
> So, what I'm saying is that it is_impossible_  to drive the TDA998x using
> multiple I2S streams which are not produced by the same I2S block.

This is besides the point, but it is possible that one of the multiple 
I2S blocks is the bit-clock and frame-clock master to the i2s bus and 
the others are slaves to it (banging their bits according to SCLK and WS 
of the I2S master). However, in this situation there really is only one 
i2s bus with multiple data pins.

Just my 0.02€ to this discussion.


[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #10 from Alex Deucher  ---
It looks like maybe the dpm memory reclocking occasionally misses the vblank. 
Do you still get the glitches if you connect a secondary display or disable
dynamic clocking?  To disable able dynamic clocking (as root):
echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level
to re-enable it (as root):
echo auto > /sys/class/drm/card0/device/power_dpm_force_performance_level

-- 
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/20150113/ede4e30f/attachment.html>


[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #9 from Clésio Luiz  ---
(In reply to Clésio Luiz from comment #8)

> I cant get the video with tools like Kazam or SimpleScreenRecorder. I have
> to grab it with a external camera.

I mean, the glitches don't appear in the video files created with the above
tools, for some reason. The only way to show you guys the problem is to record
it with a external camera.

-- 
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/20150113/a4c79e60/attachment.html>


[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #8 from Clésio Luiz  ---
(In reply to Michel Dänzer from comment #1)
> Please attach /var/log/Xorg.0.log and the output of dmesg.
> 
> Can you upload the video somewhere?
> 
> If not, please provide more details about the glitches, e.g.: Are they
> always visible, or only intermittently? If the latter, how often? Does the
> vertical location of the glitches change or is it always the same? ...

I set the 120Hz and restarted. Then I opened Konsole and got the results and
put then as attachments.

Finally got a video and put it in Youtube:

https://www.youtube.com/watch?v=W7a9nrwPPeY

I cant get the video with tools like Kazam or SimpleScreenRecorder. I have to
grab it with a external camera.

The glitches are intermittently. The image cam be fine for a fell seconds then
the glitches show themselves.

-- 
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/20150113/36554062/attachment.html>


[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #7 from Clésio Luiz  ---
Created attachment 112181
  --> https://bugs.freedesktop.org/attachment.cgi?id=112181=edit
/var/log/Xorg.0.log

-- 
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/20150113/12159dbd/attachment.html>


[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #6 from Clésio Luiz  ---
Created attachment 112180
  --> https://bugs.freedesktop.org/attachment.cgi?id=112180=edit
dmesg

-- 
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/20150113/473bb3d9/attachment.html>


[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #5 from Alex Deucher  ---
Yes, it seems to work now.

-- 
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/20150113/c5fd70e2/attachment.html>


[Bug 90861] Panic on suspend from KDE with radeon

2015-01-13 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=90861

--- Comment #7 from Jon Arne Jørgensen  ---
I retried some kernels, and it seems like the problem was introduced in the
3.18 merge window.

In v3.17 I can't reproduce the panic, while in v3.18-rc1 and later I can
reproduce the panic.

I'm trying to bisect now, but I'm troubled by a gpu freeze bug in some of the
commits that crashes Xorg before I'm able to suspend the computer.

It looks like a bug early in the v3.18 merge window, but I'm not sure if I
should skip the crashing commits while doing the bisect?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


[PATCH] drm/radeon/radeon_i2c: Remove unused function

2015-01-13 Thread Rickard Strandqvist
Remove the function radeon_best_encoder() that is not used anywhere.

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist 
---
 drivers/gpu/drm/radeon/radeon_i2c.c  |5 -
 drivers/gpu/drm/radeon/radeon_mode.h |2 --
 2 files changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c 
b/drivers/gpu/drm/radeon/radeon_i2c.c
index add6220..9590bcd 100644
--- a/drivers/gpu/drm/radeon/radeon_i2c.c
+++ b/drivers/gpu/drm/radeon/radeon_i2c.c
@@ -1048,11 +1048,6 @@ struct radeon_i2c_chan *radeon_i2c_lookup(struct 
radeon_device *rdev,
return NULL;
 }

-struct drm_encoder *radeon_best_encoder(struct drm_connector *connector)
-{
-   return NULL;
-}
-
 void radeon_i2c_get_byte(struct radeon_i2c_chan *i2c_bus,
 u8 slave_addr,
 u8 addr,
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h 
b/drivers/gpu/drm/radeon/radeon_mode.h
index 04db2fd..66c17e3 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -740,8 +740,6 @@ extern void radeon_router_select_ddc_port(struct 
radeon_connector *radeon_connec
 extern void radeon_router_select_cd_port(struct radeon_connector 
*radeon_connector);
 extern bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool 
use_aux);

-extern struct drm_encoder *radeon_best_encoder(struct drm_connector 
*connector);
-
 extern bool radeon_atombios_get_ppll_ss_info(struct radeon_device *rdev,
 struct radeon_atom_ss *ss,
 int id);
-- 
1.7.10.4



[PATCH v9 1/4] drm/i2c: tda998x: Add DT support for audio

2015-01-13 Thread Jean-Francois Moine
On Tue, 13 Jan 2015 16:03:13 +
Russell King - ARM Linux  wrote:

> On Tue, Jan 13, 2015 at 04:54:11PM +0100, Jean-Francois Moine wrote:
> > 4 streams on 4 different APs (sources) should work, but 4 streams from
> > a same source should be detailed.
> 
> I'd like to know how you intend to wire up four different I2S sources
> to the TDA998x.
> 
> Remember, an I2S source produces the I2S data and the word clock - that's
> two outputs.  You can't electronically wire the word clocks together.


[PATCH] drm/radeon/radeon_fb: Remove unused function

2015-01-13 Thread Rickard Strandqvist
Remove the function radeon_fbdev_total_size() that is not used anywhere.

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist 
---
 drivers/gpu/drm/radeon/radeon_fb.c   |   10 --
 drivers/gpu/drm/radeon/radeon_mode.h |1 -
 2 files changed, 11 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_fb.c 
b/drivers/gpu/drm/radeon/radeon_fb.c
index 0ea1db8..76adbdb 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -389,16 +389,6 @@ void radeon_fbdev_set_suspend(struct radeon_device *rdev, 
int state)
fb_set_suspend(rdev->mode_info.rfbdev->helper.fbdev, state);
 }

-int radeon_fbdev_total_size(struct radeon_device *rdev)
-{
-   struct radeon_bo *robj;
-   int size = 0;
-
-   robj = gem_to_radeon_bo(rdev->mode_info.rfbdev->rfb.obj);
-   size += radeon_bo_size(robj);
-   return size;
-}
-
 bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo 
*robj)
 {
if (robj == gem_to_radeon_bo(rdev->mode_info.rfbdev->rfb.obj))
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h 
b/drivers/gpu/drm/radeon/radeon_mode.h
index 04db2fd..ec2014a 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -915,7 +915,6 @@ void dce8_program_fmt(struct drm_encoder *encoder);
 int radeon_fbdev_init(struct radeon_device *rdev);
 void radeon_fbdev_fini(struct radeon_device *rdev);
 void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state);
-int radeon_fbdev_total_size(struct radeon_device *rdev);
 bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo 
*robj);

 void radeon_fb_output_poll_changed(struct radeon_device *rdev);
-- 
1.7.10.4



[Bug 88364] Xorg hangs after videocard switching

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

--- Comment #1 from Liss  ---
Also, sometimes Xorg doesn't hang, but than, if I try to run something again I
see that it runs though llvmpipe.

LIBGL_DEBUG=verbose DRI_PRIME=1 glxgears -info
libGL: screen 0 does not appear to be DRI3 capable
libGL error: failed to open drm device: Invalid argument
libGL error: failed to load driver: radeonsi
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL: Can't open configuration file /home/lissamour/.drirc: No such file or
directory.
libGL: Can't open configuration file /home/lissamour/.drirc: No such file or
directory.
GL_RENDERER   = Gallium 0.4 on llvmpipe (LLVM 3.5, 128 bits)
GL_VERSION= 3.0 Mesa 10.5.0-devel (git-bed6f20 2015-01-13 utopic-oibaf-ppa)
GL_VENDOR = VMware, Inc.

-- 
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/20150113/b43d3206/attachment.html>


[PATCH] drm/radeon/rv515: Remove unused function

2015-01-13 Thread Rickard Strandqvist
Remove the function rv515_ring_start() that is not used anywhere.

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist 
---
 drivers/gpu/drm/radeon/radeon_asic.h |1 -
 drivers/gpu/drm/radeon/rv515.c   |   68 --
 2 files changed, 69 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_asic.h 
b/drivers/gpu/drm/radeon/radeon_asic.h
index d8ace5b..52667b3 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -280,7 +280,6 @@ int rv515_init(struct radeon_device *rdev);
 void rv515_fini(struct radeon_device *rdev);
 uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg);
 void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
-void rv515_ring_start(struct radeon_device *rdev, struct radeon_ring *ring);
 void rv515_bandwidth_update(struct radeon_device *rdev);
 int rv515_resume(struct radeon_device *rdev);
 int rv515_suspend(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 8a477bf..cb966e6 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -59,74 +59,6 @@ void rv515_debugfs(struct radeon_device *rdev)
}
 }

-void rv515_ring_start(struct radeon_device *rdev, struct radeon_ring *ring)
-{
-   int r;
-
-   r = radeon_ring_lock(rdev, ring, 64);
-   if (r) {
-   return;
-   }
-   radeon_ring_write(ring, PACKET0(ISYNC_CNTL, 0));
-   radeon_ring_write(ring,
- ISYNC_ANY2D_IDLE3D |
- ISYNC_ANY3D_IDLE2D |
- ISYNC_WAIT_IDLEGUI |
- ISYNC_CPSCRATCH_IDLEGUI);
-   radeon_ring_write(ring, PACKET0(WAIT_UNTIL, 0));
-   radeon_ring_write(ring, WAIT_2D_IDLECLEAN | WAIT_3D_IDLECLEAN);
-   radeon_ring_write(ring, PACKET0(R300_DST_PIPE_CONFIG, 0));
-   radeon_ring_write(ring, R300_PIPE_AUTO_CONFIG);
-   radeon_ring_write(ring, PACKET0(GB_SELECT, 0));
-   radeon_ring_write(ring, 0);
-   radeon_ring_write(ring, PACKET0(GB_ENABLE, 0));
-   radeon_ring_write(ring, 0);
-   radeon_ring_write(ring, PACKET0(R500_SU_REG_DEST, 0));
-   radeon_ring_write(ring, (1 << rdev->num_gb_pipes) - 1);
-   radeon_ring_write(ring, PACKET0(VAP_INDEX_OFFSET, 0));
-   radeon_ring_write(ring, 0);
-   radeon_ring_write(ring, PACKET0(RB3D_DSTCACHE_CTLSTAT, 0));
-   radeon_ring_write(ring, RB3D_DC_FLUSH | RB3D_DC_FREE);
-   radeon_ring_write(ring, PACKET0(ZB_ZCACHE_CTLSTAT, 0));
-   radeon_ring_write(ring, ZC_FLUSH | ZC_FREE);
-   radeon_ring_write(ring, PACKET0(WAIT_UNTIL, 0));
-   radeon_ring_write(ring, WAIT_2D_IDLECLEAN | WAIT_3D_IDLECLEAN);
-   radeon_ring_write(ring, PACKET0(GB_AA_CONFIG, 0));
-   radeon_ring_write(ring, 0);
-   radeon_ring_write(ring, PACKET0(RB3D_DSTCACHE_CTLSTAT, 0));
-   radeon_ring_write(ring, RB3D_DC_FLUSH | RB3D_DC_FREE);
-   radeon_ring_write(ring, PACKET0(ZB_ZCACHE_CTLSTAT, 0));
-   radeon_ring_write(ring, ZC_FLUSH | ZC_FREE);
-   radeon_ring_write(ring, PACKET0(GB_MSPOS0, 0));
-   radeon_ring_write(ring,
- ((6 << MS_X0_SHIFT) |
-  (6 << MS_Y0_SHIFT) |
-  (6 << MS_X1_SHIFT) |
-  (6 << MS_Y1_SHIFT) |
-  (6 << MS_X2_SHIFT) |
-  (6 << MS_Y2_SHIFT) |
-  (6 << MSBD0_Y_SHIFT) |
-  (6 << MSBD0_X_SHIFT)));
-   radeon_ring_write(ring, PACKET0(GB_MSPOS1, 0));
-   radeon_ring_write(ring,
- ((6 << MS_X3_SHIFT) |
-  (6 << MS_Y3_SHIFT) |
-  (6 << MS_X4_SHIFT) |
-  (6 << MS_Y4_SHIFT) |
-  (6 << MS_X5_SHIFT) |
-  (6 << MS_Y5_SHIFT) |
-  (6 << MSBD1_SHIFT)));
-   radeon_ring_write(ring, PACKET0(GA_ENHANCE, 0));
-   radeon_ring_write(ring, GA_DEADLOCK_CNTL | GA_FASTSYNC_CNTL);
-   radeon_ring_write(ring, PACKET0(GA_POLY_MODE, 0));
-   radeon_ring_write(ring, FRONT_PTYPE_TRIANGE | BACK_PTYPE_TRIANGE);
-   radeon_ring_write(ring, PACKET0(GA_ROUND_MODE, 0));
-   radeon_ring_write(ring, GEOMETRY_ROUND_NEAREST | COLOR_ROUND_NEAREST);
-   radeon_ring_write(ring, PACKET0(0x20C8, 0));
-   radeon_ring_write(ring, 0);
-   radeon_ring_unlock_commit(rdev, ring, false);
-}
-
 int rv515_mc_wait_for_idle(struct radeon_device *rdev)
 {
unsigned i;
-- 
1.7.10.4



[PATCH v9 1/4] drm/i2c: tda998x: Add DT support for audio

2015-01-13 Thread Russell King - ARM Linux
On Tue, Jan 13, 2015 at 09:41:01PM +0200, Jyri Sarha wrote:
> On 01/13/2015 09:26 PM, Russell King - ARM Linux wrote:
> >SCLK: _~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_
> >   WS: __~
> >I2S1: llmmllmmllm
> >I2S2: llmmllmmllm
> >I2S3: llmmllmmllm
> >I2S4: llmmllmmllm
> >
> >So, what I'm saying is that it is_impossible_  to drive the TDA998x using
> >multiple I2S streams which are not produced by the same I2S block.
> 
> This is besides the point, but it is possible that one of the multiple I2S
> blocks is the bit-clock and frame-clock master to the i2s bus and the others
> are slaves to it (banging their bits according to SCLK and WS of the I2S
> master). However, in this situation there really is only one i2s bus with
> multiple data pins.
> 
> Just my 0.02€ to this discussion.

Right, that's about the only way it could work.

To represent that in DT, I would imagine we'd need something like this:

#address-cells = <1>;
#size-cells = <0>;
...
port at 1 {/* AP1,2 = I2S */
#address-cells = <1>;
#size-cells = <0>;
port-type = "i2s";
reg = <0x01>;   /* WS */
tda998x_i2s1: endpoint at 2 {
reg = <0x02>;   /* AP1 */
remote-endpoint = <_i2s>;
};
tda998x_i2s2: endpoint at 4 {
reg = <0x04>;   /* AP2 */
remote-endpoint = <_i2s>;
};
};

where audio1_i2s is operating in master mode, and audio2_i2s is
operating in slave mode for both WS and SCLK.

If we can agree on that, then I'm happy with the proposed binding.
(Remember that #address-cells and #size-cells are required in the
parent where we have reg= in the child.)

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


[PATCH] drm/radeon/sumo_dpm: Remove some unused functions

2015-01-13 Thread Rickard Strandqvist
Removes some functions that are not used anywhere:
sumo_convert_vid7_to_vid2() sumo_dpm_reset_asic()

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist 
---
 drivers/gpu/drm/radeon/sumo_dpm.c |   26 --
 drivers/gpu/drm/radeon/sumo_dpm.h |3 ---
 2 files changed, 29 deletions(-)

diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c 
b/drivers/gpu/drm/radeon/sumo_dpm.c
index 1f8a883..e5d66a2 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.c
+++ b/drivers/gpu/drm/radeon/sumo_dpm.c
@@ -1338,18 +1338,6 @@ void sumo_dpm_post_set_power_state(struct radeon_device 
*rdev)
sumo_update_current_ps(rdev, new_ps);
 }

-void sumo_dpm_reset_asic(struct radeon_device *rdev)
-{
-   sumo_program_bootup_state(rdev);
-   sumo_enable_power_level_0(rdev);
-   sumo_set_forced_level_0(rdev);
-   sumo_set_forced_mode_enabled(rdev);
-   sumo_wait_for_level_0(rdev);
-   sumo_set_forced_mode_disabled(rdev);
-   sumo_set_forced_mode_enabled(rdev);
-   sumo_set_forced_mode_disabled(rdev);
-}
-
 void sumo_dpm_setup_asic(struct radeon_device *rdev)
 {
struct sumo_power_info *pi = sumo_get_pi(rdev);
@@ -1537,20 +1525,6 @@ u32 sumo_convert_vid2_to_vid7(struct radeon_device *rdev,
return vid_mapping_table->entries[vid_mapping_table->num_entries - 
1].vid_7bit;
 }

-u32 sumo_convert_vid7_to_vid2(struct radeon_device *rdev,
- struct sumo_vid_mapping_table *vid_mapping_table,
- u32 vid_7bit)
-{
-   u32 i;
-
-   for (i = 0; i < vid_mapping_table->num_entries; i++) {
-   if (vid_mapping_table->entries[i].vid_7bit == vid_7bit)
-   return vid_mapping_table->entries[i].vid_2bit;
-   }
-
-   return vid_mapping_table->entries[vid_mapping_table->num_entries - 
1].vid_2bit;
-}
-
 static u16 sumo_convert_voltage_index_to_value(struct radeon_device *rdev,
   u32 vid_2bit)
 {
diff --git a/drivers/gpu/drm/radeon/sumo_dpm.h 
b/drivers/gpu/drm/radeon/sumo_dpm.h
index db1ea32..07dda29 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.h
+++ b/drivers/gpu/drm/radeon/sumo_dpm.h
@@ -202,9 +202,6 @@ void sumo_construct_vid_mapping_table(struct radeon_device 
*rdev,
 u32 sumo_convert_vid2_to_vid7(struct radeon_device *rdev,
  struct sumo_vid_mapping_table *vid_mapping_table,
  u32 vid_2bit);
-u32 sumo_convert_vid7_to_vid2(struct radeon_device *rdev,
- struct sumo_vid_mapping_table *vid_mapping_table,
- u32 vid_7bit);
 u32 sumo_get_sleep_divider_from_id(u32 id);
 u32 sumo_get_sleep_divider_id_from_clock(struct radeon_device *rdev,
 u32 sclk,
-- 
1.7.10.4



[PATCH] drm/radeon/rv770_dpm: Remove some unused functions

2015-01-13 Thread Rickard Strandqvist
Removes some functions that are not used anywhere:
rv770_read_smc_soft_register() rv770_dpm_reset_asic()

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist 
---
 drivers/gpu/drm/radeon/rv770_dpm.c |   23 ---
 drivers/gpu/drm/radeon/rv770_dpm.h |2 --
 2 files changed, 25 deletions(-)

diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c 
b/drivers/gpu/drm/radeon/rv770_dpm.c
index 755a8f9..a5b537a 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.c
+++ b/drivers/gpu/drm/radeon/rv770_dpm.c
@@ -231,16 +231,6 @@ u8 rv770_get_seq_value(struct radeon_device *rdev,
MC_CG_SEQ_DRAMCONF_S0 : MC_CG_SEQ_DRAMCONF_S1;
 }

-int rv770_read_smc_soft_register(struct radeon_device *rdev,
-u16 reg_offset, u32 *value)
-{
-   struct rv7xx_power_info *pi = rv770_get_pi(rdev);
-
-   return rv770_read_smc_sram_dword(rdev,
-pi->soft_regs_start + reg_offset,
-value, pi->sram_end);
-}
-
 int rv770_write_smc_soft_register(struct radeon_device *rdev,
  u16 reg_offset, u32 value)
 {
@@ -2075,19 +2065,6 @@ int rv770_dpm_set_power_state(struct radeon_device *rdev)
return 0;
 }

-void rv770_dpm_reset_asic(struct radeon_device *rdev)
-{
-   struct rv7xx_power_info *pi = rv770_get_pi(rdev);
-   struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps;
-
-   rv770_restrict_performance_levels_before_switch(rdev);
-   if (pi->dcodt)
-   rv770_program_dcodt_before_state_switch(rdev, boot_ps, boot_ps);
-   rv770_set_boot_state(rdev);
-   if (pi->dcodt)
-   rv770_program_dcodt_after_state_switch(rdev, boot_ps, boot_ps);
-}
-
 void rv770_dpm_setup_asic(struct radeon_device *rdev)
 {
struct rv7xx_power_info *pi = rv770_get_pi(rdev);
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.h 
b/drivers/gpu/drm/radeon/rv770_dpm.h
index f776634..d12beab 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.h
+++ b/drivers/gpu/drm/radeon/rv770_dpm.h
@@ -278,8 +278,6 @@ void rv770_set_uvd_clock_after_set_eng_clock(struct 
radeon_device *rdev,
 void rv770_get_engine_memory_ss(struct radeon_device *rdev);

 /* smc */
-int rv770_read_smc_soft_register(struct radeon_device *rdev,
-u16 reg_offset, u32 *value);
 int rv770_write_smc_soft_register(struct radeon_device *rdev,
  u16 reg_offset, u32 value);

-- 
1.7.10.4



[PATCH] drm/nouveau/nvif/notify: Remove unused function

2015-01-13 Thread Rickard Strandqvist
Remove the function nvif_notify_ref() that is not used anywhere.

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Rickard Strandqvist 
---
 drivers/gpu/drm/nouveau/nvif/notify.c |9 -
 drivers/gpu/drm/nouveau/nvif/notify.h |1 -
 2 files changed, 10 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvif/notify.c 
b/drivers/gpu/drm/nouveau/nvif/notify.c
index 0898c31..d1c26db 100644
--- a/drivers/gpu/drm/nouveau/nvif/notify.c
+++ b/drivers/gpu/drm/nouveau/nvif/notify.c
@@ -219,15 +219,6 @@ nvif_notify_del(struct nvif_notify *notify)
kfree(notify);
 }

-void
-nvif_notify_ref(struct nvif_notify *notify, struct nvif_notify **pnotify)
-{
-   BUG_ON(notify != NULL);
-   if (*pnotify)
-   (*pnotify)->dtor(*pnotify);
-   *pnotify = notify;
-}
-
 int
 nvif_notify_new(struct nvif_object *object, int (*func)(struct nvif_notify *),
bool work, u8 type, void *data, u32 size, u32 reply,
diff --git a/drivers/gpu/drm/nouveau/nvif/notify.h 
b/drivers/gpu/drm/nouveau/nvif/notify.h
index 9ebfa3b..ea8593e 100644
--- a/drivers/gpu/drm/nouveau/nvif/notify.h
+++ b/drivers/gpu/drm/nouveau/nvif/notify.h
@@ -34,6 +34,5 @@ int  nvif_notify(const void *, u32, const void *, u32);
 int  nvif_notify_new(struct nvif_object *, int (*func)(struct nvif_notify *),
 bool work, u8 type, void *data, u32 size, u32 reply,
 struct nvif_notify **);
-void nvif_notify_ref(struct nvif_notify *, struct nvif_notify **);

 #endif
-- 
1.7.10.4



[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #4 from Sandro  ---
(In reply to Alex Deucher from comment #3)
> (In reply to Sandro from comment #2)
> > Same here with my gigabyte r9 290.
> > The glitches pop up randomly.
> > Here is the video http://youtu.be/ilH6em3eIrY
> 
> The link says the video is private.

try now

-- 
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/20150113/60ad8e7f/attachment.html>


[PATCH v9 1/4] drm/i2c: tda998x: Add DT support for audio

2015-01-13 Thread Russell King - ARM Linux
On Tue, Jan 13, 2015 at 08:02:52PM +0100, Jean-Francois Moine wrote:
> On Tue, 13 Jan 2015 16:03:13 +
> Russell King - ARM Linux  wrote:
> 
> > On Tue, Jan 13, 2015 at 04:54:11PM +0100, Jean-Francois Moine wrote:
> > > 4 streams on 4 different APs (sources) should work, but 4 streams from
> > > a same source should be detailed.
> > 
> > I'd like to know how you intend to wire up four different I2S sources
> > to the TDA998x.
> > 
> > Remember, an I2S source produces the I2S data and the word clock - that's
> > two outputs.  You can't electronically wire the word clocks together.
> 
> From the spec, the tda998x gets independently the serial clock and the
> serial word select from each I2S (stereo) input channel (= audio pin),
> so, you may have 4 audio chips giving 4 independent audio streams.
> I don't know what can be the result in HDMI if these streams are actived
> at the same time!
> 
> In the other configuration, an audio chip may have 4 synchronized stereo
> channels (software PCMs). These ones may be considered as one link (one
> port out from the audio chip to one port in to the tda998x), the AP
> configuration being 0x1f.

Let me try to be clearer.  Here's four independent I2S blocks which
have been arranged to be clocked by the same I2S bus clock.  Each
I2S block produces its own word clock and data stream:

SCLK
|  +---+
+->| I2S   +--> WS1
|  | src 1 +--> I2S1
|  +---+
|
|  +---+
+->| I2S   +--> WS2
|  | src 2 +--> I2S2
|  +---+
|
|  +---+
+->| I2S   +--> WS3
|  | src 3 +--> I2S3
|  +---+
|
|  +---+
+->| I2S   +--> WS4
|  | src 4 +--> I2S4
|  +---+
|
|+-+
|| TDA998x |
`--->+ ACLK|
  WS --->+ AP0 |
I2S1 --->+ AP1 |
I2S2 --->+ AP2 |
I2S3 --->+ AP3 |
I2S4 --->+ AP4 |
 +-+

The arrows point from the output (driver of the signal) to the input.
It is illegal in electronics to wire two outputs (which are not able to
disable their output drivers) together.

How do you arrange for WS1..WS4 to be connected to the TDA998x WS input?

My answer is: this is an impossible setup.

Since these are independent blocks, there is no guarantee that the
WS1..WS4 outputs will be synchronised to each other, since that depends
upon the SCLK edge that each unit becomes enabled.  That also determines
the bit position relative to SCLK of the first bit output.

Hence, you could very well end up with something like this for a 16-bit
I2S output from each I2S block:

SCLK: _~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_
 WS1: __~
I2S1: llmmllmmllm
 WS2: ___
I2S2: ..llmmllmm.
 WS3: ___
I2S3: ..llmmllmm.
 WS4: ___
I2S4: llmmllmm...

where 'l' indicates the LSB of the sample, and 'm' indicates the MSB.

The problem is that the TDA998x expects each I2S input to be synchronised.
In other words, the WS input is shared between each and every separate I2S
input, which means the MSB of each I2S input needs to be supplied at
exactly the same SCLK edge.  In other words:

SCLK: _~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_
  WS: __~
I2S1: llmmllmmllm
I2S2: llmmllmmllm
I2S3: llmmllmmllm
I2S4: llmmllmmllm

So, what I'm saying is that it is _impossible_ to drive the TDA998x using
multiple I2S streams which are not produced by the same I2S block.

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


[Bug 75276] Implement VGPR Register Spilling

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=75276

--- Comment #60 from Axel Davy  ---
Created attachment 112179
  --> https://bugs.freedesktop.org/attachment.cgi?id=112179=edit
llvm failing shader

-- 
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/20150113/aaf5429a/attachment-0001.html>


[Bug 75276] Implement VGPR Register Spilling

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=75276

--- Comment #59 from Axel Davy  ---
Created attachment 112178
  --> https://bugs.freedesktop.org/attachment.cgi?id=112178=edit
TGSI failing shader

-- 
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/20150113/860f26d0/attachment.html>


[Bug 75276] Implement VGPR Register Spilling

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=75276

--- Comment #58 from Axel Davy  ---
I have tested perf-Jan-08-2015 tstellar branch,
and I get a failure to compile a Unigine heaven shader
under nine.
There is the same error when reverting the last patch of the branch (subreg
liveness).

LLVM ERROR: Not supported instr:>

1908 seems to correspond to SI_SPILL_V96_RESTORE

I'll include the TGSI shader, and next the llvm IR

-- 
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/20150113/f2a3b7a8/attachment.html>


[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #3 from Alex Deucher  ---
(In reply to Sandro from comment #2)
> Same here with my gigabyte r9 290.
> The glitches pop up randomly.
> Here is the video http://youtu.be/ilH6em3eIrY

The link says the video is private.

-- 
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/20150113/d60d35bb/attachment.html>


[PATCH RFC 3/3] ARM: dts: am335x-boneblack: Use new binding in ti, tilcdc, slave node

2015-01-13 Thread Jyri Sarha
Add node for NXP TDA19988 encoder and refer to it in the hdmi node
instead of referring to the i2c bus where the encoder is connected to.

Signed-off-by: Jyri Sarha 
---
 arch/arm/boot/dts/am335x-boneblack.dts |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am335x-boneblack.dts 
b/arch/arm/boot/dts/am335x-boneblack.dts
index 5c42d25..c0c8e4b 100644
--- a/arch/arm/boot/dts/am335x-boneblack.dts
+++ b/arch/arm/boot/dts/am335x-boneblack.dts
@@ -70,10 +70,17 @@
status = "okay";
 };

+ {
+   tda19988: tda19988 at 70 {
+   compatible = "nxp,tda998x";
+   reg = <0x70>;
+   };
+};
+
 / {
hdmi {
compatible = "ti,tilcdc,slave";
-   i2c = <>;
+   i2c-slave = <>;
pinctrl-names = "default", "off";
pinctrl-0 = <_hdmi_bonelt_pins>;
pinctrl-1 = <_hdmi_bonelt_off_pins>;
-- 
1.7.9.5



[PATCH RFC 2/3] drm/tilcdc: slave: Add support for "i2c-slave" DT-parameter

2015-01-13 Thread Jyri Sarha
It is more convenient to refer to the i2c slave encoder directly with
phandle than to refer to the i2c bus and to create the device "manually".

Signed-off-by: Jyri Sarha 
---
 .../devicetree/bindings/drm/tilcdc/slave.txt   |4 +-
 drivers/gpu/drm/tilcdc/tilcdc_slave.c  |   50 
 2 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/drm/tilcdc/slave.txt 
b/Documentation/devicetree/bindings/drm/tilcdc/slave.txt
index 3d2c524..930550f 100644
--- a/Documentation/devicetree/bindings/drm/tilcdc/slave.txt
+++ b/Documentation/devicetree/bindings/drm/tilcdc/slave.txt
@@ -2,6 +2,8 @@ Device-Tree bindings for tilcdc DRM encoder slave output driver

 Required properties:
  - compatible: value should be "ti,tilcdc,slave".
+ - i2c-slave: phandle for the encoder slave device
+ or
  - i2c: the phandle for the i2c device the encoder slave is connected to

 Recommended properties:
@@ -12,7 +14,7 @@ Example:

hdmi {
compatible = "ti,tilcdc,slave";
-   i2c = <>;
+   i2c-slave = <>;
pinctrl-names = "default";
pinctrl-0 = <_hdmi_bonelt_pins>;
};
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave.c 
b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
index 3775fd4..a1e2f86 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
@@ -25,6 +25,7 @@
 struct slave_module {
struct tilcdc_module base;
struct i2c_adapter *i2c;
+   struct i2c_client *slave;
 };
 #define to_slave_module(x) container_of(x, struct slave_module, base)

@@ -140,7 +141,12 @@ static struct drm_encoder *slave_encoder_create(struct 
drm_device *dev,

drm_encoder_helper_add(encoder, _encoder_helper_funcs);

-   ret = drm_i2c_encoder_init(dev, to_encoder_slave(encoder), mod->i2c, 
);
+   if (mod->slave)
+   ret = drm_i2c_encoder_attach(dev, to_encoder_slave(encoder),
+mod->slave);
+   else
+   ret = drm_i2c_encoder_init(dev, to_encoder_slave(encoder),
+  mod->i2c, );
if (ret)
goto fail;

@@ -309,12 +315,12 @@ static struct of_device_id slave_of_match[];
 static int slave_probe(struct platform_device *pdev)
 {
struct device_node *node = pdev->dev.of_node;
-   struct device_node *i2c_node;
+   struct device_node *slave_node;
struct slave_module *slave_mod;
struct tilcdc_module *mod;
struct pinctrl *pinctrl;
-   uint32_t i2c_phandle;
-   struct i2c_adapter *slavei2c;
+   struct i2c_adapter *slavei2c = NULL;
+   struct i2c_client *slave = NULL;
int ret = -EINVAL;

/* bail out early if no DT data: */
@@ -323,26 +329,29 @@ static int slave_probe(struct platform_device *pdev)
return -ENXIO;
}

-   /* Bail out early if i2c not specified */
-   if (of_property_read_u32(node, "i2c", _phandle)) {
-   dev_err(>dev, "could not get i2c bus phandle\n");
-   return ret;
-   }
-
-   i2c_node = of_find_node_by_phandle(i2c_phandle);
-   if (!i2c_node) {
-   dev_err(>dev, "could not get i2c bus node\n");
-   return ret;
+   slave_node = of_parse_phandle(node, "i2c-slave", 0);
+   if (slave_node) {
+   slave = of_find_i2c_device_by_node(slave_node);
+   of_node_put(slave_node);
+   } else {
+   struct device_node *i2c_node = of_parse_phandle(node, "i2c", 0);
+
+   if (!i2c_node) {
+   dev_err(>dev,
+   "phandle for i2c-slave or i2c not found\n");
+   return -ENODEV;
+   }
+   slavei2c = of_find_i2c_adapter_by_node(i2c_node);
+   of_node_put(i2c_node);
}

-   /* but defer the probe if it can't be initialized it might come later */
-   slavei2c = of_find_i2c_adapter_by_node(i2c_node);
-   of_node_put(i2c_node);
-
-   if (!slavei2c) {
+   /* defer the probe if either slave device or the i2c bus
+  was not found, they might come later */
+   if (!slavei2c && !slave) {
ret = -EPROBE_DEFER;
tilcdc_slave_probedefer(true);
-   dev_err(>dev, "could not get i2c\n");
+   dev_info(>dev,
+"could not get i2c-slave or i2c, probe defered\n");
return ret;
}

@@ -358,6 +367,7 @@ static int slave_probe(struct platform_device *pdev)
mod->preferred_bpp = slave_info.bpp;

slave_mod->i2c = slavei2c;
+   slave_mod->slave = slave;

tilcdc_module_init(mod, "slave", _module_ops);

-- 
1.7.9.5



[PATCH RFC 1/3] drm: encoder_slave: Add drm_i2c_encoder_attach()

2015-01-13 Thread Jyri Sarha
Add drm_i2c_encoder_attach() for attaching an already probed i2c
encoder. This is needed for instance if the encoder is probed from
device tree.

Signed-off-by: Jyri Sarha 
---
 drivers/gpu/drm/drm_encoder_slave.c |   51 +++
 include/drm/drm_encoder_slave.h |3 +++
 2 files changed, 54 insertions(+)

diff --git a/drivers/gpu/drm/drm_encoder_slave.c 
b/drivers/gpu/drm/drm_encoder_slave.c
index d18b88b..ed627f7 100644
--- a/drivers/gpu/drm/drm_encoder_slave.c
+++ b/drivers/gpu/drm/drm_encoder_slave.c
@@ -120,6 +120,57 @@ void drm_i2c_encoder_destroy(struct drm_encoder 
*drm_encoder)
 }
 EXPORT_SYMBOL(drm_i2c_encoder_destroy);

+/**
+ * drm_i2c_encoder_attach - Attach an I2C slave encoder
+ * @dev:   DRM device.
+ * @encoder:   Encoder to be attached to the I2C device. You aren't
+ * required to have called drm_encoder_init() before.
+ * @client:I2C encoder to be attached.
+ *
+ * Attach the I2C device specified to the specified _encoder_slave.
+ * The @slave_funcs field will be initialized with the hooks provided by
+ * the slave driver.
+ *
+ * Returns 0 on success or a negative errno on failure, in particular,
+ * -ENODEV is returned when no matching driver is found.
+ */
+int drm_i2c_encoder_attach(struct drm_device *dev,
+  struct drm_encoder_slave *encoder,
+  struct i2c_client *client)
+{
+   struct drm_i2c_encoder_driver *encoder_drv;
+   struct module *module = NULL;
+   int err = 0;
+
+   if (!client->dev.driver) {
+   err = -ENODEV;
+   goto fail;
+   }
+
+   module = client->dev.driver->owner;
+   if (!try_module_get(module)) {
+   err = -ENODEV;
+   goto fail;
+   }
+
+   encoder->bus_priv = client;
+
+   encoder_drv =
+   to_drm_i2c_encoder_driver(to_i2c_driver(client->dev.driver));
+
+   err = encoder_drv->encoder_init(client, dev, encoder);
+   if (err)
+   goto fail_put;
+
+   return 0;
+
+fail_put:
+   module_put(module);
+fail:
+   return err;
+}
+EXPORT_SYMBOL(drm_i2c_encoder_attach);
+
 /*
  * Wrapper fxns which can be plugged in to drm_encoder_helper_funcs:
  */
diff --git a/include/drm/drm_encoder_slave.h b/include/drm/drm_encoder_slave.h
index 8b9cc36..4f7f8d5 100644
--- a/include/drm/drm_encoder_slave.h
+++ b/include/drm/drm_encoder_slave.h
@@ -106,6 +106,9 @@ int drm_i2c_encoder_init(struct drm_device *dev,
 struct i2c_adapter *adap,
 const struct i2c_board_info *info);

+int drm_i2c_encoder_attach(struct drm_device *dev,
+  struct drm_encoder_slave *encoder,
+  struct i2c_client *client);

 /**
  * struct drm_i2c_encoder_driver
-- 
1.7.9.5



[PATCH RFC 0/3] Make "ti,tilcdc,slave" DT binding more sensible

2015-01-13 Thread Jyri Sarha
These patches are needed for Beaglebone-back HDMI audio. There is no
direct dependency between these patches and the other (dts and ASoC)
changes needed for the HDMI audio so these changes can be merged
independently. I also feel that these changes make sense even without
the HDMI audio.

Best regards,
Jyri

Jyri Sarha (3):
  drm: encoder_slave: Add drm_i2c_encoder_attach()
  drm/tilcdc: slave: Add support for "i2c-slave" DT-parameter
  ARM: dts: am335x-boneblack: Use new binding in ti,tilcdc,slave node

 .../devicetree/bindings/drm/tilcdc/slave.txt   |4 +-
 arch/arm/boot/dts/am335x-boneblack.dts |9 +++-
 drivers/gpu/drm/drm_encoder_slave.c|   51 
 drivers/gpu/drm/tilcdc/tilcdc_slave.c  |   50 +++
 include/drm/drm_encoder_slave.h|3 ++
 5 files changed, 95 insertions(+), 22 deletions(-)

-- 
1.7.9.5



[Bug 87796] radeonsi 120Hz graphic glitches

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=87796

--- Comment #2 from Sandro  ---
Same here with my gigabyte r9 290.
The glitches pop up randomly.
Here is the video http://youtu.be/ilH6em3eIrY

-- 
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/20150113/6d3b5569/attachment.html>


[Bug 88152] 720p and 1080 H.264 videos lock-up on playback with vlc / vdpau on Radeon 3850HD

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=88152

--- Comment #14 from Arthur Marsh  ---
Created attachment 112175
  --> https://bugs.freedesktop.org/attachment.cgi?id=112175=edit
2015011404dmesg.txt dmesg output with mesa 10.4.2

-- 
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/20150113/59e82671/attachment.html>


[Bug 88152] 720p and 1080 H.264 videos lock-up on playback with vlc / vdpau on Radeon 3850HD

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=88152

--- Comment #13 from Arthur Marsh  ---
Upgraded mesa-related packages to 10.4.2-1.

Still seeing a lockup a few minutes into video playback.

-- 
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/20150113/7643d95e/attachment.html>


[PATCH 2/2] drm/i915: Passing rotation to drm_plane_helper_check_update

2015-01-13 Thread Sonika Jindal
Signed-off-by: Sonika Jindal 
---
 drivers/gpu/drm/i915/intel_display.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index f40288f..d19ed4b 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12155,7 +12155,8 @@ intel_check_primary_plane(struct drm_plane *plane,
src, dest, clip,
DRM_PLANE_HELPER_NO_SCALING,
DRM_PLANE_HELPER_NO_SCALING,
-   false, true, >visible);
+   false, true, >visible,
+   to_intel_plane(plane)->rotation);
if (ret)
return ret;

@@ -12429,7 +12430,8 @@ intel_check_cursor_plane(struct drm_plane *plane,
src, dest, clip,
DRM_PLANE_HELPER_NO_SCALING,
DRM_PLANE_HELPER_NO_SCALING,
-   true, true, >visible);
+   true, true, >visible,
+   to_intel_plane(plane)->rotation);
if (ret)
return ret;

-- 
1.7.10.4



[PATCH 1/2] drm: Adding rotation to drm_plane_helper_check_update

2015-01-13 Thread Sonika Jindal
Taking rotation into account while checking the plane
and adjusting the sizes accordingly.

Signed-off-by: Sonika Jindal 
---
 drivers/gpu/drm/drm_plane_helper.c |   79 ++--
 include/drm/drm_plane_helper.h |3 +-
 2 files changed, 77 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_plane_helper.c 
b/drivers/gpu/drm/drm_plane_helper.c
index f24c4cf..4badd69 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -138,9 +138,13 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
int max_scale,
bool can_position,
bool can_update_disabled,
-   bool *visible)
+   bool *visible,
+   unsigned int rotation)
 {
int hscale, vscale;
+   int crtc_x, crtc_y;
+   unsigned int crtc_w, crtc_h;
+   uint32_t src_x, src_y, src_w, src_h;

if (!fb) {
*visible = false;
@@ -158,9 +162,13 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
return -EINVAL;
}

+   if (fb)
+   drm_rect_rotate(src, fb->width << 16, fb->height << 16,
+   rotation);
+
/* Check scaling */
-   hscale = drm_rect_calc_hscale(src, dest, min_scale, max_scale);
-   vscale = drm_rect_calc_vscale(src, dest, min_scale, max_scale);
+   hscale = drm_rect_calc_hscale_relaxed(src, dest, min_scale, max_scale);
+   vscale = drm_rect_calc_vscale_relaxed(src, dest, min_scale, max_scale);
if (hscale < 0 || vscale < 0) {
DRM_DEBUG_KMS("Invalid scaling of plane\n");
return -ERANGE;
@@ -182,6 +190,68 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
return -EINVAL;
}

+   crtc_x = dest->x1;
+   crtc_y = dest->y1;
+   crtc_w = drm_rect_width(dest);
+   crtc_h = drm_rect_height(dest);
+
+   if (*visible) {
+   /* check again in case clipping clamped the results */
+   hscale = drm_rect_calc_hscale(src, dest,
+   DRM_PLANE_HELPER_NO_SCALING,
+   DRM_PLANE_HELPER_NO_SCALING);
+   if (hscale < 0) {
+   DRM_DEBUG_KMS("Horizontal scaling factor out of 
limits\n");
+   drm_rect_debug_print(src, true);
+   drm_rect_debug_print(dest, false);
+
+   return hscale;
+   }
+
+   vscale = drm_rect_calc_vscale(src, dest,
+   DRM_PLANE_HELPER_NO_SCALING,
+   DRM_PLANE_HELPER_NO_SCALING);
+   if (vscale < 0) {
+   DRM_DEBUG_KMS("Vertical scaling factor out of 
limits\n");
+   drm_rect_debug_print(src, true);
+   drm_rect_debug_print(dest, false);
+
+   return vscale;
+   }
+
+   /* Make the source viewport size an exact multiple of the 
scaling factors. */
+   drm_rect_adjust_size(src,
+   drm_rect_width(dest) * hscale - drm_rect_width(src),
+   drm_rect_height(dest) * vscale - drm_rect_height(src));
+
+   drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16,
+   rotation);
+
+   /*
+* Hardware doesn't handle subpixel coordinates.
+* Adjust to (macro)pixel boundary, but be careful not to
+* increase the source viewport size, because that could
+* push the downscaling factor out of bounds.
+*/
+   src_x = src->x1 >> 16;
+   src_w = drm_rect_width(src) >> 16;
+   src_y = src->y1 >> 16;
+   src_h = drm_rect_height(src) >> 16;
+   }
+
+   if (*visible) {
+   src->x1 = src_x;
+   src->x2 = src_x + src_w;
+   src->y1 = src_y;
+   src->y2 = src_y + src_h;
+   }
+
+   dest->x1 = crtc_x;
+   dest->x2 = crtc_x + crtc_w;
+   dest->y1 = crtc_y;
+   dest->y2 = crtc_y + crtc_h;
+
+
return 0;
 }
 EXPORT_SYMBOL(drm_plane_helper_check_update);
@@ -258,7 +328,8 @@ int drm_primary_helper_update(struct drm_plane *plane, 
struct drm_crtc *crtc,
, , ,
DRM_PLANE_HELPER_NO_SCALING,
DRM_PLANE_HELPER_NO_SCALING,
-   false, false, );
+   false, false, ,
+   DRM_ROTATE_0);
if (ret)

[PATCH 0/2] Adding rotattion to drm_plane_helper_check_update

2015-01-13 Thread Sonika Jindal
This adds another parameter rotation to drm_plane_helper_check_update.
This will enable this function to do to size updations based upon the rotation
if any.
Updated the calls to this function in i915 and drm. Rockchip driver also needs
to be updated.

Sonika Jindal (2):
  drm: Adding rotation to drm_plane_helper_check_update
  drm/i915: Passing rotation to drm_plane_helper_check_update

 drivers/gpu/drm/drm_plane_helper.c   |   79 --
 drivers/gpu/drm/i915/intel_display.c |6 ++-
 include/drm/drm_plane_helper.h   |3 +-
 3 files changed, 81 insertions(+), 7 deletions(-)

-- 
1.7.10.4



[Bug 86351] HDMI audio garbled output on Radeon R9 280X

2015-01-13 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=86351

--- Comment #9 from Christian Birchinger  ---
"make -j8" gets usable sound here too.

In my case it's an Intel i7-4770 system.

The only hardware i swaped out was a 5570 for a R9 280X.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


[PATCH] reservation: wait only with non-zero timeout specified (v3)

2015-01-13 Thread Jammy Zhou
When the timeout value passed to reservation_object_wait_timeout_rcu
is zero, no wait should be done if the fences are not signaled.

Return '1' for idle and '0' for busy if the specified timeout is '0'
to keep consistent with the case of non-zero timeout.

v2: call fence_put if not signaled in the case of timeout==0

v3: switch to reservation_object_test_signaled_rcu

Signed-off-by: Jammy Zhou 
Reviewed-by: Christian König 
Reviewed-by: Alex Deucher 
---
 drivers/dma-buf/reservation.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
index 3c97c8f..807ef15 100644
--- a/drivers/dma-buf/reservation.c
+++ b/drivers/dma-buf/reservation.c
@@ -327,6 +327,9 @@ long reservation_object_wait_timeout_rcu(struct 
reservation_object *obj,
unsigned seq, shared_count, i = 0;
long ret = timeout;

+   if (!timeout)
+   return reservation_object_test_signaled_rcu(obj, wait_all);
+
 retry:
fence = NULL;
shared_count = 0;
-- 
1.9.1



[PATCH 2/2] drm/msm/mdp5: Add hardware cursor support

2015-01-13 Thread Stephane Viau
From: Beeresh Gopal 

This patch implements the hardware accelarated cursor
support for MDP5 platforms.

Signed-off-by: Beeresh Gopal 
Signed-off-by: Wentao Xu 
Signed-off-by: Stephane Viau 
---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 164 +++
 1 file changed, 164 insertions(+)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c 
b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
index f021f96..2021f09 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
@@ -24,6 +24,9 @@
 #include "drm_crtc_helper.h"
 #include "drm_flip_work.h"

+#define CURSOR_WIDTH   64
+#define CURSOR_HEIGHT  64
+
 #define SSPP_MAX   (SSPP_RGB3 + 1) /* TODO: Add SSPP_MAX in mdp5.xml.h */

 struct mdp5_crtc {
@@ -47,8 +50,21 @@ struct mdp5_crtc {
 #define PENDING_FLIP   0x2
atomic_t pending;

+   /* for unref'ing cursor bo's after scanout completes: */
+   struct drm_flip_work unref_cursor_work;
+
struct mdp_irq vblank;
struct mdp_irq err;
+
+   struct {
+   /* protect REG_MDP5_LM_CURSOR* registers and cursor scanout_bo*/
+   spinlock_t lock;
+
+   /* current cursor being scanned out: */
+   struct drm_gem_object *scanout_bo;
+   uint32_t width;
+   uint32_t height;
+   } cursor;
 };
 #define to_mdp5_crtc(x) container_of(x, struct mdp5_crtc, base)

@@ -129,11 +145,22 @@ static void complete_flip(struct drm_crtc *crtc, struct 
drm_file *file)
}
 }

+static void unref_cursor_worker(struct drm_flip_work *work, void *val)
+{
+   struct mdp5_crtc *mdp5_crtc =
+   container_of(work, struct mdp5_crtc, unref_cursor_work);
+   struct mdp5_kms *mdp5_kms = get_kms(_crtc->base);
+
+   msm_gem_put_iova(val, mdp5_kms->id);
+   drm_gem_object_unreference_unlocked(val);
+}
+
 static void mdp5_crtc_destroy(struct drm_crtc *crtc)
 {
struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);

drm_crtc_cleanup(crtc);
+   drm_flip_work_cleanup(_crtc->unref_cursor_work);

kfree(mdp5_crtc);
 }
@@ -384,6 +411,132 @@ static int mdp5_crtc_set_property(struct drm_crtc *crtc,
return -EINVAL;
 }

+static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
+   struct drm_file *file, uint32_t handle,
+   uint32_t width, uint32_t height)
+{
+   struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
+   struct drm_device *dev = crtc->dev;
+   struct mdp5_kms *mdp5_kms = get_kms(crtc);
+   struct drm_gem_object *cursor_bo, *old_bo;
+   uint32_t blendcfg, cursor_addr, stride;
+   int ret, bpp, lm;
+   unsigned int depth;
+   enum mdp5_cursor_alpha cur_alpha = CURSOR_ALPHA_PER_PIXEL;
+   uint32_t flush_mask = mdp_ctl_flush_mask_cursor(0);
+   unsigned long flags;
+
+   if ((width > CURSOR_WIDTH) || (height > CURSOR_HEIGHT)) {
+   dev_err(dev->dev, "bad cursor size: %dx%d\n", width, height);
+   return -EINVAL;
+   }
+
+   if (NULL == mdp5_crtc->ctl)
+   return -EINVAL;
+
+   if (!handle) {
+   DBG("Cursor off");
+   return mdp5_ctl_set_cursor(mdp5_crtc->ctl, false);
+   }
+
+   cursor_bo = drm_gem_object_lookup(dev, file, handle);
+   if (!cursor_bo)
+   return -ENOENT;
+
+   ret = msm_gem_get_iova(cursor_bo, mdp5_kms->id, _addr);
+   if (ret)
+   return -EINVAL;
+
+   lm = mdp5_crtc->lm;
+   drm_fb_get_bpp_depth(DRM_FORMAT_ARGB, , );
+   stride = width * (bpp >> 3);
+
+   spin_lock_irqsave(_crtc->cursor.lock, flags);
+   old_bo = mdp5_crtc->cursor.scanout_bo;
+
+   mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_STRIDE(lm), stride);
+   mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_FORMAT(lm),
+   MDP5_LM_CURSOR_FORMAT_FORMAT(CURSOR_FMT_ARGB));
+   mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_IMG_SIZE(lm),
+   MDP5_LM_CURSOR_IMG_SIZE_SRC_H(height) |
+   MDP5_LM_CURSOR_IMG_SIZE_SRC_W(width));
+   mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_SIZE(lm),
+   MDP5_LM_CURSOR_SIZE_ROI_H(height) |
+   MDP5_LM_CURSOR_SIZE_ROI_W(width));
+   mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_BASE_ADDR(lm), cursor_addr);
+
+
+   blendcfg = MDP5_LM_CURSOR_BLEND_CONFIG_BLEND_EN;
+   blendcfg |= MDP5_LM_CURSOR_BLEND_CONFIG_BLEND_TRANSP_EN;
+   blendcfg |= MDP5_LM_CURSOR_BLEND_CONFIG_BLEND_ALPHA_SEL(cur_alpha);
+   mdp5_write(mdp5_kms, REG_MDP5_LM_CURSOR_BLEND_CONFIG(lm), blendcfg);
+
+   mdp5_crtc->cursor.scanout_bo = cursor_bo;
+   mdp5_crtc->cursor.width = width;
+   mdp5_crtc->cursor.height = height;
+   spin_unlock_irqrestore(_crtc->cursor.lock, flags);
+
+   ret = mdp5_ctl_set_cursor(mdp5_crtc->ctl, true);
+   if (ret)
+   goto end;
+
+   flush_mask |= 

[PATCH 1/2] drm/msm/mdp5: add register description for HW Cursor support

2015-01-13 Thread Stephane Viau
Update generated headers, in particular pick up the definitions
for Hardware Cursor support (MDP5).

Signed-off-by: Stephane Viau 
---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h | 79 +
 1 file changed, 79 insertions(+)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h 
b/drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h
index 7833c22..09701a4 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h
@@ -129,6 +129,17 @@ enum mdp5_client_id {
CID_MAX = 23,
 };

+enum mdp5_cursor_format {
+   CURSOR_FMT_ARGB = 0,
+   CURSOR_FMT_ARGB1555 = 2,
+   CURSOR_FMT_ARGB = 4,
+};
+
+enum mdp5_cursor_alpha {
+   CURSOR_ALPHA_CONST = 0,
+   CURSOR_ALPHA_PER_PIXEL = 2,
+};
+
 enum mdp5_igc_type {
IGC_VIG = 0,
IGC_RGB = 1,
@@ -973,20 +984,88 @@ static inline uint32_t 
REG_MDP5_LM_BLEND_BG_TRANSP_HIGH0(uint32_t i0, uint32_t i
 static inline uint32_t REG_MDP5_LM_BLEND_BG_TRANSP_HIGH1(uint32_t i0, uint32_t 
i1) { return 0x0048 + __offset_LM(i0) + 0x30*i1; }

 static inline uint32_t REG_MDP5_LM_CURSOR_IMG_SIZE(uint32_t i0) { return 
0x00e0 + __offset_LM(i0); }
+#define MDP5_LM_CURSOR_IMG_SIZE_SRC_W__MASK0x
+#define MDP5_LM_CURSOR_IMG_SIZE_SRC_W__SHIFT   0
+static inline uint32_t MDP5_LM_CURSOR_IMG_SIZE_SRC_W(uint32_t val)
+{
+   return ((val) << MDP5_LM_CURSOR_IMG_SIZE_SRC_W__SHIFT) & 
MDP5_LM_CURSOR_IMG_SIZE_SRC_W__MASK;
+}
+#define MDP5_LM_CURSOR_IMG_SIZE_SRC_H__MASK0x
+#define MDP5_LM_CURSOR_IMG_SIZE_SRC_H__SHIFT   16
+static inline uint32_t MDP5_LM_CURSOR_IMG_SIZE_SRC_H(uint32_t val)
+{
+   return ((val) << MDP5_LM_CURSOR_IMG_SIZE_SRC_H__SHIFT) & 
MDP5_LM_CURSOR_IMG_SIZE_SRC_H__MASK;
+}

 static inline uint32_t REG_MDP5_LM_CURSOR_SIZE(uint32_t i0) { return 
0x00e4 + __offset_LM(i0); }
+#define MDP5_LM_CURSOR_SIZE_ROI_W__MASK
0x
+#define MDP5_LM_CURSOR_SIZE_ROI_W__SHIFT   0
+static inline uint32_t MDP5_LM_CURSOR_SIZE_ROI_W(uint32_t val)
+{
+   return ((val) << MDP5_LM_CURSOR_SIZE_ROI_W__SHIFT) & 
MDP5_LM_CURSOR_SIZE_ROI_W__MASK;
+}
+#define MDP5_LM_CURSOR_SIZE_ROI_H__MASK
0x
+#define MDP5_LM_CURSOR_SIZE_ROI_H__SHIFT   16
+static inline uint32_t MDP5_LM_CURSOR_SIZE_ROI_H(uint32_t val)
+{
+   return ((val) << MDP5_LM_CURSOR_SIZE_ROI_H__SHIFT) & 
MDP5_LM_CURSOR_SIZE_ROI_H__MASK;
+}

 static inline uint32_t REG_MDP5_LM_CURSOR_XY(uint32_t i0) { return 0x00e8 
+ __offset_LM(i0); }
+#define MDP5_LM_CURSOR_XY_SRC_X__MASK  0x
+#define MDP5_LM_CURSOR_XY_SRC_X__SHIFT 0
+static inline uint32_t MDP5_LM_CURSOR_XY_SRC_X(uint32_t val)
+{
+   return ((val) << MDP5_LM_CURSOR_XY_SRC_X__SHIFT) & 
MDP5_LM_CURSOR_XY_SRC_X__MASK;
+}
+#define MDP5_LM_CURSOR_XY_SRC_Y__MASK  0x
+#define MDP5_LM_CURSOR_XY_SRC_Y__SHIFT 16
+static inline uint32_t MDP5_LM_CURSOR_XY_SRC_Y(uint32_t val)
+{
+   return ((val) << MDP5_LM_CURSOR_XY_SRC_Y__SHIFT) & 
MDP5_LM_CURSOR_XY_SRC_Y__MASK;
+}

 static inline uint32_t REG_MDP5_LM_CURSOR_STRIDE(uint32_t i0) { return 
0x00dc + __offset_LM(i0); }
+#define MDP5_LM_CURSOR_STRIDE_STRIDE__MASK 0x
+#define MDP5_LM_CURSOR_STRIDE_STRIDE__SHIFT0
+static inline uint32_t MDP5_LM_CURSOR_STRIDE_STRIDE(uint32_t val)
+{
+   return ((val) << MDP5_LM_CURSOR_STRIDE_STRIDE__SHIFT) & 
MDP5_LM_CURSOR_STRIDE_STRIDE__MASK;
+}

 static inline uint32_t REG_MDP5_LM_CURSOR_FORMAT(uint32_t i0) { return 
0x00ec + __offset_LM(i0); }
+#define MDP5_LM_CURSOR_FORMAT_FORMAT__MASK 0x0007
+#define MDP5_LM_CURSOR_FORMAT_FORMAT__SHIFT0
+static inline uint32_t MDP5_LM_CURSOR_FORMAT_FORMAT(enum mdp5_cursor_format 
val)
+{
+   return ((val) << MDP5_LM_CURSOR_FORMAT_FORMAT__SHIFT) & 
MDP5_LM_CURSOR_FORMAT_FORMAT__MASK;
+}

 static inline uint32_t REG_MDP5_LM_CURSOR_BASE_ADDR(uint32_t i0) { return 
0x00f0 + __offset_LM(i0); }

 static inline uint32_t REG_MDP5_LM_CURSOR_START_XY(uint32_t i0) { return 
0x00f4 + __offset_LM(i0); }
+#define MDP5_LM_CURSOR_START_XY_X_START__MASK  0x
+#define MDP5_LM_CURSOR_START_XY_X_START__SHIFT 0
+static inline uint32_t MDP5_LM_CURSOR_START_XY_X_START(uint32_t val)
+{
+   return ((val) << MDP5_LM_CURSOR_START_XY_X_START__SHIFT) & 
MDP5_LM_CURSOR_START_XY_X_START__MASK;
+}
+#define MDP5_LM_CURSOR_START_XY_Y_START__MASK  0x
+#define MDP5_LM_CURSOR_START_XY_Y_START__SHIFT 16
+static inline uint32_t MDP5_LM_CURSOR_START_XY_Y_START(uint32_t val)
+{
+   return ((val) << MDP5_LM_CURSOR_START_XY_Y_START__SHIFT) & 
MDP5_LM_CURSOR_START_XY_Y_START__MASK;
+}

 static inline 

[PATCH 0/2] drm/msm/mdp5: hardware cursor support

2015-01-13 Thread Stephane Viau
This patch set contains the hardware cursor changes. Split into two, as usual,
in order to separate header file generation from the rest of the code.

Beeresh Gopal (1):
  drm/msm/mdp5: Add hardware cursor support

Stephane Viau (1):
  drm/msm/mdp5: add register description for HW Cursor support

 drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h  |  79 +++
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 164 +++
 2 files changed, 243 insertions(+)

-- 
Qualcomm Innovation Center, Inc.

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a 
Linux Foundation Collaborative Project



[PATCH v9 1/4] drm/i2c: tda998x: Add DT support for audio

2015-01-13 Thread Jean-Francois Moine
On Tue, 13 Jan 2015 12:27:15 +
Russell King - ARM Linux  wrote:

> On Tue, Jan 13, 2015 at 01:21:58PM +0100, Philipp Zabel wrote:
> > I wonder if it wouldn't be nicer to have the AP# and type in the device
> > tree and then calculate the register value from that in the driver.
> > 
> > port at 1 {
> > reg = <1>; /* AP1 */
> > nxp,audio-port = "i2s";
> > tda998x_i2s: endpoint {
> > remote-endpoint = <_i2s>;
> > };
> > };
> 
> What about the case where we have 4 I2S streams being supplied to the
> device on four separate AP inputs?

4 streams on 4 different APs (sources) should work, but 4 streams from
a same source should be detailed.

In an other way, the unit address (== first reg) does not need to be a
sequence number. It is the I/O base in most DTs.
So, it could be the port value: 

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>;
};
};

-- 
Ken ar c'hentañ| ** Breizh ha Linux atav! **
Jef |   http://moinejf.free.fr/


[Bug 86351] HDMI audio garbled output on Radeon R9 280X

2015-01-13 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=86351

--- Comment #8 from Andy Furniss  ---
(In reply to Alex Deucher from comment #7)
> If you are using CPU governor, does forcing the CPU power state to a stable
> state help?

No, I've tried many things as recorded in the FDO bug I linked.

It's certainly a strange one, but the only way to get working sound I've found
is to have enough CPU load across all my CPUs (just maxing one won't do).

By luck for me my only real use case is HDTV and decoding in s/w is enough
load.

When there is no load it's like just one chunk of buffer gets repeated and this
may initially contain old sound from a previous loaded run.

Doing not much will advance the buffer. With more, but not enough, load the
sound is almost OK, but there is a bit of crackle.

This does seem to need purely CPU load, as I said in the other bug I can
reproduce from fbcon without X and temporarily "fix" the sound my compiling
something with make -j5.

My CPU is AMD Phenom II x4 965be, but IIRC others have seen this with intel.

Whether working or not interrupt counters rise at the same rate.

Previous card = HD4890 didn't have the issue in the same box with the same TV
with almost the same s/w.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


[Bug 86351] HDMI audio garbled output on Radeon R9 280X

2015-01-13 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=86351

--- Comment #7 from Alex Deucher  ---
If you are using CPU governor, does forcing the CPU power state to a stable
state help?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


[Bug 86351] HDMI audio garbled output on Radeon R9 280X

2015-01-13 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=86351

--- Comment #6 from Andy Furniss  ---
(In reply to Alex Deucher from comment #5)
> Does forcing the GPU clocks to high help?  E.g., as root:
> echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level

Doesn't help for me.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


[Intel-gfx] [RFC v2 1/4] drm: Add support to find drm_panel by name

2015-01-13 Thread Andrzej Hajda
On 01/13/2015 12:08 AM, Daniel Vetter wrote:
> On Fri, Jan 9, 2015 at 1:50 PM, Jani Nikula  wrote:
>> I have a slightly uneasy feeling about handing out drm_panel pointers
>> (both from here and of_drm_find_panel) without refcounting. If the panel
>> driver gets removed, whoever called the find functions will have a
>> dangling pointer. I supposed this will be discussed on drm-devel.

refcounting does not seems to me a good solution, drm_panel is
exposed by device driver and device driver can be unbound unconditionally
at any time. This problem affects many frameworks not only drm_panel.

I work on resource tracking framework which tries to solve the problem
in a generic way[1].

[1]: https://lkml.org/lkml/2014/12/10/342

Regards
Andrzej


> There's been some discussion already about exactly this problem (but
> with drm bridges) with Thierry and some other people. Cc'ed them all
> hopefully. Especially when the panel/bridge is a separate driver
> there's imo indeed an issue.
> -Daniel



Softlockup on boot with Cape Verde XT on many kernels

2015-01-13 Thread Michel Dänzer
On 11.01.2015 10:58, Federico wrote:
> Hi.
> I always get a soft lockup when booting since I bought a Cape Verde XT
> [Radeon HD 7770/8760 / R7 250X].
> 
> In this bug report you can find screenshots of the softlockup and the
> kernel panic generated by using softlockup_panic=1
> 
> https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1386973

Is that the full backtrace from the panic? Maybe you can set a higher
console resolution or a smaller console font?


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer


[PATCH v9 1/4] drm/i2c: tda998x: Add DT support for audio

2015-01-13 Thread Russell King - ARM Linux
On Tue, Jan 13, 2015 at 04:54:11PM +0100, Jean-Francois Moine wrote:
> 4 streams on 4 different APs (sources) should work, but 4 streams from
> a same source should be detailed.

I'd like to know how you intend to wire up four different I2S sources
to the TDA998x.

Remember, an I2S source produces the I2S data and the word clock - that's
two outputs.  You can't electronically wire the word clocks together.

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


[PATCH] drm/radeon: dont switch vt on suspend

2015-01-13 Thread Maarten Lankhorst
Op 13-01-15 om 15:51 schreef Alex Deucher:
> On Tue, Jan 13, 2015 at 3:40 AM, Maarten Lankhorst
>  wrote:
>> Signed-off-by: Maarten Lankhorst 
> Does this fix anything or is it purely cosmetic?
It gets rid of unnecessarily switching to the suspend console, resulting in no 
longer having a xorg vt switch on suspend.

So probably just cosmetic. In nouveau it exposed a bug with LUT restore and 
cursor save/restore. :-)

~Maarten


[PATCH 2/2] drm/msm/hdmi: add hdmi hdcp support (V2)

2015-01-13 Thread Jilai Wang
Add HDMI HDCP support including HDCP PartI/II/III authentication.
V1: Initial Change
V2: Address Bjorn's comments
Refactor the authentication process to use single work instead
of multiple work for different authentication stages.

Signed-off-by: Jilai Wang 
---
 drivers/gpu/drm/msm/Makefile  |1 +
 drivers/gpu/drm/msm/hdmi/hdmi.c   |   45 +-
 drivers/gpu/drm/msm/hdmi/hdmi.h   |   31 +
 drivers/gpu/drm/msm/hdmi/hdmi_audio.c |1 -
 drivers/gpu/drm/msm/hdmi/hdmi_bridge.c|8 +-
 drivers/gpu/drm/msm/hdmi/hdmi_connector.c |7 +-
 drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c  | 1445 +
 7 files changed, 1530 insertions(+), 8 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index e5464a0..2b32d4d 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
@@ -12,6 +12,7 @@ msm-y := \
hdmi/hdmi_audio.o \
hdmi/hdmi_bridge.o \
hdmi/hdmi_connector.o \
+   hdmi/hdmi_hdcp.o \
hdmi/hdmi_i2c.o \
hdmi/hdmi_phy_8960.o \
hdmi/hdmi_phy_8x60.o \
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index b2e610e..7713155 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -22,7 +22,9 @@
 void hdmi_set_mode(struct hdmi *hdmi, bool power_on)
 {
uint32_t ctrl = 0;
+   unsigned long flags;

+   spin_lock_irqsave(>reg_lock, flags);
if (power_on) {
ctrl |= HDMI_CTRL_ENABLE;
if (!hdmi->hdmi_mode) {
@@ -37,6 +39,7 @@ void hdmi_set_mode(struct hdmi *hdmi, bool power_on)
}

hdmi_write(hdmi, REG_HDMI_CTRL, ctrl);
+   spin_unlock_irqrestore(>reg_lock, flags);
DBG("HDMI Core: %s, HDMI_CTRL=0x%08x",
power_on ? "Enable" : "Disable", ctrl);
 }
@@ -51,6 +54,10 @@ static irqreturn_t hdmi_irq(int irq, void *dev_id)
/* Process DDC: */
hdmi_i2c_irq(hdmi->i2c);

+   /* Process HDCP: */
+   if (hdmi->hdcp_ctrl)
+   hdmi_hdcp_irq(hdmi->hdcp_ctrl);
+
/* TODO audio.. */

return IRQ_HANDLED;
@@ -60,6 +67,15 @@ static void hdmi_destroy(struct hdmi *hdmi)
 {
struct hdmi_phy *phy = hdmi->phy;

+   /*
+* at this point, hpd has been disabled,
+* after flush workq, it's safe to deinit hdcp
+*/
+   if (hdmi->workq) {
+   flush_workqueue(hdmi->workq);
+   destroy_workqueue(hdmi->workq);
+   }
+   hdmi_hdcp_destroy(hdmi);
if (phy)
phy->funcs->destroy(phy);

@@ -82,6 +98,7 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
 {
struct hdmi_platform_config *config = pdev->dev.platform_data;
struct hdmi *hdmi = NULL;
+   struct resource *res;
int i, ret;

hdmi = devm_kzalloc(>dev, sizeof(*hdmi), GFP_KERNEL);
@@ -92,6 +109,7 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)

hdmi->pdev = pdev;
hdmi->config = config;
+   spin_lock_init(>reg_lock);

/* not sure about which phy maps to which msm.. probably I miss some */
if (config->phy_init)
@@ -112,6 +130,18 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
goto fail;
}

+   /* HDCP needs physical address of hdmi register */
+   res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+   config->mmio_name);
+   hdmi->mmio_phy_addr = res->start;
+
+   hdmi->qfprom_mmio = msm_ioremap(pdev,
+   config->qfprom_mmio_name, "HDMI_QFPROM");
+   if (IS_ERR(hdmi->qfprom_mmio)) {
+   dev_info(>dev, "can't find qfprom resource\n");
+   hdmi->qfprom_mmio = NULL;
+   }
+
hdmi->hpd_regs = devm_kzalloc(>dev, sizeof(hdmi->hpd_regs[0]) *
config->hpd_reg_cnt, GFP_KERNEL);
if (!hdmi->hpd_regs) {
@@ -194,6 +224,8 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
hdmi->pwr_clks[i] = clk;
}

+   hdmi->workq = alloc_ordered_workqueue("msm_hdmi", 0);
+
hdmi->i2c = hdmi_i2c_init(hdmi);
if (IS_ERR(hdmi->i2c)) {
ret = PTR_ERR(hdmi->i2c);
@@ -202,6 +234,12 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
goto fail;
}

+   hdmi->hdcp_ctrl = hdmi_hdcp_init(hdmi);
+   if (IS_ERR(hdmi->hdcp_ctrl)) {
+   dev_warn(>dev, "failed to init hdcp: disabled\n");
+   hdmi->hdcp_ctrl = NULL;
+   }
+
return hdmi;

 fail:
@@ -384,6 +422,7 @@ static int hdmi_bind(struct device *dev, struct device 
*master, void *data)
}

hdmi_cfg->mmio_name = "core_physical";
+   hdmi_cfg->qfprom_mmio_name = "qfprom_physical";
hdmi_cfg->ddc_clk_gpio  = get_gpio(dev, of_node, 
"qcom,hdmi-tx-ddc-clk");
   

[PATCH 1/2] drm/msm/hdmi: add register description for HDMI HDCP support (V2)

2015-01-13 Thread Jilai Wang
Add HDCP related register description.
V1: Initial Change
V2: Add register bit description.

Signed-off-by: Jiali Wang 
---
 drivers/gpu/drm/msm/hdmi/hdmi.xml.h | 42 +++--
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.xml.h 
b/drivers/gpu/drm/msm/hdmi/hdmi.xml.h
index 2d1272e..e7b455b 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.xml.h
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.xml.h
@@ -8,17 +8,8 @@ http://github.com/freedreno/envytools/
 git clone https://github.com/freedreno/envytools.git

 The rules-ng-ng source files this header was generated from are:
-- /home/robclark/src/freedreno/envytools/rnndb/msm.xml (
676 bytes, from 2014-12-05 15:34:49)
-- /home/robclark/src/freedreno/envytools/rnndb/freedreno_copyright.xml (   
1453 bytes, from 2013-03-31 16:51:27)
-- /home/robclark/src/freedreno/envytools/rnndb/mdp/mdp4.xml(  
20908 bytes, from 2014-12-08 16:13:00)
-- /home/robclark/src/freedreno/envytools/rnndb/mdp/mdp_common.xml  (   
2357 bytes, from 2014-12-08 16:13:00)
-- /home/robclark/src/freedreno/envytools/rnndb/mdp/mdp5.xml(  
26005 bytes, from 2014-12-08 16:13:00)
-- /home/robclark/src/freedreno/envytools/rnndb/dsi/dsi.xml (  
11712 bytes, from 2013-08-17 17:13:43)
-- /home/robclark/src/freedreno/envytools/rnndb/dsi/sfpb.xml(
344 bytes, from 2013-08-11 19:26:32)
-- /home/robclark/src/freedreno/envytools/rnndb/dsi/mmss_cc.xml (   
1686 bytes, from 2014-10-31 16:48:57)
-- /home/robclark/src/freedreno/envytools/rnndb/hdmi/qfprom.xml (
600 bytes, from 2013-07-05 19:21:12)
-- /home/robclark/src/freedreno/envytools/rnndb/hdmi/hdmi.xml   (  
25125 bytes, from 2014-12-02 15:04:52)
-- /home/robclark/src/freedreno/envytools/rnndb/edp/edp.xml (   
8253 bytes, from 2014-12-08 16:13:00)
+- 
/local/mnt2/workspace2/jilaiw/chromeos/envytools/envytools/rnndb/hdmi/hdmi.xml  
 (  26848 bytes, from 2014-12-11 18:18:13)
+- 
/local/mnt2/workspace2/jilaiw/chromeos/envytools/envytools/rnndb/freedreno_copyright.xml
 (   1453 bytes, from 2014-11-24 22:27:21)

 Copyright (C) 2013-2014 by the following authors:
 - Rob Clark  (robclark)
@@ -203,12 +194,28 @@ static inline uint32_t HDMI_AUDIO_INFO1_LSV(uint32_t val)
 #define HDMI_HDCP_CTRL_ENCRYPTION_ENABLE   0x0100

 #define REG_HDMI_HDCP_DEBUG_CTRL   0x0114
+#define HDMI_HDCP_DEBUG_CTRL_RNG_CIPHER
0x0004

 #define REG_HDMI_HDCP_INT_CTRL 0x0118
+#define HDMI_HDCP_INT_CTRL_AUTH_SUCCESS_INT0x0001
+#define HDMI_HDCP_INT_CTRL_AUTH_SUCCESS_ACK0x0002
+#define HDMI_HDCP_INT_CTRL_AUTH_SUCCESS_MASK   0x0004
+#define HDMI_HDCP_INT_CTRL_AUTH_FAIL_INT   0x0010
+#define HDMI_HDCP_INT_CTRL_AUTH_FAIL_ACK   0x0020
+#define HDMI_HDCP_INT_CTRL_AUTH_FAIL_MASK  0x0040
+#define HDMI_HDCP_INT_CTRL_AUTH_FAIL_INFO_ACK  0x0080
+#define HDMI_HDCP_INT_CTRL_AUTH_XFER_REQ_INT   0x0100
+#define HDMI_HDCP_INT_CTRL_AUTH_XFER_REQ_ACK   0x0200
+#define HDMI_HDCP_INT_CTRL_AUTH_XFER_REQ_MASK  0x0400
+#define HDMI_HDCP_INT_CTRL_AUTH_XFER_DONE_INT  0x1000
+#define HDMI_HDCP_INT_CTRL_AUTH_XFER_DONE_ACK  0x2000
+#define HDMI_HDCP_INT_CTRL_AUTH_XFER_DONE_MASK 0x4000

 #define REG_HDMI_HDCP_LINK0_STATUS 0x011c
 #define HDMI_HDCP_LINK0_STATUS_AN_0_READY  0x0100
 #define HDMI_HDCP_LINK0_STATUS_AN_1_READY  0x0200
+#define HDMI_HDCP_LINK0_STATUS_RI_MATCHES  0x1000
+#define HDMI_HDCP_LINK0_STATUS_V_MATCHES   0x0010
 #define HDMI_HDCP_LINK0_STATUS_KEY_STATE__MASK 0x7000
 #define HDMI_HDCP_LINK0_STATUS_KEY_STATE__SHIFT28
 static inline uint32_t HDMI_HDCP_LINK0_STATUS_KEY_STATE(enum 
hdmi_hdcp_key_state val)
@@ -217,10 +224,19 @@ static inline uint32_t 
HDMI_HDCP_LINK0_STATUS_KEY_STATE(enum hdmi_hdcp_key_state
 }

 #define REG_HDMI_HDCP_DDC_CTRL_0   0x0120
+#define HDMI_HDCP_DDC_CTRL_0_DISABLE   0x0001

 #define REG_HDMI_HDCP_DDC_CTRL_1   0x0124
+#define HDMI_HDCP_DDC_CTRL_1_FAILED_ACK
0x0001

 #define REG_HDMI_HDCP_DDC_STATUS   0x0128
+#define HDMI_HDCP_DDC_STATUS_XFER_REQ  0x0010
+#define HDMI_HDCP_DDC_STATUS_XFER_DONE 0x0400
+#define HDMI_HDCP_DDC_STATUS_ABORTED   0x1000
+#define HDMI_HDCP_DDC_STATUS_TIMEOUT  

[PATCH] rnndb: Add register fields for msm/hdmi HDCP support (V2)

2015-01-13 Thread Jilai Wang
This patch adds the field description for HDMI HDCP registers.
V1: Initial change
V2: Add register bit description.

Signed-off-by: Jilai Wang 
---
 rnndb/hdmi/hdmi.xml | 87 -
 1 file changed, 79 insertions(+), 8 deletions(-)

diff --git a/rnndb/hdmi/hdmi.xml b/rnndb/hdmi/hdmi.xml
index 64393b4..9ac5e00 100644
--- a/rnndb/hdmi/hdmi.xml
+++ b/rnndb/hdmi/hdmi.xml
@@ -12,12 +12,14 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ 
rules-ng.xsd">

 

-   
-   
-   
-   
-   
-   
+   
+   
+   
+   
+   
+   
+   
+   



@@ -168,15 +170,69 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ 
rules-ng.xsd">



-   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   



+   
+   


+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+   
+   
+



+
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+



@@ -238,7 +294,9 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ 
rules-ng.xsd">



-   
+   
+   
+   



@@ -374,6 +442,9 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ 
rules-ng.xsd">



+   
+   
+



-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project



[Intel-gfx] [PATCH 1/2] drm: Adding rotation to drm_plane_helper_check_update

2015-01-13 Thread Ville Syrjälä
On Tue, Jan 13, 2015 at 06:03:39PM +0530, Sonika Jindal wrote:
> Taking rotation into account while checking the plane
> and adjusting the sizes accordingly.
> 
> Signed-off-by: Sonika Jindal 
> ---
>  drivers/gpu/drm/drm_plane_helper.c |   79 
> ++--
>  include/drm/drm_plane_helper.h |3 +-
>  2 files changed, 77 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_plane_helper.c 
> b/drivers/gpu/drm/drm_plane_helper.c
> index f24c4cf..4badd69 100644
> --- a/drivers/gpu/drm/drm_plane_helper.c
> +++ b/drivers/gpu/drm/drm_plane_helper.c
> @@ -138,9 +138,13 @@ int drm_plane_helper_check_update(struct drm_plane 
> *plane,
>   int max_scale,
>   bool can_position,
>   bool can_update_disabled,
> - bool *visible)
> + bool *visible,
> + unsigned int rotation)
>  {
>   int hscale, vscale;
> + int crtc_x, crtc_y;
> + unsigned int crtc_w, crtc_h;
> + uint32_t src_x, src_y, src_w, src_h;
>  
>   if (!fb) {
>   *visible = false;
> @@ -158,9 +162,13 @@ int drm_plane_helper_check_update(struct drm_plane 
> *plane,
>   return -EINVAL;
>   }
>  
> + if (fb)
> + drm_rect_rotate(src, fb->width << 16, fb->height << 16,
> + rotation);
> +
>   /* Check scaling */
> - hscale = drm_rect_calc_hscale(src, dest, min_scale, max_scale);
> - vscale = drm_rect_calc_vscale(src, dest, min_scale, max_scale);
> + hscale = drm_rect_calc_hscale_relaxed(src, dest, min_scale, max_scale);
> + vscale = drm_rect_calc_vscale_relaxed(src, dest, min_scale, max_scale);

This is an unrelated change. Relaxed scaling allows the the src/dest
rectangles to be reduced in size in order to keep the scaling ration
within the min/max range. I suppose we should switch to using it to
make the behaviour uniform across drivers, but definitely should be
done with a separate patch.

>   if (hscale < 0 || vscale < 0) {
>   DRM_DEBUG_KMS("Invalid scaling of plane\n");
>   return -ERANGE;
> @@ -182,6 +190,68 @@ int drm_plane_helper_check_update(struct drm_plane 
> *plane,
>   return -EINVAL;
>   }
>  
> + crtc_x = dest->x1;
> + crtc_y = dest->y1;
> + crtc_w = drm_rect_width(dest);
> + crtc_h = drm_rect_height(dest);

You don't adjust these in any way so they are not needed.

> +
> + if (*visible) {
> + /* check again in case clipping clamped the results */
> + hscale = drm_rect_calc_hscale(src, dest,
> + DRM_PLANE_HELPER_NO_SCALING,
> + DRM_PLANE_HELPER_NO_SCALING);

First you allowed scaling and now you don't. What's up with that?

> + if (hscale < 0) {
> + DRM_DEBUG_KMS("Horizontal scaling factor out of 
> limits\n");
> + drm_rect_debug_print(src, true);
> + drm_rect_debug_print(dest, false);
> +
> + return hscale;
> + }
> +
> + vscale = drm_rect_calc_vscale(src, dest,
> + DRM_PLANE_HELPER_NO_SCALING,
> + DRM_PLANE_HELPER_NO_SCALING);
> + if (vscale < 0) {
> + DRM_DEBUG_KMS("Vertical scaling factor out of 
> limits\n");
> + drm_rect_debug_print(src, true);
> + drm_rect_debug_print(dest, false);
> +
> + return vscale;
> + }
> +
> + /* Make the source viewport size an exact multiple of the 
> scaling factors. */
> + drm_rect_adjust_size(src,
> + drm_rect_width(dest) * hscale - drm_rect_width(src),
> + drm_rect_height(dest) * vscale - drm_rect_height(src));
> +
> + drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16,
> + rotation);
> +
> + /*
> +  * Hardware doesn't handle subpixel coordinates.

That's a purely hardware specific detail. It should not be part of the
helpers. And in any case the returned src coordinates must remain in
fixed point format.

> +  * Adjust to (macro)pixel boundary, but be careful not to
> +  * increase the source viewport size, because that could
> +  * push the downscaling factor out of bounds.
> +  */
> + src_x = src->x1 >> 16;
> + src_w = drm_rect_width(src) >> 16;
> + src_y = src->y1 >> 16;
> + src_h = drm_rect_height(src) >> 16;
> + }
> +
> + if (*visible) {
> + src->x1 = src_x;
> + src->x2 = src_x + src_w;
> + src->y1 = src_y;
> +  

Softlockup on boot with Cape Verde XT on many kernels

2015-01-13 Thread Federico
I tried setting vga=791, but the panic messages done appear on screen, only
the normal kernel boot log until the key lights start flashing.

Also tried a video capture, but the text goes too fast even for the LCD to
update the image.

Do you know how to set the console font size as a kernel parameter?



2015-01-13 4:06 GMT-03:00 Michel Dänzer :

> On 11.01.2015 10:58, Federico wrote:
> > Hi.
> > I always get a soft lockup when booting since I bought a Cape Verde XT
> > [Radeon HD 7770/8760 / R7 250X].
> >
> > In this bug report you can find screenshots of the softlockup and the
> > kernel panic generated by using softlockup_panic=1
> >
> > https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1386973
>
> Is that the full backtrace from the panic? Maybe you can set a higher
> console resolution or a smaller console font?
>
>
> --
> Earthling Michel Dänzer   |   http://www.amd.com
> Libre software enthusiast | Mesa and X developer
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20150113/385f92a5/attachment-0001.html>


[PATCH v2 2/2] video: Drop superfluous "select VT_HW_CONSOLE_BINDING"

2015-01-13 Thread Tomi Valkeinen
On 12/01/15 22:10, Geert Uytterhoeven wrote:
> commit 765d5b9c2b72f5b99722cdfcf4bf8f88c556cf92 ("fbdev: fbcon: select
> VT_HW_CONSOLE_BINDING") made FRAMEBUFFER_CONSOLE always select
> VT_HW_CONSOLE_BINDING, but forgot to remove
> 
>   select VT_HW_CONSOLE_BINDING if FRAMEBUFFER_CONSOLE
> 
> from the individual drivers' sections that already did this before.
> 
> Signed-off-by: Geert Uytterhoeven 
> ---
> v2:
>   - Split in two (drm and video) patches.
> ---
>  drivers/video/fbdev/Kconfig | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index 4916c97216f880fc..f2c3fb7d03992ad1 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -2151,7 +2151,6 @@ config FB_PS3
>   select FB_SYS_COPYAREA
>   select FB_SYS_IMAGEBLIT
>   select FB_SYS_FOPS
> - select VT_HW_CONSOLE_BINDING if FRAMEBUFFER_CONSOLE
>   ---help---
> Include support for the virtual frame buffer in the PS3 platform.
>  
> 

Thanks, queued for 3.20.

 Tomi


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


[PATCH] drm/exynos: remove unnecessary runtime pm operations

2015-01-13 Thread Joonyoung Shim
In booting, we can see a below message.

[3.241728] exynos-mixer 1445.mixer: Unbalanced pm_runtime_enable!

Already pm_runtime_enable is called by probe function. Remove
pm_runtime_enable/disable from mixer_bind and mixer_unbind.

Signed-off-by: Joonyoung Shim 
---
I'm not sure whether it's better to remove pm_runtime_enable/disable
from probe and remove function than mixer_bind and mixer_unbind.

 drivers/gpu/drm/exynos/exynos_mixer.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index b90a423..0dedb99 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1256,8 +1256,6 @@ static int mixer_bind(struct device *dev, struct device 
*manager, void *data)
if (ret)
goto free_ctx;

-   pm_runtime_enable(dev);
-
return 0;

 free_ctx:
@@ -1270,8 +1268,6 @@ static void mixer_unbind(struct device *dev, struct 
device *master, void *data)
struct mixer_context *ctx = dev_get_drvdata(dev);

mixer_ctx_remove(ctx);
-
-   pm_runtime_disable(dev);
 }

 static const struct component_ops mixer_component_ops = {
-- 
1.9.1



[PATCH RESEND] drm/msm/hdmi: use dynamic allocation for hdmi resources

2015-01-13 Thread Stephane Viau
Instead of reporting BUG_ON when resources arrays are not
dimensioned correctly, this patch does a dynamic allocation of
these arrays. This is needed for the following patches that add a
regulator for a new target.

Signed-off-by: Stephane Viau 
---
 drivers/gpu/drm/msm/hdmi/hdmi.c | 28 
 drivers/gpu/drm/msm/hdmi/hdmi.h |  8 
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 062c687..180041d 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -106,7 +106,12 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
goto fail;
}

-   BUG_ON(config->hpd_reg_cnt > ARRAY_SIZE(hdmi->hpd_regs));
+   hdmi->hpd_regs = devm_kzalloc(>dev, sizeof(hdmi->hpd_regs[0]) *
+   config->hpd_reg_cnt, GFP_KERNEL);
+   if (!hdmi->hpd_regs) {
+   ret = -ENOMEM;
+   goto fail;
+   }
for (i = 0; i < config->hpd_reg_cnt; i++) {
struct regulator *reg;

@@ -122,7 +127,12 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
hdmi->hpd_regs[i] = reg;
}

-   BUG_ON(config->pwr_reg_cnt > ARRAY_SIZE(hdmi->pwr_regs));
+   hdmi->pwr_regs = devm_kzalloc(>dev, sizeof(hdmi->pwr_regs[0]) *
+   config->pwr_reg_cnt, GFP_KERNEL);
+   if (!hdmi->pwr_regs) {
+   ret = -ENOMEM;
+   goto fail;
+   }
for (i = 0; i < config->pwr_reg_cnt; i++) {
struct regulator *reg;

@@ -138,7 +148,12 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
hdmi->pwr_regs[i] = reg;
}

-   BUG_ON(config->hpd_clk_cnt > ARRAY_SIZE(hdmi->hpd_clks));
+   hdmi->hpd_clks = devm_kzalloc(>dev, sizeof(hdmi->hpd_clks[0]) *
+   config->hpd_clk_cnt, GFP_KERNEL);
+   if (!hdmi->hpd_clks) {
+   ret = -ENOMEM;
+   goto fail;
+   }
for (i = 0; i < config->hpd_clk_cnt; i++) {
struct clk *clk;

@@ -153,7 +168,12 @@ static struct hdmi *hdmi_init(struct platform_device *pdev)
hdmi->hpd_clks[i] = clk;
}

-   BUG_ON(config->pwr_clk_cnt > ARRAY_SIZE(hdmi->pwr_clks));
+   hdmi->pwr_clks = devm_kzalloc(>dev, sizeof(hdmi->pwr_clks[0]) *
+   config->pwr_clk_cnt, GFP_KERNEL);
+   if (!hdmi->pwr_clks) {
+   ret = -ENOMEM;
+   goto fail;
+   }
for (i = 0; i < config->pwr_clk_cnt; i++) {
struct clk *clk;

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h
index 43e654f..9973e03 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.h
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.h
@@ -52,10 +52,10 @@ struct hdmi {

void __iomem *mmio;

-   struct regulator *hpd_regs[2];
-   struct regulator *pwr_regs[2];
-   struct clk *hpd_clks[3];
-   struct clk *pwr_clks[2];
+   struct regulator **hpd_regs;
+   struct regulator **pwr_regs;
+   struct clk **hpd_clks;
+   struct clk **pwr_clks;

struct hdmi_phy *phy;
struct i2c_adapter *i2c;
-- 
Qualcomm Innovation Center, Inc.

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a 
Linux Foundation Collaborative Project



[PATCH 1/1] reservation: wait only with non-zero timeout specified (v2)

2015-01-13 Thread Jammy Zhou
When the timeout value passed to reservation_object_wait_timeout_rcu
is zero, no wait should be done if the fences are not signaled.

Return '1' for idle and '0' for busy if the specified timeout is '0'
to keep consistent with the case of non-zero timeout.

v2: call fence_put if not signaled in the case of timeout==0

Signed-off-by: Jammy Zhou 
Reviewed-by: Christian König 
Reviewed-by: Alex Deucher 
---
 drivers/dma-buf/reservation.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
index 3c97c8f..b1d554f 100644
--- a/drivers/dma-buf/reservation.c
+++ b/drivers/dma-buf/reservation.c
@@ -380,12 +380,19 @@ retry:
}

rcu_read_unlock();
-   if (fence) {
+   if (fence && timeout) {
ret = fence_wait_timeout(fence, intr, ret);
fence_put(fence);
if (ret > 0 && wait_all && (i + 1 < shared_count))
goto retry;
}
+
+   if (fence && !timeout)
+   fence_put(fence);
+
+   if (!fence && !timeout)
+   ret = 1;
+
return ret;

 unlock_retry:
-- 
1.9.1



Fix compile failure if BACKLIGHT_CLASS_DEVICE is not selected

2015-01-13 Thread Ian Molton
>From 48c709c621dbd5505b524e0216a3232ebd0033a8 Mon Sep 17 00:00:00 2001
From: Ian Molton 
Date: Tue, 13 Jan 2015 12:46:54 +
Subject: [PATCH] DRM: Simple panel driver depends on backlight

The DRM_PANEL_SIMPLE option compiles code that requires the symbol
of_find_backlight_by_node. This is in drivers/video/backlight/backlight.c
and can optionally not be built. Make DRM_PANEL_SIMPLE depend on
BACKLIGHT_CLASS_DEVICE to resolve this.

drivers/built-in.o: In function `panel_simple_platform_probe':
debugfs.c:(.text+0x94da4): undefined reference to `of_find_backlight_by_node'
/home/ian/Work/swan/linux/Makefile:923: recipe for target 'vmlinux' failed


Signed-off-by: Ian Molton 
---
 drivers/gpu/drm/panel/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index bee9f72..d718acf 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -9,7 +9,7 @@ menu "Display Panels"

 config DRM_PANEL_SIMPLE
tristate "support for simple panels"
-   depends on OF
+   depends on OF && BACKLIGHT_CLASS_DEVICE
help
  DRM panel driver for dumb panels that need at most a regulator and
  a GPIO to be powered up. Optionally a backlight can be attached so
-- 
2.1.0



FOSDEM15: Graphics DevRoom: call for speakers.

2015-01-13 Thread Luc Verhaegen
On Tue, Jan 13, 2015 at 01:14:17PM +0100, Thierry Reding wrote:
> On Tue, Dec 09, 2014 at 03:39:26PM +0100, Luc Verhaegen wrote:
> > On Thu, Oct 02, 2014 at 07:44:57PM +0200, Luc Verhaegen wrote:
> > > Hi,
> > > 
> > > At FOSDEM on the 31st of january and the 1st of February 2015, there 
> > > will be another graphics DevRoom. URL: https://fosdem.org/2015/
> > 
> > > Slots will be handed out on a first come, first serve basis. The best 
> > > slots will go to those who apply the earliest. The amount of slots is 
> > > currently not known yet, but i expect there to be around 16 available (8 
> > > on each day), so act quickly.
> > 
> > > As for deadlines, i hope to have a pretty much complete schedule between 
> > > christmas and the new year. The rockhard printed schedule deadline is 
> > > probably January 9th, after that you will not be featured in the booklet 
> > > and you will have a lot less visitors. I will hopefully be able to lock 
> > > down entries and descriptions after that date.
> > 
> > It's been more than 2 months since the original email, it's less than 
> > two months away from the event, and one month away from what usually is 
> > the deadline for the booklet. File your talk now, while there are still 
> > some useful slots available.
> > 
> > Also, for those who have filed already but who have left their abstracts 
> > open, please get those filed in ASAP. Your talk will be only be ordered 
> > in when at least the basics are provided.
> 
> Hi Luc,
> 
> I realize I'm terribly late, but it took quite some time to get travel
> arranged. Looking at the schedule there still seem to be some free
> slots. Does it make sense to still submit a talk? I was asked to give
> one on atomic modesetting from a driver developer's perspective.
> 
> Thierry

Yes, but be quick, the hard booklet deadline is thursday evening. I will 
not be accepting talks past tomorrow evening.

Luc Verhaegen.


[PATCH v9 1/4] drm/i2c: tda998x: Add DT support for audio

2015-01-13 Thread Philipp Zabel
Am Montag, den 12.01.2015, 17:57 + schrieb Russell King - ARM Linux:
> On Mon, Jan 12, 2015 at 06:13:41PM +0100, Jean-Francois Moine wrote:
> > On Mon, 12 Jan 2015 14:04:56 +
> > Russell King - ARM Linux  wrote:
> > > On Mon, Jan 12, 2015 at 02:59:57PM +0100, Philipp Zabel wrote:
> > > > Note that of_graph_parse_endpoint interprets the port node's reg
> > > > property as port id. And the unit address part of the node name should
> > > > match the first address in the reg property.
> > 
> > This is not the case in vexpress-v2p-ca15_a7.dts.
> 
> Hmm... as the DT binding doc doesn't specify this restriction, and we
> have a DT file which violates what Philipp has said, I think we ought
> to document that reg vs unit node name does not need to match each
> other, thereby making that official.

The (unit address part == first reg property value) is from the ePAPR
and still documented in http://www.devicetree.org/Device_Tree_Usage. It
isn't explicitly stated as a hard requirement, but it is worded in such
a way that I'd expect it to hold true most of the time :/

> > > So that's not going to work very well... because the AP register is a
> > > bitmask.
> > > 
> > > I guess we could specify a node unit and reg, which the code otherwise
> > > ignores, and specify a philipps,ap-mask = property for the audio ports
> > > instead.
> > 
> > Also, the video and audio ports must be distinguished. They could be
> > defined in different port groups.
> > 
> > Example from the Cubox:
> > 
> > video-ports: ports at 0 {
> > port {
> > tda998x_video: endpoint {
> > remote-endpoint = <_0>;
> > nxp,video-port = <0x230145>;
> > };
> > };
> > };
> > audio-ports: ports at 1 {
> > port at 0 { /* AP1 = I2S */
> > tda998x_i2s: endpoint at 0 {
> > remote-endpoint = <_i2s>;
> > nxp,audio-port = <0x03>;
> > };
> > };
> > port at 1 {  /* AP2 = S/PDIF */
> > tda998x_spdif: endpoint at 1 {
> > remote-endpoint = <_spdif1>;
> > nxp,audio-port = <0x04>;
> > };
> > };
> > };

Please don't add the complexity of multiple 'ports' nodes to the OF
graph bindings. I'd rather have the driver determine the type of the
port. Ideally it could know that port 0 always is video and all other
ports are audio, otherwise checking the existence of a custom property
in the 'port' node should work, for example 'nxp,audio-port' or
'nxp,video-port'.
Why are those located in the 'endpoint' nodes in your example? Are you
expecting to dynamically reconfigure the port type of a given AP from
i2s to spdif depending on the activated endpoint?

> > The port type is identified by the bit AP0.
> 
> I don't particularly like that - that makes the assumption that AP0
> always means I2S.  What if a future chip decides to allow SPDIF on
> AP0?  Why should we need to re-invent the binding?
>
> IMHO, it would be much better to make this explicit.

I wonder if it wouldn't be nicer to have the AP# and type in the device
tree and then calculate the register value from that in the driver.

port at 1 {
reg = <1>; /* AP1 */
nxp,audio-port = "i2s";
tda998x_i2s: endpoint {
remote-endpoint = <_i2s>;
};
};

regards
Philipp



[PATCH 4/4] drm/amdkfd: Add initial VI support for KQ

2015-01-13 Thread Oded Gabbay
From: Ben Goz 

This patch starts to add support for the VI APU in the KQ (kernel queue)
module.

Because most (more than 90%) of the KQ code is shared among AMD's APUs, we
chose a design that performs most/all the code in the shared KQ file
(kfd_kernel_queue.c). If there is H/W specific code to be executed,
than it is written in an asic-specific extension function for that H/W.

That asic-specific extension function is called from the shared function at the
appropriate time. This requires that for every asic-specific extension function
that is implemented in a specific ASIC, there will be an equivalent
implementation in ALL ASICs, even if those implementations are just stubs.

That way we achieve:

- Maintainability: by having one copy of most of the code, we only need to
  fix bugs at one locations

- Readability: very clear what is the shared code and what is done per ASIC

- Extensibility: very easy to add new H/W specific files/functions

Signed-off-by: Ben Goz 
Signed-off-by: Oded Gabbay 
---
 drivers/gpu/drm/amd/amdkfd/Makefile   |  3 +-
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 21 +++--
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.h |  7 +++
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_cik.c | 44 ++
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c  | 56 +++
 5 files changed, 127 insertions(+), 4 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_cik.c
 create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c

diff --git a/drivers/gpu/drm/amd/amdkfd/Makefile 
b/drivers/gpu/drm/amd/amdkfd/Makefile
index 7558683..cd09c05 100644
--- a/drivers/gpu/drm/amd/amdkfd/Makefile
+++ b/drivers/gpu/drm/amd/amdkfd/Makefile
@@ -8,7 +8,8 @@ amdkfd-y:= kfd_module.o kfd_device.o kfd_chardev.o 
kfd_topology.o \
kfd_pasid.o kfd_doorbell.o kfd_flat_memory.o \
kfd_process.o kfd_queue.o kfd_mqd_manager.o \
kfd_mqd_manager_cik.o kfd_mqd_manager_vi.o \
-   kfd_kernel_queue.o kfd_packet_manager.o \
+   kfd_kernel_queue.o kfd_kernel_queue_cik.o \
+   kfd_kernel_queue_vi.o kfd_packet_manager.o \
kfd_process_queue_manager.o kfd_device_queue_manager.o \
kfd_device_queue_manager_cik.o kfd_device_queue_manager_vi.o \
kfd_interrupt.o
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
index 731635d..75950ed 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
@@ -73,13 +73,16 @@ static bool initialize(struct kernel_queue *kq, struct 
kfd_dev *dev,
goto err_get_kernel_doorbell;

retval = kfd_gtt_sa_allocate(dev, queue_size, >pq);
-
if (retval != 0)
goto err_pq_allocate_vidmem;

kq->pq_kernel_addr = kq->pq->cpu_ptr;
kq->pq_gpu_addr = kq->pq->gpu_addr;

+   retval = kq->ops_asic_specific.initialize(kq, dev, type, queue_size);
+   if (retval == false)
+   goto err_eop_allocate_vidmem;
+
retval = kfd_gtt_sa_allocate(dev, sizeof(*kq->rptr_kernel),
>rptr_mem);

@@ -111,6 +114,8 @@ static bool initialize(struct kernel_queue *kq, struct 
kfd_dev *dev,
prop.queue_address = kq->pq_gpu_addr;
prop.read_ptr = (uint32_t *) kq->rptr_gpu_addr;
prop.write_ptr = (uint32_t *) kq->wptr_gpu_addr;
+   prop.eop_ring_buffer_address = kq->eop_gpu_addr;
+   prop.eop_ring_buffer_size = PAGE_SIZE;

if (init_queue(>queue, prop) != 0)
goto err_init_queue;
@@ -156,6 +161,8 @@ err_init_queue:
 err_wptr_allocate_vidmem:
kfd_gtt_sa_free(dev, kq->rptr_mem);
 err_rptr_allocate_vidmem:
+   kfd_gtt_sa_free(dev, kq->eop_mem);
+err_eop_allocate_vidmem:
kfd_gtt_sa_free(dev, kq->pq);
 err_pq_allocate_vidmem:
pr_err("kfd: error init pq\n");
@@ -182,6 +189,7 @@ static void uninitialize(struct kernel_queue *kq)

kfd_gtt_sa_free(kq->dev, kq->rptr_mem);
kfd_gtt_sa_free(kq->dev, kq->wptr_mem);
+   kq->ops_asic_specific.uninitialize(kq);
kfd_gtt_sa_free(kq->dev, kq->pq);
kfd_release_kernel_doorbell(kq->dev,
kq->queue->properties.doorbell_ptr);
@@ -300,6 +308,13 @@ struct kernel_queue *kernel_queue_init(struct kfd_dev *dev,
kq->ops.sync_with_hw = sync_with_hw;
kq->ops.rollback_packet = rollback_packet;

+   switch (dev->device_info->asic_family) {
+   case CHIP_CARRIZO:
+   kernel_queue_init_vi(>ops_asic_specific);
+   case CHIP_KAVERI:
+   kernel_queue_init_cik(>ops_asic_specific);
+   }
+
if (kq->ops.initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE) == false) {
pr_err("kfd: failed to init kernel queue\n");
kfree(kq);
@@ -324,7 

[PATCH 3/4] drm/amdkfd: Encapsulate KQ functions in ops structure

2015-01-13 Thread Oded Gabbay
This patch does some re-org on the kernel_queue structure. It takes out
all the function pointers from the structure and puts them in a new structure,
called kernel_queue_ops. Then, it puts an instance of that structure
inside kernel_queue.

This re-org is done to prepare the KQ module to support more than one AMD APU
(Kaveri).

Signed-off-by: Oded Gabbay 
---
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c   | 24 +--
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.h   | 31 +++--
 drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 26 ++---
 3 files changed, 54 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
index add0fb4..731635d 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
@@ -293,14 +293,14 @@ struct kernel_queue *kernel_queue_init(struct kfd_dev 
*dev,
if (!kq)
return NULL;

-   kq->initialize = initialize;
-   kq->uninitialize = uninitialize;
-   kq->acquire_packet_buffer = acquire_packet_buffer;
-   kq->submit_packet = submit_packet;
-   kq->sync_with_hw = sync_with_hw;
-   kq->rollback_packet = rollback_packet;
-
-   if (kq->initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE) == false) {
+   kq->ops.initialize = initialize;
+   kq->ops.uninitialize = uninitialize;
+   kq->ops.acquire_packet_buffer = acquire_packet_buffer;
+   kq->ops.submit_packet = submit_packet;
+   kq->ops.sync_with_hw = sync_with_hw;
+   kq->ops.rollback_packet = rollback_packet;
+
+   if (kq->ops.initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE) == false) {
pr_err("kfd: failed to init kernel queue\n");
kfree(kq);
return NULL;
@@ -312,7 +312,7 @@ void kernel_queue_uninit(struct kernel_queue *kq)
 {
BUG_ON(!kq);

-   kq->uninitialize(kq);
+   kq->ops.uninitialize(kq);
kfree(kq);
 }

@@ -329,12 +329,12 @@ static __attribute__((unused)) void test_kq(struct 
kfd_dev *dev)
kq = kernel_queue_init(dev, KFD_QUEUE_TYPE_HIQ);
BUG_ON(!kq);

-   retval = kq->acquire_packet_buffer(kq, 5, );
+   retval = kq->ops.acquire_packet_buffer(kq, 5, );
BUG_ON(retval != 0);
for (i = 0; i < 5; i++)
buffer[i] = kq->nop_packet;
-   kq->submit_packet(kq);
-   kq->sync_with_hw(kq, 1000);
+   kq->ops.submit_packet(kq);
+   kq->ops.sync_with_hw(kq, 1000);

pr_debug("kfd: ending kernel queue test\n");
 }
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.h 
b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.h
index dcd2bdb..e01b77b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.h
@@ -28,8 +28,31 @@
 #include 
 #include "kfd_priv.h"

-struct kernel_queue {
-   /* interface */
+/**
+ * struct kernel_queue_ops
+ *
+ * @initialize: Initialize a kernel queue, including allocations of GART memory
+ * needed for the queue.
+ *
+ * @uninitialize: Uninitialize a kernel queue and free all its memory usages.
+ *
+ * @acquire_packet_buffer: Returns a pointer to the location in the kernel
+ * queue ring buffer where the calling function can write its packet. It is
+ * Guaranteed that there is enough space for that packet. It also updates the
+ * pending write pointer to that location so subsequent calls to
+ * acquire_packet_buffer will get a correct write pointer
+ *
+ * @submit_packet: Update the write pointer and doorbell of a kernel queue.
+ *
+ * @sync_with_hw: Wait until the write pointer and the read pointer of a kernel
+ * queue are equal, which means the CP has read all the submitted packets.
+ *
+ * @rollback_packet: This routine is called if we failed to build an acquired
+ * packet for some reason. It just overwrites the pending wptr with the current
+ * one
+ *
+ */
+struct kernel_queue_ops {
bool(*initialize)(struct kernel_queue *kq, struct kfd_dev *dev,
enum kfd_queue_type type, unsigned int queue_size);
void(*uninitialize)(struct kernel_queue *kq);
@@ -41,6 +64,10 @@ struct kernel_queue {
int (*sync_with_hw)(struct kernel_queue *kq,
unsigned long timeout_ms);
void(*rollback_packet)(struct kernel_queue *kq);
+};
+
+struct kernel_queue {
+   struct kernel_queue_ops ops;

/* data */
struct kfd_dev  *dev;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
index 3cda952..5fb5c03 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
@@ -348,7 +348,7 @@ int pm_send_set_resources(struct packet_manager *pm,
pr_debug("kfd: In func %s\n", __func__);

mutex_lock(>lock);
-   

[PATCH 2/4] drm/amdkfd: Add initial VI support for DQM

2015-01-13 Thread Oded Gabbay
From: Ben Goz 

This patch starts to add support for the VI APU in the DQM module.

Because most (more than 90%) of the DQM code is shared among AMD's APUs, we
chose a design that performs most/all the code in the shared DQM file
(kfd_device_queue_manager.c). If there is H/W specific code to be executed,
than it is written in an asic-specific extension function for that H/W.

That asic-specific extension function is called from the shared function at the
appropriate time. This requires that for every asic-specific extension function
that is implemented in a specific ASIC, there will be an equivalent
implementation in ALL ASICs, even if those implementations are just stubs.

That way we achieve:

- Maintainability: by having one copy of most of the code, we only need to
  fix bugs at one locations

- Readability: very clear what is the shared code and what is done per ASIC

- Extensibility: very easy to add new H/W specific files/functions

Signed-off-by: Ben Goz 
Signed-off-by: Oded Gabbay 
---
 drivers/gpu/drm/amd/amdkfd/Makefile|   1 +
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 113 +
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  11 +-
 .../drm/amd/amdkfd/kfd_device_queue_manager_cik.c  | 135 +
 .../drm/amd/amdkfd/kfd_device_queue_manager_vi.c   |  64 ++
 5 files changed, 238 insertions(+), 86 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
 create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c

diff --git a/drivers/gpu/drm/amd/amdkfd/Makefile 
b/drivers/gpu/drm/amd/amdkfd/Makefile
index bc6053f..7558683 100644
--- a/drivers/gpu/drm/amd/amdkfd/Makefile
+++ b/drivers/gpu/drm/amd/amdkfd/Makefile
@@ -10,6 +10,7 @@ amdkfd-y  := kfd_module.o kfd_device.o kfd_chardev.o 
kfd_topology.o \
kfd_mqd_manager_cik.o kfd_mqd_manager_vi.o \
kfd_kernel_queue.o kfd_packet_manager.o \
kfd_process_queue_manager.o kfd_device_queue_manager.o \
+   kfd_device_queue_manager_cik.o kfd_device_queue_manager_vi.o \
kfd_interrupt.o

 obj-$(CONFIG_HSA_AMD)  += amdkfd.o
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 12c8448..b201624 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -61,7 +61,7 @@ enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum 
kfd_queue_type type)
return KFD_MQD_TYPE_CP;
 }

-static inline unsigned int get_pipes_num(struct device_queue_manager *dqm)
+inline unsigned int get_pipes_num(struct device_queue_manager *dqm)
 {
BUG_ON(!dqm || !dqm->dev);
return dqm->dev->shared_resources.compute_pipe_count;
@@ -78,7 +78,7 @@ static inline unsigned int get_pipes_num_cpsch(void)
return PIPE_PER_ME_CP_SCHEDULING;
 }

-static inline unsigned int
+inline unsigned int
 get_sh_mem_bases_nybble_64(struct kfd_process_device *pdd)
 {
uint32_t nybble;
@@ -88,7 +88,7 @@ get_sh_mem_bases_nybble_64(struct kfd_process_device *pdd)
return nybble;
 }

-static inline unsigned int get_sh_mem_bases_32(struct kfd_process_device *pdd)
+inline unsigned int get_sh_mem_bases_32(struct kfd_process_device *pdd)
 {
unsigned int shared_base;

@@ -97,41 +97,7 @@ static inline unsigned int get_sh_mem_bases_32(struct 
kfd_process_device *pdd)
return shared_base;
 }

-static uint32_t compute_sh_mem_bases_64bit(unsigned int top_address_nybble);
-static void init_process_memory(struct device_queue_manager *dqm,
-   struct qcm_process_device *qpd)
-{
-   struct kfd_process_device *pdd;
-   unsigned int temp;
-
-   BUG_ON(!dqm || !qpd);
-
-   pdd = qpd_to_pdd(qpd);
-
-   /* check if sh_mem_config register already configured */
-   if (qpd->sh_mem_config == 0) {
-   qpd->sh_mem_config =
-   ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED) |
-   DEFAULT_MTYPE(MTYPE_NONCACHED) |
-   APE1_MTYPE(MTYPE_NONCACHED);
-   qpd->sh_mem_ape1_limit = 0;
-   qpd->sh_mem_ape1_base = 0;
-   }
-
-   if (qpd->pqm->process->is_32bit_user_mode) {
-   temp = get_sh_mem_bases_32(pdd);
-   qpd->sh_mem_bases = SHARED_BASE(temp);
-   qpd->sh_mem_config |= PTR32;
-   } else {
-   temp = get_sh_mem_bases_nybble_64(pdd);
-   qpd->sh_mem_bases = compute_sh_mem_bases_64bit(temp);
-   }
-
-   pr_debug("kfd: is32bit process: %d sh_mem_bases nybble: 0x%X and 
register 0x%X\n",
-   qpd->pqm->process->is_32bit_user_mode, temp, qpd->sh_mem_bases);
-}
-
-static void program_sh_mem_settings(struct device_queue_manager *dqm,
+void program_sh_mem_settings(struct device_queue_manager *dqm,
   

[PATCH 1/4] drm/amdkfd: Encapsulate DQM functions in ops structure

2015-01-13 Thread Oded Gabbay
This patch does some re-org on the device_queue_manager structure. It takes out
all the function pointers from the structure and puts them in a new structure,
called device_queue_manager_ops. Then, it puts an instance of that structure
inside device_queue_manager.

This re-org is done to prepare the DQM module to support more than one AMD APU
(Kaveri).

Signed-off-by: Oded Gabbay 
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c   |  2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_device.c|  6 +-
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 68 +++---
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  | 25 +---
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c  |  2 +-
 .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 16 ++---
 6 files changed, 65 insertions(+), 54 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index b008fd6..38b6150 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -439,7 +439,7 @@ static long kfd_ioctl_set_memory_policy(struct file *filep,
(args.alternate_policy == KFD_IOC_CACHE_POLICY_COHERENT)
   ? cache_policy_coherent : cache_policy_noncoherent;

-   if (!dev->dqm->set_cache_memory_policy(dev->dqm,
+   if (!dev->dqm->ops.set_cache_memory_policy(dev->dqm,
>qpd,
default_policy,
alternate_policy,
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index a23ed24..a770ec6 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -253,7 +253,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
goto device_queue_manager_error;
}

-   if (kfd->dqm->start(kfd->dqm) != 0) {
+   if (kfd->dqm->ops.start(kfd->dqm) != 0) {
dev_err(kfd_device,
"Error starting queuen manager for device (%x:%x)\n",
kfd->pdev->vendor, kfd->pdev->device);
@@ -307,7 +307,7 @@ void kgd2kfd_suspend(struct kfd_dev *kfd)
BUG_ON(kfd == NULL);

if (kfd->init_complete) {
-   kfd->dqm->stop(kfd->dqm);
+   kfd->dqm->ops.stop(kfd->dqm);
amd_iommu_set_invalidate_ctx_cb(kfd->pdev, NULL);
amd_iommu_free_device(kfd->pdev);
}
@@ -328,7 +328,7 @@ int kgd2kfd_resume(struct kfd_dev *kfd)
return -ENXIO;
amd_iommu_set_invalidate_ctx_cb(kfd->pdev,
iommu_pasid_shutdown_callback);
-   kfd->dqm->start(kfd->dqm);
+   kfd->dqm->ops.start(kfd->dqm);
}

return 0;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index c83f011..12c8448 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -271,7 +271,7 @@ static int create_compute_queue_nocpsch(struct 
device_queue_manager *dqm,

BUG_ON(!dqm || !q || !qpd);

-   mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_COMPUTE);
+   mqd = dqm->ops.get_mqd_manager(dqm, KFD_MQD_TYPE_COMPUTE);
if (mqd == NULL)
return -ENOMEM;

@@ -305,14 +305,14 @@ static int destroy_queue_nocpsch(struct 
device_queue_manager *dqm,
mutex_lock(>lock);

if (q->properties.type == KFD_QUEUE_TYPE_COMPUTE) {
-   mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_COMPUTE);
+   mqd = dqm->ops.get_mqd_manager(dqm, KFD_MQD_TYPE_COMPUTE);
if (mqd == NULL) {
retval = -ENOMEM;
goto out;
}
deallocate_hqd(dqm, q);
} else if (q->properties.type == KFD_QUEUE_TYPE_SDMA) {
-   mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_SDMA);
+   mqd = dqm->ops.get_mqd_manager(dqm, KFD_MQD_TYPE_SDMA);
if (mqd == NULL) {
retval = -ENOMEM;
goto out;
@@ -348,7 +348,7 @@ static int update_queue(struct device_queue_manager *dqm, 
struct queue *q)
BUG_ON(!dqm || !q || !q->mqd);

mutex_lock(>lock);
-   mqd = dqm->get_mqd_manager(dqm, q->properties.type);
+   mqd = dqm->ops.get_mqd_manager(dqm, q->properties.type);
if (mqd == NULL) {
mutex_unlock(>lock);
return -ENOMEM;
@@ -515,7 +515,7 @@ static int init_pipelines(struct device_queue_manager *dqm,

memset(hpdptr, 0, CIK_HPD_EOP_BYTES * pipes_num);

-   mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_COMPUTE);
+   mqd = dqm->ops.get_mqd_manager(dqm, KFD_MQD_TYPE_COMPUTE);
if (mqd == NULL) {
kfd_gtt_sa_free(dqm->dev, dqm->pipeline_mem);
   

[PATCH 0/4] drm/amdkfd: more preparation for VI APU

2015-01-13 Thread Oded Gabbay
This patch-set continues to prepare amdkfd so it could support VI APU. it 
prepares DQM and KQ modules to support more than one ASIC.

Note: there is no change in the IOCTLs.

Oded

Ben Goz (2):
  drm/amdkfd: Add initial VI support for DQM
  drm/amdkfd: Add initial VI support for KQ

Oded Gabbay (2):
  drm/amdkfd: Encapsulate DQM functions in ops structure
  drm/amdkfd: Encapsulate KQ functions in ops structure

 drivers/gpu/drm/amd/amdkfd/Makefile|   4 +-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c   |   2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_device.c|   6 +-
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 181 +++--
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  36 +++-
 .../drm/amd/amdkfd/kfd_device_queue_manager_cik.c  | 135 +++
 .../drm/amd/amdkfd/kfd_device_queue_manager_vi.c   |  64 
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c  |  45 +++--
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.h  |  38 -
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_cik.c  |  44 +
 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c   |  56 +++
 drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c|  26 +--
 .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c |  16 +-
 13 files changed, 483 insertions(+), 170 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
 create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
 create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_cik.c
 create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c

-- 
1.9.1



FOSDEM15: Graphics DevRoom: call for speakers.

2015-01-13 Thread Thierry Reding
On Tue, Dec 09, 2014 at 03:39:26PM +0100, Luc Verhaegen wrote:
> On Thu, Oct 02, 2014 at 07:44:57PM +0200, Luc Verhaegen wrote:
> > Hi,
> > 
> > At FOSDEM on the 31st of january and the 1st of February 2015, there 
> > will be another graphics DevRoom. URL: https://fosdem.org/2015/
> 
> > Slots will be handed out on a first come, first serve basis. The best 
> > slots will go to those who apply the earliest. The amount of slots is 
> > currently not known yet, but i expect there to be around 16 available (8 
> > on each day), so act quickly.
> 
> > As for deadlines, i hope to have a pretty much complete schedule between 
> > christmas and the new year. The rockhard printed schedule deadline is 
> > probably January 9th, after that you will not be featured in the booklet 
> > and you will have a lot less visitors. I will hopefully be able to lock 
> > down entries and descriptions after that date.
> 
> It's been more than 2 months since the original email, it's less than 
> two months away from the event, and one month away from what usually is 
> the deadline for the booklet. File your talk now, while there are still 
> some useful slots available.
> 
> Also, for those who have filed already but who have left their abstracts 
> open, please get those filed in ASAP. Your talk will be only be ordered 
> in when at least the basics are provided.

Hi Luc,

I realize I'm terribly late, but it took quite some time to get travel
arranged. Looking at the schedule there still seem to be some free
slots. Does it make sense to still submit a talk? I was asked to give
one on atomic modesetting from a driver developer's perspective.

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


[PATCH v7 1/3] of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint

2015-01-13 Thread Tomi Valkeinen
On 23/12/14 15:09, Philipp Zabel wrote:
> Decrementing the reference count of the previous endpoint node allows to
> use the of_graph_get_next_endpoint function in a for_each_... style macro.
> All current users of this function that pass a non-NULL prev parameter
> (coresight, rcar-du, imx-drm, soc_camera, and omap2-dss) are changed to
> not decrement the passed prev argument's refcount themselves.
> 
> Signed-off-by: Philipp Zabel 
> Acked-by: Mauro Carvalho Chehab 
> Acked-by: Mathieu Poirier 
> ---
> Changes since v6:
>  - Added omap2-dss.
>  - Added Mathieu's ack.
> ---
>  drivers/coresight/of_coresight.c  | 13 ++---
>  drivers/gpu/drm/imx/imx-drm-core.c| 13 ++---
>  drivers/gpu/drm/rcar-du/rcar_du_kms.c | 15 ---
>  drivers/media/platform/soc_camera/soc_camera.c|  3 ++-
>  drivers/of/base.c |  9 +
>  drivers/video/fbdev/omap2/dss/omapdss-boot-init.c |  7 +--
>  6 files changed, 12 insertions(+), 48 deletions(-)
> 

For omapdss:

Acked-by: Tomi Valkeinen 

 Tomi


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


[PATCH 24/24] drm/radeon: whitespace clean up in radeon_audio.c

2015-01-13 Thread Alex Deucher
Clean up some formatting in radeon_audio.c to be
more consistent with the rest of the driver.

Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/radeon_audio.c | 70 +--
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index b77a8d6..e4aa282 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -366,36 +366,36 @@ static void radeon_audio_write_sad_regs(struct 
drm_encoder *encoder)
 static void radeon_audio_write_speaker_allocation(struct drm_encoder *encoder)
 {
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-struct drm_connector *connector;
-struct radeon_connector *radeon_connector = NULL;
-u8 *sadb = NULL;
-int sad_count;
+   struct drm_connector *connector;
+   struct radeon_connector *radeon_connector = NULL;
+   u8 *sadb = NULL;
+   int sad_count;

-list_for_each_entry(connector,
-   >dev->mode_config.connector_list, head) {
-if (connector->encoder == encoder) {
-radeon_connector = to_radeon_connector(connector);
-break;
-}
-}
-
-if (!radeon_connector) {
-DRM_ERROR("Couldn't find encoder's connector\n");
-return;
-}
-
-sad_count = drm_edid_to_speaker_allocation(
+   list_for_each_entry(connector,
+   >dev->mode_config.connector_list, head) {
+   if (connector->encoder == encoder) {
+   radeon_connector = to_radeon_connector(connector);
+   break;
+   }
+   }
+
+   if (!radeon_connector) {
+   DRM_ERROR("Couldn't find encoder's connector\n");
+   return;
+   }
+
+   sad_count = drm_edid_to_speaker_allocation(
radeon_connector_edid(connector), );
-if (sad_count < 0) {
-DRM_DEBUG("Couldn't read Speaker Allocation Data Block: %d\n",
-   sad_count);
-sad_count = 0;
-}
+   if (sad_count < 0) {
+   DRM_DEBUG("Couldn't read Speaker Allocation Data Block: %d\n",
+ sad_count);
+   sad_count = 0;
+   }

if (radeon_encoder->audio && 
radeon_encoder->audio->write_speaker_allocation)
radeon_encoder->audio->write_speaker_allocation(encoder, sadb, 
sad_count);

-kfree(sadb);
+   kfree(sadb);
 }

 static void radeon_audio_write_latency_fields(struct drm_encoder *encoder,
@@ -519,7 +519,7 @@ static void radeon_audio_set_dto(struct drm_encoder 
*encoder, unsigned int clock
 static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,
struct drm_display_mode *mode)
 {
-struct radeon_device *rdev = encoder->dev->dev_private;
+   struct radeon_device *rdev = encoder->dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
@@ -624,9 +624,9 @@ static const struct radeon_hdmi_acr* 
radeon_audio_acr(unsigned int clock)
  */
 static void radeon_audio_update_acr(struct drm_encoder *encoder, unsigned int 
clock)
 {
-const struct radeon_hdmi_acr *acr = radeon_audio_acr(clock);
-struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
+   const struct radeon_hdmi_acr *acr = radeon_audio_acr(clock);
+   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;

if (!dig || !dig->afmt)
return;
@@ -637,8 +637,8 @@ static void radeon_audio_update_acr(struct drm_encoder 
*encoder, unsigned int cl

 static void radeon_audio_set_vbi_packet(struct drm_encoder *encoder)
 {
-struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
+   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;

if (!dig || !dig->afmt)
return;
@@ -667,8 +667,8 @@ static void radeon_hdmi_set_color_depth(struct drm_encoder 
*encoder)

 static void radeon_audio_set_audio_packet(struct drm_encoder *encoder)
 {
-struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
+   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;

if (!dig || !dig->afmt)
return;
@@ -679,8 +679,8 @@ static void radeon_audio_set_audio_packet(struct 
drm_encoder *encoder)

 static void 

[PATCH 23/24] radeon/audio: enable DP audio

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/atombios_encoders.c |  6 
 drivers/gpu/drm/radeon/dce6_afmt.c | 35 +++
 drivers/gpu/drm/radeon/evergreen_hdmi.c| 54 ++
 drivers/gpu/drm/radeon/evergreen_reg.h | 15 +
 drivers/gpu/drm/radeon/radeon_audio.c  | 37 
 5 files changed, 147 insertions(+)

diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
b/drivers/gpu/drm/radeon/atombios_encoders.c
index 8ca8b4f..7c9df1e 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -665,6 +665,8 @@ atombios_digital_setup(struct drm_encoder *encoder, int 
action)
 int
 atombios_get_encoder_mode(struct drm_encoder *encoder)
 {
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct drm_connector *connector;
struct radeon_connector *radeon_connector;
@@ -729,6 +731,8 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
dig_connector = radeon_connector->con_priv;
if ((dig_connector->dp_sink_type == 
CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
(dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) {
+   if (radeon_audio != 0 && ASIC_IS_DCE4(rdev) && 
!ASIC_IS_DCE5(rdev))
+   return ATOM_ENCODER_MODE_DP_AUDIO;
return ATOM_ENCODER_MODE_DP;
} else if (radeon_audio != 0) {
if (radeon_connector->audio == RADEON_AUDIO_ENABLE)
@@ -743,6 +747,8 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
}
break;
case DRM_MODE_CONNECTOR_eDP:
+   if (radeon_audio != 0 && ASIC_IS_DCE4(rdev) && 
!ASIC_IS_DCE5(rdev))
+   return ATOM_ENCODER_MODE_DP_AUDIO;
return ATOM_ENCODER_MODE_DP;
case DRM_MODE_CONNECTOR_DVIA:
case DRM_MODE_CONNECTOR_VGA:
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index 1c87006..192c803 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -287,3 +287,38 @@ void dce6_dp_audio_set_dto(struct radeon_device *rdev,
 WREG32(DCCG_AUDIO_DTO1_PHASE, 24000);
 WREG32(DCCG_AUDIO_DTO1_MODULE, clock);
 }
+
+void dce6_enable_dp_audio_packets(struct drm_encoder *encoder, bool enable)
+{
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
+   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
+   uint32_t offset;
+
+   if (!dig || !dig->afmt)
+   return;
+
+   offset = dig->afmt->offset;
+
+   if (enable) {
+if (dig->afmt->enabled)
+return;
+
+   WREG32(EVERGREEN_DP_SEC_TIMESTAMP + offset, 
EVERGREEN_DP_SEC_TIMESTAMP_MODE(1));
+   WREG32(EVERGREEN_DP_SEC_CNTL + offset,
+   EVERGREEN_DP_SEC_ASP_ENABLE |   /* Audio packet 
transmission */
+   EVERGREEN_DP_SEC_ATP_ENABLE |   /* Audio 
timestamp packet transmission */
+   EVERGREEN_DP_SEC_AIP_ENABLE |   /* Audio 
infoframe packet transmission */
+   EVERGREEN_DP_SEC_STREAM_ENABLE);/* Master 
enable for secondary stream engine */
+   radeon_audio_enable(rdev, dig->afmt->pin, true);
+   } else {
+   if (!dig->afmt->enabled)
+   return;
+
+   WREG32(EVERGREEN_DP_SEC_CNTL + offset, 0);
+   radeon_audio_enable(rdev, dig->afmt->pin, false);
+   }
+
+   dig->afmt->enabled = enable;
+}
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 0d8c85f..f0c59ab 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -424,3 +424,57 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, 
bool enable)
DRM_DEBUG("%sabling HDMI interface @ 0x%04X for encoder 0x%x\n",
  enable ? "En" : "Dis", dig->afmt->offset, 
radeon_encoder->encoder_id);
 }
+
+void evergreen_enable_dp_audio_packets(struct drm_encoder *encoder, bool 
enable)
+{
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
+   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
+   uint32_t offset;
+
+   if (!dig || !dig->afmt)
+   return;
+
+   offset = dig->afmt->offset;
+
+   if (enable) {
+   struct drm_connector 

[PATCH 22/24] radeon/audio: moved audio caps programming to audio_hotplug() function

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/radeon_audio.c | 78 +++
 1 file changed, 43 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index 6c4631b..fc7a975 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -301,38 +301,6 @@ int radeon_audio_init(struct radeon_device *rdev)
return 0;
 }

-void radeon_audio_detect(struct drm_connector *connector,
-   enum drm_connector_status status)
-{
-   if (!connector || !connector->encoder)
-   return;
-
-   if (status == connector_status_connected) {
-   int sink_type;
-   struct radeon_device *rdev = 
connector->encoder->dev->dev_private;
-   struct radeon_connector *radeon_connector;
-   struct radeon_encoder *radeon_encoder =
-   to_radeon_encoder(connector->encoder);
-
-   if 
(!drm_detect_monitor_audio(radeon_connector_edid(connector))) {
-   radeon_encoder->audio = 0;
-   return;
-   }
-
-   radeon_connector = to_radeon_connector(connector);
-   sink_type = radeon_dp_getsinktype(radeon_connector);
-
-   if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort 
&&
-   sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT)
-   radeon_encoder->audio = rdev->audio.dp_funcs;
-   else
-   radeon_encoder->audio = rdev->audio.hdmi_funcs;
-   /* TODO: set up the sads, etc. and set the audio enable_mask */
-   } else {
-   /* TODO: reset the audio enable_mask */
-   }
-}
-
 u32 radeon_audio_endpoint_rreg(struct radeon_device *rdev, u32 offset, u32 reg)
 {
if (rdev->audio.funcs->endpoint_rreg)
@@ -471,6 +439,49 @@ void radeon_audio_enable(struct radeon_device *rdev,
rdev->audio.funcs->enable(rdev, pin, enable_mask);
 }

+void radeon_audio_detect(struct drm_connector *connector,
+   enum drm_connector_status status)
+{
+   struct radeon_device *rdev;
+   struct radeon_encoder *radeon_encoder;
+   struct radeon_encoder_atom_dig *dig;
+
+   if (!connector || !connector->encoder)
+   return;
+
+   rdev = connector->encoder->dev->dev_private;
+   radeon_encoder = to_radeon_encoder(connector->encoder);
+   dig = radeon_encoder->enc_priv;
+
+   if (status == connector_status_connected) {
+   struct radeon_connector *radeon_connector;
+   int sink_type;
+
+   if 
(!drm_detect_monitor_audio(radeon_connector_edid(connector))) {
+   radeon_encoder->audio = 0;
+   return;
+   }
+
+   radeon_connector = to_radeon_connector(connector);
+   sink_type = radeon_dp_getsinktype(radeon_connector);
+
+   if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort 
&&
+   sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT)
+   radeon_encoder->audio = rdev->audio.dp_funcs;
+   else
+   radeon_encoder->audio = rdev->audio.hdmi_funcs;
+
+   radeon_audio_write_speaker_allocation(connector->encoder);
+   radeon_audio_write_sad_regs(connector->encoder);
+   if (connector->encoder->crtc)
+   radeon_audio_write_latency_fields(connector->encoder,
+   >encoder->crtc->mode);
+   radeon_audio_enable(rdev, dig->afmt->pin, 0xf);
+   } else {
+   radeon_audio_enable(rdev, dig->afmt->pin, 0);
+   }
+}
+
 void radeon_audio_fini(struct radeon_device *rdev)
 {
int i;
@@ -689,11 +700,8 @@ static void radeon_audio_hdmi_mode_set(struct drm_encoder 
*encoder,
radeon_hdmi_set_color_depth(encoder);
radeon_audio_set_mute(encoder, false);
radeon_audio_update_acr(encoder, mode->clock);
-   radeon_audio_write_speaker_allocation(encoder);
radeon_audio_set_audio_packet(encoder);
radeon_audio_select_pin(encoder);
-   radeon_audio_write_sad_regs(encoder);
-   radeon_audio_write_latency_fields(encoder, mode);

if (radeon_audio_set_avi_packet(encoder, mode) < 0)
return;
-- 
1.8.3.1



[PATCH 21/24] radeon/audio: applied audio_dpms() and audio_mode_set() calls

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/atombios_encoders.c | 21 +++--
 drivers/gpu/drm/radeon/radeon_asic.c   | 14 --
 drivers/gpu/drm/radeon/radeon_asic.h   |  2 --
 drivers/gpu/drm/radeon/radeon_audio.c  | 14 ++
 drivers/gpu/drm/radeon/radeon_audio.h  |  2 ++
 5 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
b/drivers/gpu/drm/radeon/atombios_encoders.c
index 9354c99..8ca8b4f 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -1616,6 +1616,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, 
int mode)
struct radeon_connector *radeon_connector = NULL;
struct radeon_connector_atom_dig *radeon_dig_connector = NULL;
bool travis_quirk = false;
+   int encoder_mode;

if (connector) {
radeon_connector = to_radeon_connector(connector);
@@ -1711,6 +1712,11 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder 
*encoder, int mode)
}
break;
}
+
+   encoder_mode = atombios_get_encoder_mode(encoder);
+   if (radeon_audio != 0 &&
+   (encoder_mode == ATOM_ENCODER_MODE_HDMI || 
ENCODER_MODE_IS_DP(encoder_mode)))
+   radeon_audio_dpms(encoder, mode);
 }

 static void
@@ -2124,6 +2130,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+   int encoder_mode;

radeon_encoder->pixel_clock = adjusted_mode->clock;

@@ -2150,6 +2157,10 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY3:
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA:
/* handled in dpms */
+   encoder_mode = atombios_get_encoder_mode(encoder);
+   if (radeon_audio != 0 &&
+   (encoder_mode == ATOM_ENCODER_MODE_HDMI || 
ENCODER_MODE_IS_DP(encoder_mode)))
+   radeon_audio_mode_set(encoder, adjusted_mode);
break;
case ENCODER_OBJECT_ID_INTERNAL_DDI:
case ENCODER_OBJECT_ID_INTERNAL_DVO1:
@@ -2171,12 +2182,6 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
}

atombios_apply_encoder_quirks(encoder, adjusted_mode);
-
-   if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI) {
-   if (rdev->asic->display.hdmi_enable)
-   radeon_hdmi_enable(rdev, encoder, true);
-   radeon_audio_mode_set(encoder, adjusted_mode);
-   }
 }

 static bool
@@ -2442,10 +2447,6 @@ static void radeon_atom_encoder_disable(struct 
drm_encoder *encoder)

 disable_done:
if (radeon_encoder_is_digital(encoder)) {
-   if (atombios_get_encoder_mode(encoder) == 
ATOM_ENCODER_MODE_HDMI) {
-   if (rdev->asic->display.hdmi_enable)
-   radeon_hdmi_enable(rdev, encoder, false);
-   }
dig = radeon_encoder->enc_priv;
dig->dig_encoder = -1;
}
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c 
b/drivers/gpu/drm/radeon/radeon_asic.c
index fc8da28..6e47662 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -624,7 +624,6 @@ static struct radeon_asic rs600_asic = {
.wait_for_vblank = _wait_for_vblank,
.set_backlight_level = _set_backlight_level,
.get_backlight_level = _get_backlight_level,
-   .hdmi_enable = _hdmi_enable,
},
.copy = {
.blit = _copy_blit,
@@ -691,7 +690,6 @@ static struct radeon_asic rs690_asic = {
.wait_for_vblank = _wait_for_vblank,
.set_backlight_level = _set_backlight_level,
.get_backlight_level = _get_backlight_level,
-   .hdmi_enable = _hdmi_enable,
},
.copy = {
.blit = _copy_blit,
@@ -919,7 +917,6 @@ static struct radeon_asic r600_asic = {
.wait_for_vblank = _wait_for_vblank,
.set_backlight_level = _set_backlight_level,
.get_backlight_level = _get_backlight_level,
-   .hdmi_enable = _hdmi_enable,
},
.copy = {
.blit = _copy_cpdma,
@@ -1004,7 +1001,6 @@ static struct radeon_asic rv6xx_asic = {
.wait_for_vblank = _wait_for_vblank,
.set_backlight_level = _set_backlight_level,
.get_backlight_level = _get_backlight_level,
-   .hdmi_enable = _hdmi_enable,
},
.copy = {
.blit = _copy_cpdma,
@@ -1094,7 +1090,6 @@ static struct 

[PATCH 19/24] radeon/audio: removed unnecessary debug settings

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c| 6 --
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 6 --
 drivers/gpu/drm/radeon/r600_hdmi.c  | 6 --
 3 files changed, 18 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index b46473a..3bc95b4 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -266,12 +266,6 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
if (radeon_audio_set_avi_packet(encoder, mode) < 0)
return;

-   /* it's unknown what these bits do excatly, but it's indeed quite 
useful for debugging */
-   WREG32(HDMI0_RAMP_CONTROL0 + offset, 0x00FF);
-   WREG32(HDMI0_RAMP_CONTROL1 + offset, 0x007F);
-   WREG32(HDMI0_RAMP_CONTROL2 + offset, 0x0001);
-   WREG32(HDMI0_RAMP_CONTROL3 + offset, 0x0001);
-
r600_hdmi_audio_workaround(encoder);

/* enable audio after to setting up hw */
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 9f35bd0..5090819 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -435,12 +435,6 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode
if (radeon_audio_set_avi_packet(encoder, mode) < 0)
return;

-   /* it's unknown what these bits do excatly, but it's indeed quite 
useful for debugging */
-   WREG32(AFMT_RAMP_CONTROL0 + offset, 0x00FF);
-   WREG32(AFMT_RAMP_CONTROL1 + offset, 0x007F);
-   WREG32(AFMT_RAMP_CONTROL2 + offset, 0x0001);
-   WREG32(AFMT_RAMP_CONTROL3 + offset, 0x0001);
-
/* enable audio after to setting up hw */
radeon_audio_enable(rdev, dig->afmt->pin, 0xf);
 }
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
b/drivers/gpu/drm/radeon/r600_hdmi.c
index a4c2ce9..ea1950b 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -433,12 +433,6 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mod
if (radeon_audio_set_avi_packet(encoder, mode) < 0)
return;

-   /* it's unknown what these bits do excatly, but it's indeed quite 
useful for debugging */
-   WREG32(HDMI0_RAMP_CONTROL0 + offset, 0x00FF);
-   WREG32(HDMI0_RAMP_CONTROL1 + offset, 0x007F);
-   WREG32(HDMI0_RAMP_CONTROL2 + offset, 0x0001);
-   WREG32(HDMI0_RAMP_CONTROL3 + offset, 0x0001);
-
/* enable audio after to setting up hw */
radeon_audio_enable(rdev, dig->afmt->pin, 0xf);
 }
-- 
1.8.3.1



[PATCH 18/24] radeon/audio: moved mute programming to a separate function

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c| 15 ---
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 17 +
 drivers/gpu/drm/radeon/r600_hdmi.c  | 16 
 drivers/gpu/drm/radeon/radeon_audio.c   | 19 +++
 drivers/gpu/drm/radeon/radeon_audio.h   |  2 ++
 5 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index fa0e011..b46473a 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -220,6 +220,17 @@ void dce3_2_set_audio_packet(struct drm_encoder *encoder, 
u32 offset)
HDMI0_AUDIO_INFO_LINE(2));  /* anything 
other than 0 */
 }

+void dce3_2_set_mute(struct drm_encoder *encoder, u32 offset, bool mute)
+{
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
+
+   if (mute)
+   WREG32_OR(HDMI0_GC + offset, HDMI0_GC_AVMUTE);
+   else
+   WREG32_AND(HDMI0_GC + offset, ~HDMI0_GC_AVMUTE);
+}
+
 /*
  * update the info frames with the data from the current display mode
  */
@@ -246,9 +257,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
radeon_audio_set_dto(encoder, mode->clock);
radeon_audio_set_vbi_packet(encoder);
radeon_hdmi_set_color_depth(encoder);
-
-   WREG32(HDMI0_GC + offset, 0); /* unset HDMI0_GC_AVMUTE */
-
+   radeon_audio_set_mute(encoder, false);
radeon_audio_update_acr(encoder, mode->clock);
radeon_audio_write_speaker_allocation(encoder);
radeon_audio_set_audio_packet(encoder);
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 7c7644c..9f35bd0 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -386,6 +386,18 @@ void dce4_set_audio_packet(struct drm_encoder *encoder, 
u32 offset)
AFMT_AUDIO_SAMPLE_SEND | AFMT_RESET_FIFO_WHEN_AUDIO_DIS | 
AFMT_60958_CS_UPDATE);
 }

+
+void dce4_set_mute(struct drm_encoder *encoder, u32 offset, bool mute)
+{
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
+
+   if (mute)
+   WREG32_OR(HDMI_GC + offset, HDMI_GC_AVMUTE);
+   else
+   WREG32_AND(HDMI_GC + offset, ~HDMI_GC_AVMUTE);
+}
+
 /*
  * update the info frames with the data from the current display mode
  */
@@ -412,13 +424,10 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode
radeon_audio_set_dto(encoder, mode->clock);
radeon_audio_set_vbi_packet(encoder);
radeon_hdmi_set_color_depth(encoder);
-
-   WREG32(HDMI_GC + offset, 0); /* unset HDMI_GC_AVMUTE */
-
+   radeon_audio_set_mute(encoder, false);
radeon_audio_update_acr(encoder, mode->clock);
radeon_audio_write_speaker_allocation(encoder);
radeon_audio_set_audio_packet(encoder);
-
radeon_audio_select_pin(encoder);
radeon_audio_write_sad_regs(encoder);
radeon_audio_write_latency_fields(encoder, mode);
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
b/drivers/gpu/drm/radeon/r600_hdmi.c
index b433823..a4c2ce9 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -389,6 +389,17 @@ void r600_set_audio_packet(struct drm_encoder *encoder, 
u32 offset)
~HDMI0_60958_CS_CHANNEL_NUMBER_R_MASK);
 }

+void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute)
+{
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
+
+   if (mute)
+   WREG32_OR(HDMI0_GC + offset, HDMI0_GC_AVMUTE);
+   else
+   WREG32_AND(HDMI0_GC + offset, ~HDMI0_GC_AVMUTE);
+}
+
 /*
  * update the info frames with the data from the current display mode
  */
@@ -415,10 +426,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mod
radeon_audio_set_dto(encoder, mode->clock);
radeon_audio_set_vbi_packet(encoder);
radeon_hdmi_set_color_depth(encoder);
-
-   WREG32_AND(HDMI0_GC + offset,
-  ~HDMI0_GC_AVMUTE); /* unset HDMI0_GC_AVMUTE */
-
+   radeon_audio_set_mute(encoder, false);
radeon_audio_update_acr(encoder, mode->clock);
radeon_audio_set_audio_packet(encoder);

diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index 728a416..bbfdce3 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -92,6 +92,9 @@ void dce4_hdmi_set_color_depth(struct drm_encoder *encoder,
 void r600_set_audio_packet(struct drm_encoder *encoder, u32 offset);
 void dce3_2_set_audio_packet(struct drm_encoder 

[PATCH 17/24] radeon/audio: moved audio packet programming to a separate function

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c| 56 ++
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 84 
 drivers/gpu/drm/radeon/r600_hdmi.c  | 85 +
 drivers/gpu/drm/radeon/radeon_audio.c   | 19 
 drivers/gpu/drm/radeon/radeon_audio.h   |  2 +
 5 files changed, 134 insertions(+), 112 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index d659337..fa0e011 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -199,6 +199,27 @@ void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, 
long offset,
  ~HDMI0_ACR_N_48_MASK);
 }

+void dce3_2_set_audio_packet(struct drm_encoder *encoder, u32 offset)
+{
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
+
+   WREG32(HDMI0_AUDIO_PACKET_CONTROL + offset,
+   HDMI0_AUDIO_DELAY_EN(1) |   /* default 
audio delay */
+   HDMI0_AUDIO_PACKETS_PER_LINE(3));   /* should be suffient 
for all audio modes and small enough for all hblanks */
+
+   WREG32(AFMT_AUDIO_PACKET_CONTROL + offset,
+   AFMT_AUDIO_SAMPLE_SEND |/* send audio 
packets */
+   AFMT_60958_CS_UPDATE);  /* allow 60958 
channel status fields to be updated */
+
+   WREG32_OR(HDMI0_INFOFRAME_CONTROL0 + offset,
+   HDMI0_AUDIO_INFO_SEND | /* enable audio 
info frames (frames won't be set until audio is enabled) */
+   HDMI0_AUDIO_INFO_CONT); /* send audio 
info frames every frame/field */
+
+   WREG32_OR(HDMI0_INFOFRAME_CONTROL1 + offset,
+   HDMI0_AUDIO_INFO_LINE(2));  /* anything 
other than 0 */
+}
+
 /*
  * update the info frames with the data from the current display mode
  */
@@ -226,41 +247,16 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
radeon_audio_set_vbi_packet(encoder);
radeon_hdmi_set_color_depth(encoder);

-   if (ASIC_IS_DCE32(rdev)) {
-   WREG32(HDMI0_AUDIO_PACKET_CONTROL + offset,
-  HDMI0_AUDIO_DELAY_EN(1) | /* default audio delay */
-  HDMI0_AUDIO_PACKETS_PER_LINE(3)); /* should be suffient 
for all audio modes and small enough for all hblanks */
-   WREG32(AFMT_AUDIO_PACKET_CONTROL + offset,
-  AFMT_AUDIO_SAMPLE_SEND | /* send audio packets */
-  AFMT_60958_CS_UPDATE); /* allow 60958 channel status 
fields to be updated */
-   } else {
-   WREG32(HDMI0_AUDIO_PACKET_CONTROL + offset,
-  HDMI0_AUDIO_SAMPLE_SEND | /* send audio packets */
-  HDMI0_AUDIO_DELAY_EN(1) | /* default audio delay */
-  HDMI0_AUDIO_PACKETS_PER_LINE(3) | /* should be suffient 
for all audio modes and small enough for all hblanks */
-  HDMI0_60958_CS_UPDATE); /* allow 60958 channel status 
fields to be updated */
-   }
-
-   if (ASIC_IS_DCE32(rdev)) {
-   radeon_audio_write_speaker_allocation(encoder);
-   radeon_audio_write_sad_regs(encoder);
-   }
-
-   /* TODO: HDMI0_AUDIO_INFO_UPDATE */
-   WREG32_OR(HDMI0_INFOFRAME_CONTROL0 + offset,
-  HDMI0_AUDIO_INFO_SEND | /* enable audio info frames (frames 
won't be set until audio is enabled) */
-  HDMI0_AUDIO_INFO_CONT); /* send audio info frames every 
frame/field */
-
-   WREG32_OR(HDMI0_INFOFRAME_CONTROL1 + offset,
-  HDMI0_AUDIO_INFO_LINE(2)); /* anything other than 0 */
-
WREG32(HDMI0_GC + offset, 0); /* unset HDMI0_GC_AVMUTE */

+   radeon_audio_update_acr(encoder, mode->clock);
+   radeon_audio_write_speaker_allocation(encoder);
+   radeon_audio_set_audio_packet(encoder);
+   radeon_audio_write_sad_regs(encoder);
+
if (radeon_audio_set_avi_packet(encoder, mode) < 0)
return;

-   radeon_audio_update_acr(encoder, mode->clock);
-
/* it's unknown what these bits do excatly, but it's indeed quite 
useful for debugging */
WREG32(HDMI0_RAMP_CONTROL0 + offset, 0x00FF);
WREG32(HDMI0_RAMP_CONTROL1 + offset, 0x007F);
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index defef4f..7c7644c 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -345,6 +345,47 @@ void dce4_hdmi_set_color_depth(struct drm_encoder 
*encoder, u32 offset, int bpc)
WREG32(HDMI_CONTROL + offset, val);
 }

+void dce4_set_audio_packet(struct drm_encoder *encoder, u32 offset)
+{
+   struct drm_device *dev 

[PATCH 16/24] radeon/audio: set_avi_packet() function cleanup

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c| 22 +++--
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 34 --
 drivers/gpu/drm/radeon/r600_hdmi.c  | 31 
 drivers/gpu/drm/radeon/radeon_audio.c   | 43 -
 drivers/gpu/drm/radeon/radeon_audio.h   |  8 +++---
 5 files changed, 59 insertions(+), 79 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index c11c1ca..d659337 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -208,10 +208,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
struct radeon_device *rdev = dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
-   u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
-   struct hdmi_avi_infoframe frame;
uint32_t offset;
-   ssize_t err;

if (!dig || !dig->afmt)
return;
@@ -250,31 +247,18 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
}

/* TODO: HDMI0_AUDIO_INFO_UPDATE */
-   WREG32(HDMI0_INFOFRAME_CONTROL0 + offset,
-  HDMI0_AVI_INFO_SEND | /* enable AVI info frames */
-  HDMI0_AVI_INFO_CONT | /* send AVI info frames every frame/field 
*/
+   WREG32_OR(HDMI0_INFOFRAME_CONTROL0 + offset,
   HDMI0_AUDIO_INFO_SEND | /* enable audio info frames (frames 
won't be set until audio is enabled) */
   HDMI0_AUDIO_INFO_CONT); /* send audio info frames every 
frame/field */

-   WREG32(HDMI0_INFOFRAME_CONTROL1 + offset,
-  HDMI0_AVI_INFO_LINE(2) | /* anything other than 0 */
+   WREG32_OR(HDMI0_INFOFRAME_CONTROL1 + offset,
   HDMI0_AUDIO_INFO_LINE(2)); /* anything other than 0 */

WREG32(HDMI0_GC + offset, 0); /* unset HDMI0_GC_AVMUTE */

-   err = drm_hdmi_avi_infoframe_from_display_mode(, mode);
-   if (err < 0) {
-   DRM_ERROR("failed to setup AVI infoframe: %zd\n", err);
+   if (radeon_audio_set_avi_packet(encoder, mode) < 0)
return;
-   }
-
-   err = hdmi_avi_infoframe_pack(, buffer, sizeof(buffer));
-   if (err < 0) {
-   DRM_ERROR("failed to pack AVI infoframe: %zd\n", err);
-   return;
-   }

-   radeon_update_avi_infoframe(encoder, buffer, sizeof(buffer));
radeon_audio_update_acr(encoder, mode->clock);

/* it's unknown what these bits do excatly, but it's indeed quite 
useful for debugging */
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 95aa28f..defef4f 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -205,7 +205,7 @@ void evergreen_hdmi_write_sad_regs(struct drm_encoder 
*encoder,
 /*
  * build a AVI Info Frame
  */
-void evergreen_update_avi_infoframe(struct radeon_device *rdev, u32 offset,
+void evergreen_set_avi_packet(struct radeon_device *rdev, u32 offset,
 unsigned char *buffer, size_t size)
 {
uint8_t *frame = buffer + 3;
@@ -218,6 +218,14 @@ void evergreen_update_avi_infoframe(struct radeon_device 
*rdev, u32 offset,
frame[0x8] | (frame[0x9] << 8) | (frame[0xA] << 16) | 
(frame[0xB] << 24));
WREG32(AFMT_AVI_INFO3 + offset,
frame[0xC] | (frame[0xD] << 8) | (buffer[1] << 24));
+
+   WREG32_OR(HDMI_INFOFRAME_CONTROL0 + offset,
+   HDMI_AVI_INFO_SEND |/* enable AVI info frames */
+   HDMI_AVI_INFO_CONT);/* required for audio info values to be 
updated */
+
+   WREG32_P(HDMI_INFOFRAME_CONTROL1 + offset,
+   HDMI_AVI_INFO_LINE(2),  /* anything other than 0 */
+   ~HDMI_AVI_INFO_LINE_MASK);
 }

 void dce4_hdmi_audio_set_dto(struct radeon_device *rdev,
@@ -346,10 +354,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode
struct radeon_device *rdev = dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
-   u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
-   struct hdmi_avi_infoframe frame;
uint32_t offset;
-   ssize_t err;

if (!dig || !dig->afmt)
return;
@@ -415,27 +420,8 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode
radeon_audio_write_sad_regs(encoder);
radeon_audio_write_latency_fields(encoder, mode);

-   err = drm_hdmi_avi_infoframe_from_display_mode(, mode);
-   if (err < 0) {
-   DRM_ERROR("failed to 

[PATCH 15/24] radeon/audio: removed unnecessary CRC control programing

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c| 3 ---
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index f11cc15..c11c1ca 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -227,9 +227,6 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m

radeon_audio_set_dto(encoder, mode->clock);
radeon_audio_set_vbi_packet(encoder);
-
-   WREG32(HDMI0_AUDIO_CRC_CONTROL + offset, 0x1000);
-
radeon_hdmi_set_color_depth(encoder);

if (ASIC_IS_DCE32(rdev)) {
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index d213444..95aa28f 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -365,9 +365,6 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode

radeon_audio_set_dto(encoder, mode->clock);
radeon_audio_set_vbi_packet(encoder);
-
-   WREG32(AFMT_AUDIO_CRC_CONTROL + offset, 0x1000);
-
radeon_hdmi_set_color_depth(encoder);

WREG32(HDMI_INFOFRAME_CONTROL0 + offset,
-- 
1.8.3.1



[PATCH 14/24] radeon: moved HDMI color depth programming to a separate function

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c|  2 +
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 69 +
 drivers/gpu/drm/radeon/r600_hdmi.c  |  1 +
 drivers/gpu/drm/radeon/radeon_audio.c   | 22 +++
 drivers/gpu/drm/radeon/radeon_audio.h   |  2 +
 5 files changed, 62 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index 73af518..f11cc15 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -230,6 +230,8 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m

WREG32(HDMI0_AUDIO_CRC_CONTROL + offset, 0x1000);

+   radeon_hdmi_set_color_depth(encoder);
+
if (ASIC_IS_DCE32(rdev)) {
WREG32(HDMI0_AUDIO_PACKET_CONTROL + offset,
   HDMI0_AUDIO_DELAY_EN(1) | /* default audio delay */
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 5fffecc..d213444 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -300,45 +300,12 @@ void dce4_set_vbi_packet(struct drm_encoder *encoder, u32 
offset)
HDMI_GC_CONT);  /* send general control packets every 
frame */
 }

-/*
- * update the info frames with the data from the current display mode
- */
-void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mode)
+void dce4_hdmi_set_color_depth(struct drm_encoder *encoder, u32 offset, int 
bpc)
 {
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
-   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
struct drm_connector *connector = 
radeon_get_connector_for_encoder(encoder);
-   u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
-   struct hdmi_avi_infoframe frame;
-   uint32_t offset;
-   ssize_t err;
uint32_t val;
-   int bpc = 8;
-
-   if (!dig || !dig->afmt)
-   return;
-
-   /* Silent, r600_hdmi_enable will raise WARN for us */
-   if (!dig->afmt->enabled)
-   return;
-   offset = dig->afmt->offset;
-
-   /* hdmi deep color mode general control packets setup, if bpc > 8 */
-   if (encoder->crtc) {
-   struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
-   bpc = radeon_crtc->bpc;
-   }
-
-   /* disable audio prior to setting up hw */
-   dig->afmt->pin = radeon_audio_get_pin(encoder);
-   radeon_audio_enable(rdev, dig->afmt->pin, 0);
-
-   radeon_audio_set_dto(encoder, mode->clock);
-   radeon_audio_set_vbi_packet(encoder);
-
-   WREG32(AFMT_AUDIO_CRC_CONTROL + offset, 0x1000);

val = RREG32(HDMI_CONTROL + offset);
val &= ~HDMI_DEEP_COLOR_ENABLE;
@@ -368,6 +335,40 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode
}

WREG32(HDMI_CONTROL + offset, val);
+}
+
+/*
+ * update the info frames with the data from the current display mode
+ */
+void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mode)
+{
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
+   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
+   u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
+   struct hdmi_avi_infoframe frame;
+   uint32_t offset;
+   ssize_t err;
+
+   if (!dig || !dig->afmt)
+   return;
+
+   /* Silent, r600_hdmi_enable will raise WARN for us */
+   if (!dig->afmt->enabled)
+   return;
+   offset = dig->afmt->offset;
+
+   /* disable audio prior to setting up hw */
+   dig->afmt->pin = radeon_audio_get_pin(encoder);
+   radeon_audio_enable(rdev, dig->afmt->pin, 0);
+
+   radeon_audio_set_dto(encoder, mode->clock);
+   radeon_audio_set_vbi_packet(encoder);
+
+   WREG32(AFMT_AUDIO_CRC_CONTROL + offset, 0x1000);
+
+   radeon_hdmi_set_color_depth(encoder);

WREG32(HDMI_INFOFRAME_CONTROL0 + offset,
   HDMI_AUDIO_INFO_SEND | /* enable audio info frames (frames won't 
be set until audio is enabled) */
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
b/drivers/gpu/drm/radeon/r600_hdmi.c
index 7db7e89..8036417 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -368,6 +368,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mod

radeon_audio_set_dto(encoder, mode->clock);
radeon_audio_set_vbi_packet(encoder);
+   

[PATCH 13/24] radeon/audio: moved VBI packet programming to separate functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c|  9 +
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 20 
 drivers/gpu/drm/radeon/r600_hdmi.c  | 17 -
 drivers/gpu/drm/radeon/radeon_audio.c   | 18 ++
 drivers/gpu/drm/radeon/radeon_audio.h   |  2 ++
 5 files changed, 45 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index 678909f..73af518 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -226,9 +226,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
radeon_audio_enable(rdev, dig->afmt->pin, 0);

radeon_audio_set_dto(encoder, mode->clock);
-
-   WREG32(HDMI0_VBI_PACKET_CONTROL + offset,
-  HDMI0_NULL_SEND); /* send null packets when required */
+   radeon_audio_set_vbi_packet(encoder);

WREG32(HDMI0_AUDIO_CRC_CONTROL + offset, 0x1000);

@@ -252,11 +250,6 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
radeon_audio_write_sad_regs(encoder);
}

-   WREG32(HDMI0_VBI_PACKET_CONTROL + offset,
-  HDMI0_NULL_SEND | /* send null packets when required */
-  HDMI0_GC_SEND | /* send general control packets */
-  HDMI0_GC_CONT); /* send general control packets every frame */
-
/* TODO: HDMI0_AUDIO_INFO_UPDATE */
WREG32(HDMI0_INFOFRAME_CONTROL0 + offset,
   HDMI0_AVI_INFO_SEND | /* enable AVI info frames */
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index c2abab4..5fffecc 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -289,6 +289,17 @@ void dce4_dp_audio_set_dto(struct radeon_device *rdev,
WREG32(DCCG_AUDIO_DTO1_MODULE, rdev->clock.max_pixel_clock * 10);
 }

+void dce4_set_vbi_packet(struct drm_encoder *encoder, u32 offset)
+{
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
+
+   WREG32(HDMI_VBI_PACKET_CONTROL + offset,
+   HDMI_NULL_SEND |/* send null packets when required */
+   HDMI_GC_SEND |  /* send general control packets */
+   HDMI_GC_CONT);  /* send general control packets every 
frame */
+}
+
 /*
  * update the info frames with the data from the current display mode
  */
@@ -325,9 +336,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode
radeon_audio_enable(rdev, dig->afmt->pin, 0);

radeon_audio_set_dto(encoder, mode->clock);
-
-   WREG32(HDMI_VBI_PACKET_CONTROL + offset,
-  HDMI_NULL_SEND); /* send null packets when required */
+   radeon_audio_set_vbi_packet(encoder);

WREG32(AFMT_AUDIO_CRC_CONTROL + offset, 0x1000);

@@ -360,11 +369,6 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode

WREG32(HDMI_CONTROL + offset, val);

-   WREG32(HDMI_VBI_PACKET_CONTROL + offset,
-  HDMI_NULL_SEND | /* send null packets when required */
-  HDMI_GC_SEND | /* send general control packets */
-  HDMI_GC_CONT); /* send general control packets every frame */
-
WREG32(HDMI_INFOFRAME_CONTROL0 + offset,
   HDMI_AUDIO_INFO_SEND | /* enable audio info frames (frames won't 
be set until audio is enabled) */
   HDMI_AUDIO_INFO_CONT); /* required for audio info values to be 
updated */
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
b/drivers/gpu/drm/radeon/r600_hdmi.c
index 05eec9f..7db7e89 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -329,6 +329,17 @@ void r600_hdmi_audio_set_dto(struct radeon_device *rdev,
}
 }

+void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset)
+{
+   struct drm_device *dev = encoder->dev;
+   struct radeon_device *rdev = dev->dev_private;
+
+   WREG32_OR(HDMI0_VBI_PACKET_CONTROL + offset,
+   HDMI0_NULL_SEND |   /* send null packets when required */
+   HDMI0_GC_SEND | /* send general control packets */
+   HDMI0_GC_CONT); /* send general control packets every 
frame */
+}
+
 /*
  * update the info frames with the data from the current display mode
  */
@@ -356,6 +367,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mod
radeon_audio_enable(rdev, dig->afmt->pin, 0);

radeon_audio_set_dto(encoder, mode->clock);
+   radeon_audio_set_vbi_packet(encoder);

WREG32_P(HDMI0_AUDIO_PACKET_CONTROL + offset,
 HDMI0_AUDIO_SAMPLE_SEND | /* send audio packets */
@@ -367,11 +379,6 @@ void r600_hdmi_setmode(struct 

[PATCH 12/24] radeon/audio: consolidate update_acr() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c|  38 +--
 drivers/gpu/drm/radeon/evergreen_hdmi.c |  46 ++---
 drivers/gpu/drm/radeon/r600_hdmi.c  | 117 +---
 drivers/gpu/drm/radeon/radeon_audio.c   |  99 +++
 drivers/gpu/drm/radeon/radeon_audio.h   |   3 +
 5 files changed, 176 insertions(+), 127 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index 0accc5e..678909f 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -167,6 +167,38 @@ void dce3_2_audio_set_dto(struct radeon_device *rdev,
}
 }

+void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, long offset,
+const struct radeon_hdmi_acr *acr)
+{
+struct drm_device *dev = encoder->dev;
+struct radeon_device *rdev = dev->dev_private;
+
+   WREG32(HDMI0_ACR_PACKET_CONTROL + offset,
+  HDMI0_ACR_SOURCE |   /* select SW CTS value */
+  HDMI0_ACR_AUTO_SEND);/* allow hw to sent ACR packets when 
required */
+
+WREG32_P(HDMI0_ACR_32_0 + offset,
+ HDMI0_ACR_CTS_32(acr->cts_32khz),
+ ~HDMI0_ACR_CTS_32_MASK);
+WREG32_P(HDMI0_ACR_32_1 + offset,
+ HDMI0_ACR_N_32(acr->n_32khz),
+ ~HDMI0_ACR_N_32_MASK);
+
+WREG32_P(HDMI0_ACR_44_0 + offset,
+ HDMI0_ACR_CTS_44(acr->cts_44_1khz),
+ ~HDMI0_ACR_CTS_44_MASK);
+WREG32_P(HDMI0_ACR_44_1 + offset,
+ HDMI0_ACR_N_44(acr->n_44_1khz),
+ ~HDMI0_ACR_N_44_MASK);
+
+WREG32_P(HDMI0_ACR_48_0 + offset,
+ HDMI0_ACR_CTS_48(acr->cts_48khz),
+ ~HDMI0_ACR_CTS_48_MASK);
+WREG32_P(HDMI0_ACR_48_1 + offset,
+ HDMI0_ACR_N_48(acr->n_48khz),
+ ~HDMI0_ACR_N_48_MASK);
+}
+
 /*
  * update the info frames with the data from the current display mode
  */
@@ -220,10 +252,6 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
radeon_audio_write_sad_regs(encoder);
}

-   WREG32(HDMI0_ACR_PACKET_CONTROL + offset,
-  HDMI0_ACR_SOURCE | /* select SW CTS value - XXX verify that hw 
CTS works on all families */
-  HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when 
required */
-
WREG32(HDMI0_VBI_PACKET_CONTROL + offset,
   HDMI0_NULL_SEND | /* send null packets when required */
   HDMI0_GC_SEND | /* send general control packets */
@@ -255,7 +283,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
}

radeon_update_avi_infoframe(encoder, buffer, sizeof(buffer));
-   r600_hdmi_update_ACR(encoder, mode->clock);
+   radeon_audio_update_acr(encoder, mode->clock);

/* it's unknown what these bits do excatly, but it's indeed quite 
useful for debugging */
WREG32(HDMI0_RAMP_CONTROL0 + offset, 0x00FF);
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index f2896e5..c2abab4 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -64,26 +64,34 @@ void dce4_audio_enable(struct radeon_device *rdev,
WREG32(AZ_HOT_PLUG_CONTROL, tmp);
 }

-/*
- * update the N and CTS parameters for a given pixel clock rate
- */
-static void evergreen_hdmi_update_ACR(struct drm_encoder *encoder, uint32_t 
clock)
+void evergreen_hdmi_update_acr(struct drm_encoder *encoder, long offset,
+   const struct radeon_hdmi_acr *acr)
 {
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
-   struct radeon_hdmi_acr acr = r600_hdmi_acr(clock);
-   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
-   uint32_t offset = dig->afmt->offset;
+   int bpc = 8;
+
+   if (encoder->crtc) {
+   struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
+   bpc = radeon_crtc->bpc;
+   }
+
+   if (bpc > 8)
+   WREG32(HDMI_ACR_PACKET_CONTROL + offset,
+  HDMI_ACR_AUTO_SEND); /* allow hw to sent ACR packets 
when required */
+   else
+   WREG32(HDMI_ACR_PACKET_CONTROL + offset,
+  HDMI_ACR_SOURCE | /* select SW CTS value */
+  HDMI_ACR_AUTO_SEND); /* allow hw to sent ACR packets 
when required */

-   WREG32(HDMI_ACR_32_0 + offset, HDMI_ACR_CTS_32(acr.cts_32khz));
-   WREG32(HDMI_ACR_32_1 + offset, acr.n_32khz);
+   WREG32(HDMI_ACR_32_0 + offset, HDMI_ACR_CTS_32(acr->cts_32khz));
+   WREG32(HDMI_ACR_32_1 + offset, acr->n_32khz);

-   WREG32(HDMI_ACR_44_0 + offset, HDMI_ACR_CTS_44(acr.cts_44_1khz));
-   WREG32(HDMI_ACR_44_1 + offset, acr.n_44_1khz);
+   

[PATCH 11/24] radeon/audio: consolidate update_avi_infoframe() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c|  2 +-
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 16 +---
 drivers/gpu/drm/radeon/r600_hdmi.c  | 14 --
 drivers/gpu/drm/radeon/radeon_audio.c   | 20 
 drivers/gpu/drm/radeon/radeon_audio.h   |  4 
 5 files changed, 34 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index 6cb2f11..0accc5e 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -254,7 +254,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
return;
}

-   r600_hdmi_update_avi_infoframe(encoder, buffer, sizeof(buffer));
+   radeon_update_avi_infoframe(encoder, buffer, sizeof(buffer));
r600_hdmi_update_ACR(encoder, mode->clock);

/* it's unknown what these bits do excatly, but it's indeed quite 
useful for debugging */
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 38b1c51..f2896e5 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -195,18 +195,12 @@ void evergreen_hdmi_write_sad_regs(struct drm_encoder 
*encoder,
 }

 /*
- * build a HDMI Video Info Frame
+ * build a AVI Info Frame
  */
-static void evergreen_hdmi_update_avi_infoframe(struct drm_encoder *encoder,
-   void *buffer, size_t size)
+void evergreen_update_avi_infoframe(struct radeon_device *rdev, u32 offset,
+unsigned char *buffer, size_t size)
 {
-   struct drm_device *dev = encoder->dev;
-   struct radeon_device *rdev = dev->dev_private;
-   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
-   uint32_t offset = dig->afmt->offset;
uint8_t *frame = buffer + 3;
-   uint8_t *header = buffer;

WREG32(AFMT_AVI_INFO0 + offset,
frame[0x0] | (frame[0x1] << 8) | (frame[0x2] << 16) | 
(frame[0x3] << 24));
@@ -215,7 +209,7 @@ static void evergreen_hdmi_update_avi_infoframe(struct 
drm_encoder *encoder,
WREG32(AFMT_AVI_INFO2 + offset,
frame[0x8] | (frame[0x9] << 8) | (frame[0xA] << 16) | 
(frame[0xB] << 24));
WREG32(AFMT_AVI_INFO3 + offset,
-   frame[0xC] | (frame[0xD] << 8) | (header[1] << 24));
+   frame[0xC] | (frame[0xD] << 8) | (buffer[1] << 24));
 }

 void dce4_hdmi_audio_set_dto(struct radeon_device *rdev,
@@ -431,7 +425,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode
return;
}

-   evergreen_hdmi_update_avi_infoframe(encoder, buffer, sizeof(buffer));
+   radeon_update_avi_infoframe(encoder, buffer, sizeof(buffer));

WREG32_OR(HDMI_INFOFRAME_CONTROL0 + offset,
  HDMI_AVI_INFO_SEND | /* enable AVI info frames */
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
b/drivers/gpu/drm/radeon/r600_hdmi.c
index 30580d1..53ee7ad 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -285,16 +285,10 @@ void r600_hdmi_update_ACR(struct drm_encoder *encoder, 
uint32_t clock)
 /*
  * build a HDMI Video Info Frame
  */
-void r600_hdmi_update_avi_infoframe(struct drm_encoder *encoder, void *buffer,
-   size_t size)
+void r600_update_avi_infoframe(struct radeon_device *rdev, u32 offset,
+unsigned char *buffer, size_t size)
 {
-   struct drm_device *dev = encoder->dev;
-   struct radeon_device *rdev = dev->dev_private;
-   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-   struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
-   uint32_t offset = dig->afmt->offset;
uint8_t *frame = buffer + 3;
-   uint8_t *header = buffer;

WREG32(HDMI0_AVI_INFO0 + offset,
frame[0x0] | (frame[0x1] << 8) | (frame[0x2] << 16) | 
(frame[0x3] << 24));
@@ -303,7 +297,7 @@ void r600_hdmi_update_avi_infoframe(struct drm_encoder 
*encoder, void *buffer,
WREG32(HDMI0_AVI_INFO2 + offset,
frame[0x8] | (frame[0x9] << 8) | (frame[0xA] << 16) | 
(frame[0xB] << 24));
WREG32(HDMI0_AVI_INFO3 + offset,
-   frame[0xC] | (frame[0xD] << 8) | (header[1] << 24));
+   frame[0xC] | (frame[0xD] << 8) | (buffer[1] << 24));
 }

 /*
@@ -486,7 +480,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mod
return;
}

-   r600_hdmi_update_avi_infoframe(encoder, buffer, sizeof(buffer));
+   radeon_update_avi_infoframe(encoder, buffer, sizeof(buffer));

/* fglrx duplicates INFOFRAME_CONTROL0 & INFOFRAME_CONTROL1 ops here */

diff --git 

[PATCH 10/24] radeon/audio: consolidate audio_set_dto() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c| 56 +++-
 drivers/gpu/drm/radeon/dce6_afmt.c  | 39 ++
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 92 -
 drivers/gpu/drm/radeon/evergreend.h |  1 +
 drivers/gpu/drm/radeon/r600_hdmi.c  | 80 +++-
 drivers/gpu/drm/radeon/radeon_audio.c   | 45 +++-
 drivers/gpu/drm/radeon/radeon_audio.h   |  3 ++
 drivers/gpu/drm/radeon/sid.h| 10 
 8 files changed, 226 insertions(+), 100 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index f7b2659..6cb2f11 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -113,6 +113,60 @@ void dce3_2_afmt_write_sad_regs(struct drm_encoder 
*encoder,
}
 }

+void dce3_2_audio_set_dto(struct radeon_device *rdev,
+   struct radeon_crtc *crtc, unsigned int clock)
+{
+   struct radeon_encoder *radeon_encoder;
+   struct radeon_encoder_atom_dig *dig;
+   unsigned int max_ratio = clock / 24000;
+   u32 dto_phase;
+   u32 wallclock_ratio;
+   u32 dto_cntl;
+
+   if (!crtc)
+   return;
+
+   radeon_encoder = to_radeon_encoder(crtc->encoder);
+   dig = radeon_encoder->enc_priv;
+
+   if (!dig)
+   return;
+
+   if (max_ratio >= 8) {
+   dto_phase = 192 * 1000;
+   wallclock_ratio = 3;
+   } else if (max_ratio >= 4) {
+   dto_phase = 96 * 1000;
+   wallclock_ratio = 2;
+   } else if (max_ratio >= 2) {
+   dto_phase = 48 * 1000;
+   wallclock_ratio = 1;
+   } else {
+   dto_phase = 24 * 1000;
+   wallclock_ratio = 0;
+   }
+
+   /* Express [24MHz / target pixel clock] as an exact rational
+* number (coefficient of two integer numbers.  DCCG_AUDIO_DTOx_PHASE
+* is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator
+*/
+   if (dig->dig_encoder == 0) {
+   dto_cntl = RREG32(DCCG_AUDIO_DTO0_CNTL) & 
~DCCG_AUDIO_DTO_WALLCLOCK_RATIO_MASK;
+   dto_cntl |= DCCG_AUDIO_DTO_WALLCLOCK_RATIO(wallclock_ratio);
+   WREG32(DCCG_AUDIO_DTO0_CNTL, dto_cntl);
+   WREG32(DCCG_AUDIO_DTO0_PHASE, dto_phase);
+   WREG32(DCCG_AUDIO_DTO0_MODULE, clock);
+   WREG32(DCCG_AUDIO_DTO_SELECT, 0); /* select DTO0 */
+   } else {
+   dto_cntl = RREG32(DCCG_AUDIO_DTO1_CNTL) & 
~DCCG_AUDIO_DTO_WALLCLOCK_RATIO_MASK;
+   dto_cntl |= DCCG_AUDIO_DTO_WALLCLOCK_RATIO(wallclock_ratio);
+   WREG32(DCCG_AUDIO_DTO1_CNTL, dto_cntl);
+   WREG32(DCCG_AUDIO_DTO1_PHASE, dto_phase);
+   WREG32(DCCG_AUDIO_DTO1_MODULE, clock);
+   WREG32(DCCG_AUDIO_DTO_SELECT, 1); /* select DTO1 */
+   }
+}
+
 /*
  * update the info frames with the data from the current display mode
  */
@@ -139,7 +193,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
dig->afmt->pin = radeon_audio_get_pin(encoder);
radeon_audio_enable(rdev, dig->afmt->pin, 0);

-   r600_audio_set_dto(encoder, mode->clock);
+   radeon_audio_set_dto(encoder, mode->clock);

WREG32(HDMI0_VBI_PACKET_CONTROL + offset,
   HDMI0_NULL_SEND); /* send null packets when required */
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index c4ff60f..1c87006 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -248,3 +248,42 @@ void dce6_audio_enable(struct radeon_device *rdev,
WREG32_ENDPOINT(pin->offset, AZ_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL,
enable_mask ? AUDIO_ENABLED : 0);
 }
+
+void dce6_hdmi_audio_set_dto(struct radeon_device *rdev,
+   struct radeon_crtc *crtc, unsigned int clock)
+{
+/* Two dtos; generally use dto0 for HDMI */
+   u32 value = 0;
+
+if (crtc)
+   value |= DCCG_AUDIO_DTO0_SOURCE_SEL(crtc->crtc_id);
+
+   WREG32(DCCG_AUDIO_DTO_SOURCE, value);
+
+/* Express [24MHz / target pixel clock] as an exact rational
+ * number (coefficient of two integer numbers.  DCCG_AUDIO_DTOx_PHASE
+ * is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator
+ */
+WREG32(DCCG_AUDIO_DTO0_PHASE, 24000);
+WREG32(DCCG_AUDIO_DTO0_MODULE, clock);
+}
+
+void dce6_dp_audio_set_dto(struct radeon_device *rdev,
+   struct radeon_crtc *crtc, unsigned int clock)
+{
+/* Two dtos; generally use dto1 for DP */
+   u32 value = 0;
+   value |= DCCG_AUDIO_DTO_SEL;
+
+if (crtc)
+   value |= DCCG_AUDIO_DTO0_SOURCE_SEL(crtc->crtc_id);
+
+   WREG32(DCCG_AUDIO_DTO_SOURCE, value);
+
+/* Express [24MHz / target pixel 

[PATCH 09/24] radeon/audio: consolidate audio_fini() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/cik.c  |  2 +-
 drivers/gpu/drm/radeon/dce6_afmt.c| 13 -
 drivers/gpu/drm/radeon/evergreen.c|  4 ++--
 drivers/gpu/drm/radeon/ni.c   |  5 +
 drivers/gpu/drm/radeon/r600.c |  4 ++--
 drivers/gpu/drm/radeon/r600_hdmi.c| 13 -
 drivers/gpu/drm/radeon/radeon_audio.c | 13 +
 drivers/gpu/drm/radeon/radeon_audio.h |  1 +
 drivers/gpu/drm/radeon/rs600.c|  4 ++--
 drivers/gpu/drm/radeon/rs690.c|  4 ++--
 drivers/gpu/drm/radeon/rv770.c|  2 +-
 drivers/gpu/drm/radeon/si.c   |  2 +-
 12 files changed, 26 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 16b6fa8..6881686 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -8541,7 +8541,7 @@ int cik_suspend(struct radeon_device *rdev)
 {
radeon_kfd_suspend(rdev);
radeon_pm_suspend(rdev);
-   dce6_audio_fini(rdev);
+   radeon_audio_fini(rdev);
radeon_vm_manager_fini(rdev);
cik_cp_enable(rdev, false);
cik_sdma_enable(rdev, false);
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index 7fd7f15..c4ff60f 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -248,16 +248,3 @@ void dce6_audio_enable(struct radeon_device *rdev,
WREG32_ENDPOINT(pin->offset, AZ_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL,
enable_mask ? AUDIO_ENABLED : 0);
 }
-
-void dce6_audio_fini(struct radeon_device *rdev)
-{
-   int i;
-
-   if (!rdev->audio.enabled)
-   return;
-
-   for (i = 0; i < rdev->audio.num_pins; i++)
-   radeon_audio_enable(rdev, >audio.pin[i], false);
-
-   rdev->audio.enabled = false;
-}
diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index 406ea8e..78600f5 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -5333,7 +5333,7 @@ int evergreen_resume(struct radeon_device *rdev)
 int evergreen_suspend(struct radeon_device *rdev)
 {
radeon_pm_suspend(rdev);
-   r600_audio_fini(rdev);
+   radeon_audio_fini(rdev);
uvd_v1_0_fini(rdev);
radeon_uvd_suspend(rdev);
r700_cp_stop(rdev);
@@ -5483,7 +5483,7 @@ int evergreen_init(struct radeon_device *rdev)
 void evergreen_fini(struct radeon_device *rdev)
 {
radeon_pm_fini(rdev);
-   r600_audio_fini(rdev);
+   radeon_audio_fini(rdev);
r700_cp_fini(rdev);
r600_dma_fini(rdev);
r600_irq_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 5203e0c..0f0ba52 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -2135,10 +2135,7 @@ int cayman_resume(struct radeon_device *rdev)
 int cayman_suspend(struct radeon_device *rdev)
 {
radeon_pm_suspend(rdev);
-   if (ASIC_IS_DCE6(rdev))
-   dce6_audio_fini(rdev);
-   else
-   r600_audio_fini(rdev);
+   radeon_audio_fini(rdev);
radeon_vm_manager_fini(rdev);
cayman_cp_enable(rdev, false);
cayman_dma_stop(rdev);
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index de7878a..07a71a2 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -3106,7 +3106,7 @@ int r600_resume(struct radeon_device *rdev)
 int r600_suspend(struct radeon_device *rdev)
 {
radeon_pm_suspend(rdev);
-   r600_audio_fini(rdev);
+   radeon_audio_fini(rdev);
r600_cp_stop(rdev);
if (rdev->has_uvd) {
uvd_v1_0_fini(rdev);
@@ -3225,7 +3225,7 @@ int r600_init(struct radeon_device *rdev)
 void r600_fini(struct radeon_device *rdev)
 {
radeon_pm_fini(rdev);
-   r600_audio_fini(rdev);
+   radeon_audio_fini(rdev);
r600_cp_fini(rdev);
r600_irq_fini(rdev);
if (rdev->has_uvd) {
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
b/drivers/gpu/drm/radeon/r600_hdmi.c
index f92eb77..1c49f4d 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -183,19 +183,6 @@ void r600_audio_enable(struct radeon_device *rdev,
WREG32(AZ_HOT_PLUG_CONTROL, tmp);
 }

-/*
- * release the audio timer
- * TODO: How to do this correctly on SMP systems?
- */
-void r600_audio_fini(struct radeon_device *rdev)
-{
-   if (!rdev->audio.enabled)
-   return;
-
-   radeon_audio_enable(rdev, >audio.pin[0], 0);
-   rdev->audio.enabled = false;
-}
-
 struct r600_audio_pin *r600_audio_get_pin(struct radeon_device *rdev)
 {
/* only one pin on 6xx-NI */
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index eed5c74..e6c73f8 100644
--- 

[PATCH 08/24] radeon/audio: consolidate audio_enable() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c|  4 ++--
 drivers/gpu/drm/radeon/dce6_afmt.c  |  2 +-
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 18 --
 drivers/gpu/drm/radeon/r600_hdmi.c  |  9 -
 drivers/gpu/drm/radeon/radeon_audio.c   | 17 +
 drivers/gpu/drm/radeon/radeon_audio.h   |  4 
 6 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index f4cddb2..f7b2659 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -137,7 +137,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m

/* disable audio prior to setting up hw */
dig->afmt->pin = radeon_audio_get_pin(encoder);
-   r600_audio_enable(rdev, dig->afmt->pin, 0);
+   radeon_audio_enable(rdev, dig->afmt->pin, 0);

r600_audio_set_dto(encoder, mode->clock);

@@ -212,5 +212,5 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
r600_hdmi_audio_workaround(encoder);

/* enable audio after to setting up hw */
-   r600_audio_enable(rdev, dig->afmt->pin, 0xf);
+   radeon_audio_enable(rdev, dig->afmt->pin, 0xf);
 }
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index 96f298c..7fd7f15 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -257,7 +257,7 @@ void dce6_audio_fini(struct radeon_device *rdev)
return;

for (i = 0; i < rdev->audio.num_pins; i++)
-   dce6_audio_enable(rdev, >audio.pin[i], false);
+   radeon_audio_enable(rdev, >audio.pin[i], false);

rdev->audio.enabled = false;
 }
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 6bd113b..2f29918 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -34,7 +34,7 @@
 #include "atom.h"

 /* enable the audio stream */
-static void dce4_audio_enable(struct radeon_device *rdev,
+void dce4_audio_enable(struct radeon_device *rdev,
  struct r600_audio_pin *pin,
  u8 enable_mask)
 {
@@ -300,11 +300,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode

/* disable audio prior to setting up hw */
dig->afmt->pin = radeon_audio_get_pin(encoder);
-   if (ASIC_IS_DCE6(rdev)) {
-   dce6_audio_enable(rdev, dig->afmt->pin, 0);
-   } else {
-   dce4_audio_enable(rdev, dig->afmt->pin, 0);
-   }
+   radeon_audio_enable(rdev, dig->afmt->pin, 0);

evergreen_audio_set_dto(encoder, mode->clock);

@@ -435,10 +431,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode
WREG32(AFMT_RAMP_CONTROL3 + offset, 0x0001);

/* enable audio after to setting up hw */
-   if (ASIC_IS_DCE6(rdev))
-   dce6_audio_enable(rdev, dig->afmt->pin, 1);
-   else
-   dce4_audio_enable(rdev, dig->afmt->pin, 0xf);
+   radeon_audio_enable(rdev, dig->afmt->pin, 0xf);
 }

 void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable)
@@ -458,10 +451,7 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, 
bool enable)
return;

if (!enable && dig->afmt->pin) {
-   if (ASIC_IS_DCE6(rdev))
-   dce6_audio_enable(rdev, dig->afmt->pin, 0);
-   else
-   dce4_audio_enable(rdev, dig->afmt->pin, 0);
+   radeon_audio_enable(rdev, dig->afmt->pin, 0);
dig->afmt->pin = NULL;
}

diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
b/drivers/gpu/drm/radeon/r600_hdmi.c
index 53159a2..f92eb77 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -192,8 +192,7 @@ void r600_audio_fini(struct radeon_device *rdev)
if (!rdev->audio.enabled)
return;

-   r600_audio_enable(rdev, >audio.pin[0], 0);
-
+   radeon_audio_enable(rdev, >audio.pin[0], 0);
rdev->audio.enabled = false;
 }

@@ -489,7 +488,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mod

/* disable audio prior to setting up hw */
dig->afmt->pin = radeon_audio_get_pin(encoder);
-   r600_audio_enable(rdev, dig->afmt->pin, 0xf);
+   radeon_audio_enable(rdev, dig->afmt->pin, 0);

r600_audio_set_dto(encoder, mode->clock);

@@ -575,7 +574,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mod
WREG32(HDMI0_RAMP_CONTROL3 + offset, 0x0001);

/* enable audio after to setting up hw */
-   r600_audio_enable(rdev, dig->afmt->pin, 0xf);
+   

[PATCH 07/24] radeon/audio: consolidate select_pin() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/evergreen_hdmi.c |  6 +-
 drivers/gpu/drm/radeon/radeon_audio.c   | 11 +++
 drivers/gpu/drm/radeon/radeon_audio.h   |  2 ++
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 26d8cd5..6bd113b 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -33,8 +33,6 @@
 #include "evergreend.h"
 #include "atom.h"

-extern void dce6_afmt_select_pin(struct drm_encoder *encoder);
-
 /* enable the audio stream */
 static void dce4_audio_enable(struct radeon_device *rdev,
  struct r600_audio_pin *pin,
@@ -401,9 +399,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode

/* fglrx sets 0x40 in 0x5f80 here */

-   if (ASIC_IS_DCE6(rdev))
-   dce6_afmt_select_pin(encoder);
-
+   radeon_audio_select_pin(encoder);
radeon_audio_write_sad_regs(encoder);
radeon_audio_write_latency_fields(encoder, mode);

diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index 795f84c..5aedf5b 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -59,6 +59,7 @@ void dce6_afmt_write_latency_fields(struct drm_encoder 
*encoder,
struct drm_connector *connector, struct drm_display_mode *mode);
 struct r600_audio_pin* r600_audio_get_pin(struct radeon_device *rdev);
 struct r600_audio_pin* dce6_audio_get_pin(struct radeon_device *rdev);
+void dce6_afmt_select_pin(struct drm_encoder *encoder);

 static const u32 pin_offsets[7] =
 {
@@ -124,6 +125,7 @@ static struct radeon_audio_funcs dce4_dp_funcs = {
 };

 static struct radeon_audio_funcs dce6_hdmi_funcs = {
+   .select_pin = dce6_afmt_select_pin,
.get_pin = dce6_audio_get_pin,
.write_sad_regs = dce6_afmt_write_sad_regs,
.write_speaker_allocation = dce6_afmt_hdmi_write_speaker_allocation,
@@ -131,6 +133,7 @@ static struct radeon_audio_funcs dce6_hdmi_funcs = {
 };

 static struct radeon_audio_funcs dce6_dp_funcs = {
+   .select_pin = dce6_afmt_select_pin,
.get_pin = dce6_audio_get_pin,
.write_sad_regs = dce6_afmt_write_sad_regs,
.write_speaker_allocation = dce6_afmt_dp_write_speaker_allocation,
@@ -360,3 +363,11 @@ struct r600_audio_pin* radeon_audio_get_pin(struct 
drm_encoder *encoder)

return NULL;
 }
+
+void radeon_audio_select_pin(struct drm_encoder *encoder)
+{
+   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+
+   if (radeon_encoder->audio && radeon_encoder->audio->select_pin)
+   radeon_encoder->audio->select_pin(encoder);
+}
diff --git a/drivers/gpu/drm/radeon/radeon_audio.h 
b/drivers/gpu/drm/radeon/radeon_audio.h
index 492f98b..36d329a 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.h
+++ b/drivers/gpu/drm/radeon/radeon_audio.h
@@ -41,6 +41,7 @@ struct radeon_audio_basic_funcs

 struct radeon_audio_funcs
 {
+   void (*select_pin)(struct drm_encoder *encoder);
struct r600_audio_pin* (*get_pin)(struct radeon_device *rdev);
void (*write_latency_fields)(struct drm_encoder *encoder,
struct drm_connector *connector, struct drm_display_mode *mode);
@@ -62,5 +63,6 @@ void radeon_audio_write_speaker_allocation(struct drm_encoder 
*encoder);
 void radeon_audio_write_latency_fields(struct drm_encoder *encoder,
struct drm_display_mode *mode);
 struct r600_audio_pin *radeon_audio_get_pin(struct drm_encoder *encoder);
+void radeon_audio_select_pin(struct drm_encoder *encoder);

 #endif
-- 
1.8.3.1



[PATCH 06/24] radeon/audio: consolidate audio_get_pin() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c|  2 +-
 drivers/gpu/drm/radeon/evergreen_hdmi.c |  3 +--
 drivers/gpu/drm/radeon/r600_hdmi.c  |  3 ++-
 drivers/gpu/drm/radeon/radeon_audio.c   | 19 +++
 drivers/gpu/drm/radeon/radeon_audio.h   |  2 ++
 5 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index 613e611..f4cddb2 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -136,7 +136,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
offset = dig->afmt->offset;

/* disable audio prior to setting up hw */
-   dig->afmt->pin = r600_audio_get_pin(rdev);
+   dig->afmt->pin = radeon_audio_get_pin(encoder);
r600_audio_enable(rdev, dig->afmt->pin, 0);

r600_audio_set_dto(encoder, mode->clock);
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index aa8a31b..26d8cd5 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -301,11 +301,10 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode
}

/* disable audio prior to setting up hw */
+   dig->afmt->pin = radeon_audio_get_pin(encoder);
if (ASIC_IS_DCE6(rdev)) {
-   dig->afmt->pin = dce6_audio_get_pin(rdev);
dce6_audio_enable(rdev, dig->afmt->pin, 0);
} else {
-   dig->afmt->pin = r600_audio_get_pin(rdev);
dce4_audio_enable(rdev, dig->afmt->pin, 0);
}

diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c 
b/drivers/gpu/drm/radeon/r600_hdmi.c
index 96a26b0c..53159a2 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -29,6 +29,7 @@
 #include 
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "radeon_audio.h"
 #include "r600d.h"
 #include "atom.h"

@@ -487,7 +488,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct 
drm_display_mode *mod
offset = dig->afmt->offset;

/* disable audio prior to setting up hw */
-   dig->afmt->pin = r600_audio_get_pin(rdev);
+   dig->afmt->pin = radeon_audio_get_pin(encoder);
r600_audio_enable(rdev, dig->afmt->pin, 0xf);

r600_audio_set_dto(encoder, mode->clock);
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index a95eee1..795f84c 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -57,6 +57,8 @@ void dce4_afmt_write_latency_fields(struct drm_encoder 
*encoder,
struct drm_connector *connector, struct drm_display_mode *mode);
 void dce6_afmt_write_latency_fields(struct drm_encoder *encoder,
struct drm_connector *connector, struct drm_display_mode *mode);
+struct r600_audio_pin* r600_audio_get_pin(struct radeon_device *rdev);
+struct r600_audio_pin* dce6_audio_get_pin(struct radeon_device *rdev);

 static const u32 pin_offsets[7] =
 {
@@ -96,34 +98,40 @@ static struct radeon_audio_basic_funcs dce6_funcs = {
 };

 static struct radeon_audio_funcs dce32_hdmi_funcs = {
+   .get_pin = r600_audio_get_pin,
.write_sad_regs = dce3_2_afmt_write_sad_regs,
.write_speaker_allocation = dce3_2_afmt_hdmi_write_speaker_allocation,
 };

 static struct radeon_audio_funcs dce32_dp_funcs = {
+   .get_pin = r600_audio_get_pin,
.write_sad_regs = dce3_2_afmt_write_sad_regs,
.write_speaker_allocation = dce3_2_afmt_dp_write_speaker_allocation,
 };

 static struct radeon_audio_funcs dce4_hdmi_funcs = {
+   .get_pin = r600_audio_get_pin,
.write_sad_regs = evergreen_hdmi_write_sad_regs,
.write_speaker_allocation = dce4_afmt_hdmi_write_speaker_allocation,
.write_latency_fields = dce4_afmt_write_latency_fields,
 };

 static struct radeon_audio_funcs dce4_dp_funcs = {
+   .get_pin = r600_audio_get_pin,
.write_sad_regs = evergreen_hdmi_write_sad_regs,
.write_speaker_allocation = dce4_afmt_dp_write_speaker_allocation,
.write_latency_fields = dce4_afmt_write_latency_fields,
 };

 static struct radeon_audio_funcs dce6_hdmi_funcs = {
+   .get_pin = dce6_audio_get_pin,
.write_sad_regs = dce6_afmt_write_sad_regs,
.write_speaker_allocation = dce6_afmt_hdmi_write_speaker_allocation,
.write_latency_fields = dce6_afmt_write_latency_fields,
 };

 static struct radeon_audio_funcs dce6_dp_funcs = {
+   .get_pin = dce6_audio_get_pin,
.write_sad_regs = dce6_afmt_write_sad_regs,
.write_speaker_allocation = dce6_afmt_dp_write_speaker_allocation,
.write_latency_fields = dce6_afmt_write_latency_fields,
@@ -341,3 +349,14 @@ void radeon_audio_write_latency_fields(struct 

[PATCH 05/24] radeon/audio: consolidate write_latency_fields() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce6_afmt.c  | 16 +
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 33 --
 drivers/gpu/drm/radeon/radeon_audio.c   | 62 +
 drivers/gpu/drm/radeon/radeon_audio.h   |  4 +++
 4 files changed, 51 insertions(+), 64 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index a24c95a..96f298c 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -102,13 +102,11 @@ void dce6_afmt_select_pin(struct drm_encoder *encoder)
 }

 void dce6_afmt_write_latency_fields(struct drm_encoder *encoder,
-   struct drm_display_mode *mode)
+   struct drm_connector *connector, struct drm_display_mode *mode)
 {
struct radeon_device *rdev = encoder->dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
-   struct drm_connector *connector;
-   struct radeon_connector *radeon_connector = NULL;
u32 tmp = 0, offset;

if (!dig || !dig->afmt || !dig->afmt->pin)
@@ -116,18 +114,6 @@ void dce6_afmt_write_latency_fields(struct drm_encoder 
*encoder,

offset = dig->afmt->pin->offset;

-   list_for_each_entry(connector, 
>dev->mode_config.connector_list, head) {
-   if (connector->encoder == encoder) {
-   radeon_connector = to_radeon_connector(connector);
-   break;
-   }
-   }
-
-   if (!radeon_connector) {
-   DRM_ERROR("Couldn't find encoder's connector\n");
-   return;
-   }
-
if (mode->flags & DRM_MODE_FLAG_INTERLACE) {
if (connector->latency_present[1])
tmp = VIDEO_LIPSYNC(connector->video_latency[1]) |
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c 
b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 3a9bb04..aa8a31b 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -34,8 +34,6 @@
 #include "atom.h"

 extern void dce6_afmt_select_pin(struct drm_encoder *encoder);
-extern void dce6_afmt_write_latency_fields(struct drm_encoder *encoder,
-  struct drm_display_mode *mode);

 /* enable the audio stream */
 static void dce4_audio_enable(struct radeon_device *rdev,
@@ -90,26 +88,12 @@ static void evergreen_hdmi_update_ACR(struct drm_encoder 
*encoder, uint32_t cloc
WREG32(HDMI_ACR_48_1 + offset, acr.n_48khz);
 }

-static void dce4_afmt_write_latency_fields(struct drm_encoder *encoder,
-  struct drm_display_mode *mode)
+void dce4_afmt_write_latency_fields(struct drm_encoder *encoder,
+   struct drm_connector *connector, struct drm_display_mode *mode)
 {
struct radeon_device *rdev = encoder->dev->dev_private;
-   struct drm_connector *connector;
-   struct radeon_connector *radeon_connector = NULL;
u32 tmp = 0;

-   list_for_each_entry(connector, 
>dev->mode_config.connector_list, head) {
-   if (connector->encoder == encoder) {
-   radeon_connector = to_radeon_connector(connector);
-   break;
-   }
-   }
-
-   if (!radeon_connector) {
-   DRM_ERROR("Couldn't find encoder's connector\n");
-   return;
-   }
-
if (mode->flags & DRM_MODE_FLAG_INTERLACE) {
if (connector->latency_present[1])
tmp = VIDEO_LIPSYNC(connector->video_latency[1]) |
@@ -123,7 +107,7 @@ static void dce4_afmt_write_latency_fields(struct 
drm_encoder *encoder,
else
tmp = VIDEO_LIPSYNC(255) | AUDIO_LIPSYNC(255);
}
-   WREG32(AZ_F0_CODEC_PIN0_CONTROL_RESPONSE_LIPSYNC, tmp);
+   WREG32_ENDPOINT(0, AZ_F0_CODEC_PIN0_CONTROL_RESPONSE_LIPSYNC, tmp);
 }

 void dce4_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
@@ -418,14 +402,11 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode

/* fglrx sets 0x40 in 0x5f80 here */

-   if (ASIC_IS_DCE6(rdev)) {
+   if (ASIC_IS_DCE6(rdev))
dce6_afmt_select_pin(encoder);
-   radeon_audio_write_sad_regs(encoder);
-   dce6_afmt_write_latency_fields(encoder, mode);
-   } else {
-   radeon_audio_write_sad_regs(encoder);
-   dce4_afmt_write_latency_fields(encoder, mode);
-   }
+
+   radeon_audio_write_sad_regs(encoder);
+   radeon_audio_write_latency_fields(encoder, mode);

err = drm_hdmi_avi_infoframe_from_display_mode(, mode);
if (err < 0) {
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 

[PATCH 04/24] radeon/audio: consolidate write_speaker_allocation() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c| 49 ++-
 drivers/gpu/drm/radeon/dce6_afmt.c  | 50 ---
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 54 ++---
 drivers/gpu/drm/radeon/radeon_audio.c   | 71 +
 drivers/gpu/drm/radeon/radeon_audio.h   |  3 ++
 5 files changed, 144 insertions(+), 83 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index c74431e..613e611 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -27,35 +27,14 @@
 #include "radeon_audio.h"
 #include "r600d.h"

-static void dce3_2_afmt_write_speaker_allocation(struct drm_encoder *encoder)
+void dce3_2_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
+   u8 *sadb, int sad_count)
 {
struct radeon_device *rdev = encoder->dev->dev_private;
-   struct drm_connector *connector;
-   struct radeon_connector *radeon_connector = NULL;
u32 tmp;
-   u8 *sadb = NULL;
-   int sad_count;
-
-   list_for_each_entry(connector, 
>dev->mode_config.connector_list, head) {
-   if (connector->encoder == encoder) {
-   radeon_connector = to_radeon_connector(connector);
-   break;
-   }
-   }
-
-   if (!radeon_connector) {
-   DRM_ERROR("Couldn't find encoder's connector\n");
-   return;
-   }
-
-   sad_count = drm_edid_to_speaker_allocation(radeon_connector->edid, 
);
-   if (sad_count < 0) {
-   DRM_DEBUG("Couldn't read Speaker Allocation Data Block: %d\n", 
sad_count);
-   sad_count = 0;
-   }

/* program the speaker allocation */
-   tmp = RREG32(AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER);
+   tmp = RREG32_ENDPOINT(0, AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER);
tmp &= ~(DP_CONNECTION | SPEAKER_ALLOCATION_MASK);
/* set HDMI mode */
tmp |= HDMI_CONNECTION;
@@ -63,9 +42,25 @@ static void dce3_2_afmt_write_speaker_allocation(struct 
drm_encoder *encoder)
tmp |= SPEAKER_ALLOCATION(sadb[0]);
else
tmp |= SPEAKER_ALLOCATION(5); /* stereo */
-   WREG32(AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER, tmp);
+   WREG32_ENDPOINT(0, AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER, tmp);
+}

-   kfree(sadb);
+void dce3_2_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
+   u8 *sadb, int sad_count)
+{
+   struct radeon_device *rdev = encoder->dev->dev_private;
+   u32 tmp;
+
+   /* program the speaker allocation */
+   tmp = RREG32_ENDPOINT(0, AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER);
+   tmp &= ~(HDMI_CONNECTION | SPEAKER_ALLOCATION_MASK);
+   /* set DP mode */
+   tmp |= DP_CONNECTION;
+   if (sad_count)
+   tmp |= SPEAKER_ALLOCATION(sadb[0]);
+   else
+   tmp |= SPEAKER_ALLOCATION(5); /* stereo */
+   WREG32_ENDPOINT(0, AZ_F0_CODEC_PIN0_CONTROL_CHANNEL_SPEAKER, tmp);
 }

 void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder,
@@ -167,7 +162,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m
}

if (ASIC_IS_DCE32(rdev)) {
-   dce3_2_afmt_write_speaker_allocation(encoder);
+   radeon_audio_write_speaker_allocation(encoder);
radeon_audio_write_sad_regs(encoder);
}

diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index f263eaa..a24c95a 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -144,40 +144,19 @@ void dce6_afmt_write_latency_fields(struct drm_encoder 
*encoder,
WREG32_ENDPOINT(offset, AZ_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC, tmp);
 }

-void dce6_afmt_write_speaker_allocation(struct drm_encoder *encoder)
+void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
+   u8 *sadb, int sad_count)
 {
struct radeon_device *rdev = encoder->dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
-   struct drm_connector *connector;
-   struct radeon_connector *radeon_connector = NULL;
u32 offset, tmp;
-   u8 *sadb = NULL;
-   int sad_count;

if (!dig || !dig->afmt || !dig->afmt->pin)
return;

offset = dig->afmt->pin->offset;

-   list_for_each_entry(connector, 
>dev->mode_config.connector_list, head) {
-   if (connector->encoder == encoder) {
-   radeon_connector = to_radeon_connector(connector);
-   break;
-   }
-   }
-
-   if (!radeon_connector) {
-   DRM_ERROR("Couldn't find 

[PATCH 03/24] radeon/audio: consolidate write_sad_regs() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce3_1_afmt.c| 35 +++-
 drivers/gpu/drm/radeon/dce6_afmt.c  | 34 +++-
 drivers/gpu/drm/radeon/evergreen_hdmi.c | 38 -
 drivers/gpu/drm/radeon/radeon_audio.c   | 72 +
 drivers/gpu/drm/radeon/radeon_audio.h   |  4 +-
 5 files changed, 93 insertions(+), 90 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c 
b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index 2fe8cfc..c74431e 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -24,6 +24,7 @@
 #include 
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "radeon_audio.h"
 #include "r600d.h"

 static void dce3_2_afmt_write_speaker_allocation(struct drm_encoder *encoder)
@@ -67,14 +68,11 @@ static void dce3_2_afmt_write_speaker_allocation(struct 
drm_encoder *encoder)
kfree(sadb);
 }

-static void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder)
+void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder,
+   struct cea_sad *sads, int sad_count)
 {
+   int i;
struct radeon_device *rdev = encoder->dev->dev_private;
-   struct drm_connector *connector;
-   struct radeon_connector *radeon_connector = NULL;
-   struct cea_sad *sads;
-   int i, sad_count;
-
static const u16 eld_reg_to_type[][2] = {
{ AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR0, 
HDMI_AUDIO_CODING_TYPE_PCM },
{ AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR1, 
HDMI_AUDIO_CODING_TYPE_AC3 },
@@ -90,25 +88,6 @@ static void dce3_2_afmt_write_sad_regs(struct drm_encoder 
*encoder)
{ AZ_F0_CODEC_PIN0_CONTROL_AUDIO_DESCRIPTOR13, 
HDMI_AUDIO_CODING_TYPE_WMA_PRO },
};

-   list_for_each_entry(connector, 
>dev->mode_config.connector_list, head) {
-   if (connector->encoder == encoder) {
-   radeon_connector = to_radeon_connector(connector);
-   break;
-   }
-   }
-
-   if (!radeon_connector) {
-   DRM_ERROR("Couldn't find encoder's connector\n");
-   return;
-   }
-
-   sad_count = drm_edid_to_sad(radeon_connector->edid, );
-   if (sad_count < 0) {
-   DRM_ERROR("Couldn't read SADs: %d\n", sad_count);
-   return;
-   }
-   BUG_ON(!sads);
-
for (i = 0; i < ARRAY_SIZE(eld_reg_to_type); i++) {
u32 value = 0;
u8 stereo_freqs = 0;
@@ -135,10 +114,8 @@ static void dce3_2_afmt_write_sad_regs(struct drm_encoder 
*encoder)

value |= SUPPORTED_FREQUENCIES_STEREO(stereo_freqs);

-   WREG32(eld_reg_to_type[i][0], value);
+   WREG32_ENDPOINT(0, eld_reg_to_type[i][0], value);
}
-
-   kfree(sads);
 }

 /*
@@ -191,7 +168,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, 
struct drm_display_mode *m

if (ASIC_IS_DCE32(rdev)) {
dce3_2_afmt_write_speaker_allocation(encoder);
-   dce3_2_afmt_write_sad_regs(encoder);
+   radeon_audio_write_sad_regs(encoder);
}

WREG32(HDMI0_ACR_PACKET_CONTROL + offset,
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index 821f53c..f263eaa 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -192,17 +192,14 @@ void dce6_afmt_write_speaker_allocation(struct 
drm_encoder *encoder)
kfree(sadb);
 }

-void dce6_afmt_write_sad_regs(struct drm_encoder *encoder)
+void dce6_afmt_write_sad_regs(struct drm_encoder *encoder,
+   struct cea_sad *sads, int sad_count)
 {
-   struct radeon_device *rdev = encoder->dev->dev_private;
+   u32 offset;
+   int i;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
-   u32 offset;
-   struct drm_connector *connector;
-   struct radeon_connector *radeon_connector = NULL;
-   struct cea_sad *sads;
-   int i, sad_count;
-
+   struct radeon_device *rdev = encoder->dev->dev_private;
static const u16 eld_reg_to_type[][2] = {
{ AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR0, 
HDMI_AUDIO_CODING_TYPE_PCM },
{ AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR1, 
HDMI_AUDIO_CODING_TYPE_AC3 },
@@ -223,25 +220,6 @@ void dce6_afmt_write_sad_regs(struct drm_encoder *encoder)

offset = dig->afmt->pin->offset;

-   list_for_each_entry(connector, 
>dev->mode_config.connector_list, head) {
-   if (connector->encoder == encoder) {
-   radeon_connector = to_radeon_connector(connector);
-   break;
-   }
-   }
-
-   if (!radeon_connector) {
-   DRM_ERROR("Couldn't find encoder's 

[PATCH 02/24] radeon/audio: defined initial audio interface that gets initialized via detect() call

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/dce6_afmt.c |  9 +--
 drivers/gpu/drm/radeon/radeon.h|  3 +
 drivers/gpu/drm/radeon/radeon_audio.c  | 96 +-
 drivers/gpu/drm/radeon/radeon_audio.h  | 26 
 drivers/gpu/drm/radeon/radeon_connectors.c |  8 +++
 drivers/gpu/drm/radeon/radeon_mode.h   |  1 +
 6 files changed, 136 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index a97fb22..821f53c 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -23,9 +23,10 @@
 #include 
 #include 
 #include "radeon.h"
+#include "radeon_audio.h"
 #include "sid.h"

-static u32 dce6_endpoint_rreg(struct radeon_device *rdev,
+u32 dce6_endpoint_rreg(struct radeon_device *rdev,
  u32 block_offset, u32 reg)
 {
unsigned long flags;
@@ -39,7 +40,7 @@ static u32 dce6_endpoint_rreg(struct radeon_device *rdev,
return r;
 }

-static void dce6_endpoint_wreg(struct radeon_device *rdev,
+void dce6_endpoint_wreg(struct radeon_device *rdev,
   u32 block_offset, u32 reg, u32 v)
 {
unsigned long flags;
@@ -54,10 +55,6 @@ static void dce6_endpoint_wreg(struct radeon_device *rdev,
spin_unlock_irqrestore(>end_idx_lock, flags);
 }

-#define RREG32_ENDPOINT(block, reg) dce6_endpoint_rreg(rdev, (block), (reg))
-#define WREG32_ENDPOINT(block, reg, v) dce6_endpoint_wreg(rdev, (block), 
(reg), (v))
-
-
 static void dce6_afmt_get_connected_pins(struct radeon_device *rdev)
 {
int i;
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 4195e6c..d15e3c0 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1757,6 +1757,9 @@ struct r600_audio {
bool enabled;
struct r600_audio_pin pin[RADEON_MAX_AFMT_BLOCKS];
int num_pins;
+   struct radeon_audio_funcs *hdmi_funcs;
+   struct radeon_audio_funcs *dp_funcs;
+   struct radeon_audio_basic_funcs *funcs;
 };

 /*
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c 
b/drivers/gpu/drm/radeon/radeon_audio.c
index cc835e2..36174b6 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -23,12 +23,18 @@
  */

 #include 
+#include 
 #include "radeon.h"
+#include "atom.h"
+#include "radeon_audio.h"

 void r600_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
u8 enable_mask);
 void dce6_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
u8 enable_mask);
+u32 dce6_endpoint_rreg(struct radeon_device *rdev, u32 offset, u32 reg);
+void dce6_endpoint_wreg(struct radeon_device *rdev,
+   u32 offset, u32 reg, u32 v);

 static const u32 pin_offsets[7] =
 {
@@ -41,6 +47,43 @@ static const u32 pin_offsets[7] =
(0x5e90 - 0x5e00),
 };

+static u32 radeon_audio_rreg(struct radeon_device *rdev, u32 offset, u32 reg)
+{
+   return RREG32(reg);
+}
+
+static void radeon_audio_wreg(struct radeon_device *rdev, u32 offset,
+   u32 reg, u32 v)
+{
+   WREG32(reg, v);
+}
+
+static struct radeon_audio_basic_funcs dce32_funcs = {
+   .endpoint_rreg = radeon_audio_rreg,
+   .endpoint_wreg = radeon_audio_wreg,
+};
+
+static struct radeon_audio_basic_funcs dce4_funcs = {
+   .endpoint_rreg = radeon_audio_rreg,
+   .endpoint_wreg = radeon_audio_wreg,
+};
+
+static struct radeon_audio_basic_funcs dce6_funcs = {
+   .endpoint_rreg = dce6_endpoint_rreg,
+   .endpoint_wreg = dce6_endpoint_wreg,
+};
+
+static void radeon_audio_interface_init(struct radeon_device *rdev)
+{
+   if (ASIC_IS_DCE6(rdev)) {
+   rdev->audio.funcs = _funcs;
+   } else if (ASIC_IS_DCE4(rdev)) {
+   rdev->audio.funcs = _funcs;
+   } else {
+   rdev->audio.funcs = _funcs;
+   }
+}
+
 static int radeon_audio_chipset_supported(struct radeon_device *rdev)
 {
return ASIC_IS_DCE2(rdev) && !ASIC_IS_NODCE(rdev);
@@ -79,12 +122,63 @@ int radeon_audio_init(struct radeon_device *rdev)
rdev->audio.pin[i].connected = false;
rdev->audio.pin[i].offset = pin_offsets[i];
rdev->audio.pin[i].id = i;
-   /* disable audio.  it will be set up later */
+   }
+
+   radeon_audio_interface_init(rdev);
+
+   /* disable audio.  it will be set up later */
+   for (i = 0; i < rdev->audio.num_pins; i++)
if (ASIC_IS_DCE6(rdev))
dce6_audio_enable(rdev, >audio.pin[i], false);
else
r600_audio_enable(rdev, >audio.pin[i], false);
+
+   return 0;
+}
+
+void radeon_audio_detect(struct drm_connector *connector,
+   enum drm_connector_status status)
+{
+   if (!connector || 

[PATCH 01/24] radeon/audio: consolidate audio_init() functions

2015-01-13 Thread Alex Deucher
From: Slava Grigorev 

Signed-off-by: Slava Grigorev 
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/Makefile   |  2 +-
 drivers/gpu/drm/radeon/cik.c  |  3 +-
 drivers/gpu/drm/radeon/dce6_afmt.c| 54 -
 drivers/gpu/drm/radeon/evergreen.c|  3 +-
 drivers/gpu/drm/radeon/ni.c   | 13 ++---
 drivers/gpu/drm/radeon/r600.c |  3 +-
 drivers/gpu/drm/radeon/r600_hdmi.c| 32 -
 drivers/gpu/drm/radeon/radeon_asic.h  |  2 -
 drivers/gpu/drm/radeon/radeon_audio.c | 90 +++
 drivers/gpu/drm/radeon/radeon_audio.h | 29 +++
 drivers/gpu/drm/radeon/rs600.c|  3 +-
 drivers/gpu/drm/radeon/rs690.c|  3 +-
 drivers/gpu/drm/radeon/rv770.c|  3 +-
 drivers/gpu/drm/radeon/si.c   |  3 +-
 14 files changed, 138 insertions(+), 105 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/radeon_audio.c
 create mode 100644 drivers/gpu/drm/radeon/radeon_audio.h

diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile
index 12bc212..fdcebf7 100644
--- a/drivers/gpu/drm/radeon/Makefile
+++ b/drivers/gpu/drm/radeon/Makefile
@@ -81,7 +81,7 @@ radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \
rv770_smc.o cypress_dpm.o btc_dpm.o sumo_dpm.o sumo_smc.o trinity_dpm.o 
\
trinity_smc.o ni_dpm.o si_smc.o si_dpm.o kv_smc.o kv_dpm.o ci_smc.o \
ci_dpm.o dce6_afmt.o radeon_vm.o radeon_ucode.o radeon_ib.o radeon_mn.o 
\
-   radeon_sync.o
+   radeon_sync.o radeon_audio.o

 # add async DMA block
 radeon-y += \
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 6dcde37..16b6fa8 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -27,6 +27,7 @@
 #include "drmP.h"
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "radeon_audio.h"
 #include "cikd.h"
 #include "atom.h"
 #include "cik_blit_shaders.h"
@@ -8482,7 +8483,7 @@ static int cik_startup(struct radeon_device *rdev)
return r;
}

-   r = dce6_audio_init(rdev);
+   r = radeon_audio_init(rdev);
if (r)
return r;

diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c 
b/drivers/gpu/drm/radeon/dce6_afmt.c
index f312edf..a97fb22 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -277,11 +277,6 @@ void dce6_afmt_write_sad_regs(struct drm_encoder *encoder)
kfree(sads);
 }

-static int dce6_audio_chipset_supported(struct radeon_device *rdev)
-{
-   return !ASIC_IS_NODCE(rdev);
-}
-
 void dce6_audio_enable(struct radeon_device *rdev,
   struct r600_audio_pin *pin,
   u8 enable_mask)
@@ -293,55 +288,6 @@ void dce6_audio_enable(struct radeon_device *rdev,
enable_mask ? AUDIO_ENABLED : 0);
 }

-static const u32 pin_offsets[7] =
-{
-   (0x5e00 - 0x5e00),
-   (0x5e18 - 0x5e00),
-   (0x5e30 - 0x5e00),
-   (0x5e48 - 0x5e00),
-   (0x5e60 - 0x5e00),
-   (0x5e78 - 0x5e00),
-   (0x5e90 - 0x5e00),
-};
-
-int dce6_audio_init(struct radeon_device *rdev)
-{
-   int i;
-
-   if (!radeon_audio || !dce6_audio_chipset_supported(rdev))
-   return 0;
-
-   rdev->audio.enabled = true;
-
-   if (ASIC_IS_DCE81(rdev)) /* KV: 4 streams, 7 endpoints */
-   rdev->audio.num_pins = 7;
-   else if (ASIC_IS_DCE83(rdev)) /* KB: 2 streams, 3 endpoints */
-   rdev->audio.num_pins = 3;
-   else if (ASIC_IS_DCE8(rdev)) /* BN/HW: 6 streams, 7 endpoints */
-   rdev->audio.num_pins = 7;
-   else if (ASIC_IS_DCE61(rdev)) /* TN: 4 streams, 6 endpoints */
-   rdev->audio.num_pins = 6;
-   else if (ASIC_IS_DCE64(rdev)) /* OL: 2 streams, 2 endpoints */
-   rdev->audio.num_pins = 2;
-   else /* SI: 6 streams, 6 endpoints */
-   rdev->audio.num_pins = 6;
-
-   for (i = 0; i < rdev->audio.num_pins; i++) {
-   rdev->audio.pin[i].channels = -1;
-   rdev->audio.pin[i].rate = -1;
-   rdev->audio.pin[i].bits_per_sample = -1;
-   rdev->audio.pin[i].status_bits = 0;
-   rdev->audio.pin[i].category_code = 0;
-   rdev->audio.pin[i].connected = false;
-   rdev->audio.pin[i].offset = pin_offsets[i];
-   rdev->audio.pin[i].id = i;
-   /* disable audio.  it will be set up later */
-   dce6_audio_enable(rdev, >audio.pin[i], false);
-   }
-
-   return 0;
-}
-
 void dce6_audio_fini(struct radeon_device *rdev)
 {
int i;
diff --git a/drivers/gpu/drm/radeon/evergreen.c 
b/drivers/gpu/drm/radeon/evergreen.c
index 85995b4..406ea8e 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -26,6 +26,7 @@
 #include 
 #include "radeon.h"
 #include "radeon_asic.h"
+#include "radeon_audio.h"
 #include 
 #include 

[PATCH 00/24] radeon audio rework

2015-01-13 Thread Alex Deucher
This patch set cleans up the radeon audio handling
and also adds support for DP audio on all supported
asics.

Alex Deucher (1):
  drm/radeon: whitespace clean up in radeon_audio.c

Slava Grigorev (23):
  radeon/audio: consolidate audio_init() functions
  radeon/audio: defined initial audio interface that gets initialized
via detect() call
  radeon/audio: consolidate write_sad_regs() functions
  radeon/audio: consolidate write_speaker_allocation() functions
  radeon/audio: consolidate write_latency_fields() functions
  radeon/audio: consolidate audio_get_pin() functions
  radeon/audio: consolidate select_pin() functions
  radeon/audio: consolidate audio_enable() functions
  radeon/audio: consolidate audio_fini() functions
  radeon/audio: consolidate audio_set_dto() functions
  radeon/audio: consolidate update_avi_infoframe() functions
  radeon/audio: consolidate update_acr() functions
  radeon/audio: moved VBI packet programming to separate functions
  radeon: moved HDMI color depth programming to a separate function
  radeon/audio: removed unnecessary CRC control programing
  radeon/audio: set_avi_packet() function cleanup
  radeon/audio: moved audio packet programming to a separate function
  radeon/audio: moved mute programming to a separate function
  radeon/audio: removed unnecessary debug settings
  radeon/audio: consolidate audio_mode_set() functions
  radeon/audio: applied audio_dpms() and audio_mode_set() calls
  radeon/audio: moved audio caps programming to audio_hotplug() function
  radeon/audio: enable DP audio

 drivers/gpu/drm/radeon/Makefile|   2 +-
 drivers/gpu/drm/radeon/atombios_encoders.c |  29 +-
 drivers/gpu/drm/radeon/cik.c   |   5 +-
 drivers/gpu/drm/radeon/dce3_1_afmt.c   | 264 +-
 drivers/gpu/drm/radeon/dce6_afmt.c | 218 
 drivers/gpu/drm/radeon/evergreen.c |   7 +-
 drivers/gpu/drm/radeon/evergreen_hdmi.c| 478 --
 drivers/gpu/drm/radeon/evergreen_reg.h |  15 +
 drivers/gpu/drm/radeon/evergreend.h|   1 +
 drivers/gpu/drm/radeon/ni.c|  18 +-
 drivers/gpu/drm/radeon/r600.c  |   7 +-
 drivers/gpu/drm/radeon/r600_hdmi.c | 387 ---
 drivers/gpu/drm/radeon/radeon.h|   3 +
 drivers/gpu/drm/radeon/radeon_asic.c   |  28 --
 drivers/gpu/drm/radeon/radeon_asic.h   |   8 -
 drivers/gpu/drm/radeon/radeon_audio.c  | 765 +
 drivers/gpu/drm/radeon/radeon_audio.h  |  84 
 drivers/gpu/drm/radeon/radeon_connectors.c |   8 +
 drivers/gpu/drm/radeon/radeon_mode.h   |   1 +
 drivers/gpu/drm/radeon/rs600.c |   7 +-
 drivers/gpu/drm/radeon/rs690.c |   7 +-
 drivers/gpu/drm/radeon/rv770.c |   5 +-
 drivers/gpu/drm/radeon/si.c|   5 +-
 drivers/gpu/drm/radeon/sid.h   |  10 +
 24 files changed, 1458 insertions(+), 904 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/radeon_audio.c
 create mode 100644 drivers/gpu/drm/radeon/radeon_audio.h

-- 
1.8.3.1



[PATCH v9 1/4] drm/i2c: tda998x: Add DT support for audio

2015-01-13 Thread Russell King - ARM Linux
On Tue, Jan 13, 2015 at 01:21:58PM +0100, Philipp Zabel wrote:
> I wonder if it wouldn't be nicer to have the AP# and type in the device
> tree and then calculate the register value from that in the driver.
> 
>   port at 1 {
>   reg = <1>; /* AP1 */
>   nxp,audio-port = "i2s";
>   tda998x_i2s: endpoint {
>   remote-endpoint = <_i2s>;
>   };
>   };

What about the case where we have 4 I2S streams being supplied to the
device on four separate AP inputs?

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


[Bug 88152] 720p and 1080 H.264 videos lock-up on playback with vlc / vdpau on Radeon 3850HD

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=88152

--- Comment #12 from Arthur Marsh  ---
Created attachment 112167
  --> https://bugs.freedesktop.org/attachment.cgi?id=112167=edit
2015011322dmesg.txt dmesg output with GPU lockup when VLC_VERBOSE=2

-- 
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/20150113/8c86db52/attachment.html>


[Bug 88152] 720p and 1080 H.264 videos lock-up on playback with vlc / vdpau on Radeon 3850HD

2015-01-13 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=88152

--- Comment #11 from Arthur Marsh  ---
Created attachment 112166
  --> https://bugs.freedesktop.org/attachment.cgi?id=112166=edit
vlcdebug2.log, output from running vlc with VLC_VERBOSE=2

-- 
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/20150113/13f24d29/attachment.html>


  1   2   >