[Bug 73420] [HAWAII] atombios stuck executing errors

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=73420

Luzipher  changed:

   What|Removed |Added

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

--- Comment #20 from Luzipher  ---
New bug for the dpm issues is:
https://bugs.freedesktop.org/show_bug.cgi?id=74250

The patch from attachement 93015 causes the message about
ci_upload_dpm_level_enable_mask failing (the message does not appear without
the patch).

I'm changing status to resolved fixed, as the patch for the original issue is
already committed and in drm-next.

-- 
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/20140130/78857d94/attachment.html>


[Bug 74250] [HAWAII][DPM] New Version 3.1 for ASIC_ProfilingInfo / ci_upload_dpm_level_enable_mask failed

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=74250

--- Comment #1 from Luzipher  ---
Created attachment 93093
  --> https://bugs.freedesktop.org/attachment.cgi?id=93093=edit
dmesg with a patched kernel

-- 
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/20140130/dc89fcd7/attachment.html>


[Bug 74250] New: [HAWAII][DPM] New Version 3.1 for ASIC_ProfilingInfo / ci_upload_dpm_level_enable_mask failed

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=74250

  Priority: medium
Bug ID: 74250
  Assignee: dri-devel at lists.freedesktop.org
   Summary: [HAWAII][DPM] New Version 3.1 for ASIC_ProfilingInfo /
ci_upload_dpm_level_enable_mask failed
  Severity: normal
Classification: Unclassified
OS: Linux (All)
  Reporter: luziphermcleod at yahoo.ie
  Hardware: x86-64 (AMD64)
Status: NEW
   Version: unspecified
 Component: DRM/Radeon
   Product: DRI

Created attachment 93090
  --> https://bugs.freedesktop.org/attachment.cgi?id=93090=edit
dmesg WITHOUT the patch

Observation:


System starts up fine (radeondrmfb high res text mode), but I get eight of the
following error messages in dmesg:
[drm:radeon_atom_get_leakage_vddc_based_on_leakage_params] *ERROR* Unknown
table version 3, 1

With the patch from Bug 73420 (
https://bugs.freedesktop.org/attachment.cgi?id=93015 ) I don't get those
messages, but one occurance of:
[drm:ci_dpm_set_power_state] *ERROR* ci_upload_dpm_level_enable_mask failed

Without the patch, I do NOT get the "ci_upload_dpm_level_enable_mask failed
" message.


Software Details:
=

0) Gentoo Linux
1) Kernel: drm-next (airlied's from
http://cgit.freedesktop.org/~airlied/linux/?h=drm-next , commit
ef64cf9d06049e4e9df661f3be60b217e476bee1)
2) libdrm: git
3) mesa: git
4) Xorg-server: 1.15.0
5) xf86-video-ati: git
6) glamor: git
7) llvm: 3.5svn (updated on 30.01.2014)
8) pixman: git

(All git versions were updated on 30.01.2014)

Hardware Details:
=

Graphics Card: Hawaii XT, Sapphire Radeon R9 290X Tri-X OC (11226-00-50G)
Graphics Chip: HAWAII 0x1002:0x67B0 0x174B:0xE285
Monitors: 3 (HP LP2475w via DVI, Samsung 214T via DVI, Samsung TV via HDMI)
Processor: Core i7-965 (LGA 1366)
Mainboard: Asus P6T Deluxe
RAM: 6GB

-- 
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/20140130/bca35285/attachment-0001.html>


[Bug 60879] [radeonsi] X11 can't start with acceleration enabled

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=60879

--- Comment #60 from Tom Stellard  ---
(In reply to comment #59)
> (In reply to comment #58)
> > Default raster_config = 0x2a00126a
> > rb mask = 255
> > Final raster_config = 0x2a00126a
> 
> The patch didn't modify the raster_config value, so either it's not correct
> yet, or the kernel is providing incorrect information about which backends
> are enabled.

The RB mask is 255, which means all 8 rbs are enabled, so either the kernel is
providing the wrong information or there is something else besides the
raster_config that we need to fix.

-- 
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/20140130/5a10ec4f/attachment.html>


[Bug 71448] [UVD] qvdpautest is very slow on radeonsi (HD 7950)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=71448

--- Comment #34 from Alex Deucher  ---
(In reply to comment #33)
> Any chance to get it merged in time for 3.14?

Yes, it'll show up in 3.14 and the 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/20140130/054fd5b0/attachment.html>


[Bug 71448] [UVD] qvdpautest is very slow on radeonsi (HD 7950)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=71448

--- Comment #33 from darkbasic  ---
I confirm the patch works on top of drm-next:

MPEG DECODING (1920x1080): 77 frames/s
MPEG DECODING (1280x720): 117 frames/s
H264 DECODING (1920x1080): 51 frames/s
H264 DECODING (1280x720): 91 frames/s
Profile unsupported.
MPEG4 DECODING (1920x1080): 72 frames/s

Any chance to get it merged in time for 3.14?

-- 
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/20140130/6586fab8/attachment.html>


[PATCH v2 2/5] ASoC: tda998x: add a codec driver for TDA998x

2014-01-30 Thread Mark Brown
On Sun, Jan 26, 2014 at 07:45:36PM +0100, Jean-Francois Moine wrote:

> +static void tda_get_encoder(struct tda_priv *priv)
> +{
> + struct snd_soc_codec *codec = priv->codec;
> + struct device_node *np;
> + struct i2c_client *i2c_client;
> + static const struct of_device_id tda_dt[] = {
> + { .compatible = "nxp,tda998x" },
> + { },
> + };
> +
> + /* search the tda998x device */
> + np = of_find_matching_node_and_match(NULL, tda_dt, NULL);
> + if (!np || !of_device_is_available(np)) {
> + dev_err(codec->dev, "No tda998x in DT\n");
> + return;
> + }
> + i2c_client = of_find_i2c_device_by_node(np);

Like I said last time I'd really expect this to look like a MFD (or
generally a proper CODEC driver) so we don't get this weird probe
ordering stuff.  If you don't think that's sensible for some reason it'd
be helpful to understand why.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20140130/875438f4/attachment-0001.pgp>


[Bug 71448] [UVD] qvdpautest is very slow on radeonsi (HD 7950)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=71448

--- Comment #32 from Alex Deucher  ---
(In reply to comment #29)
> With this patch I get gpu lockup and Xorg crash. kernel 3.13.1, mesa-git,
> llvm-svn, Archlinux x86.

Are you sure this lockup isn't caused by some other upgrade you did such as
mesa?  The patch works fine here.

-- 
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/20140130/649f394c/attachment.html>


[Bug 71448] [UVD] qvdpautest is very slow on radeonsi (HD 7950)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=71448

--- Comment #31 from Vladimir Ysikov  ---
Created attachment 93085
  --> https://bugs.freedesktop.org/attachment.cgi?id=93085=edit
Xorg 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/20140130/f2ead54d/attachment.html>


[Bug 71448] [UVD] qvdpautest is very slow on radeonsi (HD 7950)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=71448

--- Comment #30 from Vladimir Ysikov  ---
Created attachment 93084
  --> https://bugs.freedesktop.org/attachment.cgi?id=93084=edit
dmesg output

-- 
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/20140130/de7d45ba/attachment.html>


[Bug 71448] [UVD] qvdpautest is very slow on radeonsi (HD 7950)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=71448

--- Comment #29 from Vladimir Ysikov  ---
(In reply to comment #28)
> Created attachment 93072 [details]
> Fix.
> 
> Sorry that it took me so long to find this. It's a rather simple issue that
> the IRQ support for UVD on SI wasn't activated.
> 
> With this patch in place I now get 52fps with 1080p H264 decoding.

With this patch I get gpu lockup and Xorg crash. kernel 3.13.1, mesa-git,
llvm-svn, Archlinux x86.

-- 
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/20140130/073f34fd/attachment.html>


[PATCH] drm/radeon: fix UVD IRQ support on SI

2014-01-30 Thread Christian König
From: Christian K?nig 

Otherwise decoding isn't really useable.

Signed-off-by: Christian K?nig 
Cc: stable at vger.kernel.org
---
 drivers/gpu/drm/radeon/si.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 07ce587..a22df95 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -6334,6 +6334,10 @@ restart_ih:
break;
}
break;
+   case 124: /* UVD */
+   DRM_DEBUG("IH: UVD int: 0x%08x\n", src_data);
+   radeon_fence_process(rdev, R600_RING_TYPE_UVD_INDEX);
+   break;
case 146:
case 147:
addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR);
-- 
1.8.1.2



[PATCH] drm/nouveau: set irq_enabled manually

2014-01-30 Thread Jan Janecek
2014-01-30, Ilia Mirkin :
> On Thu, Jan 30, 2014 at 3:33 AM, Daniel Vetter  wrote:
>> On Thu, Jan 30, 2014 at 1:53 AM, Ilia Mirkin 
>> wrote:
>>> Since commit 0fa9061ae8c ("drm/nouveau/mc: handle irq-related setup
>>> ourselves"), drm_device->irq_enabled remained unset. This is needed in
>>> order to properly wait for a vblank event in the generic drm code.
>>>
>>> See https://bugs.freedesktop.org/show_bug.cgi?id=74195
>>>
>>> Reported-by: Jan Janecek 
>>> Signed-off-by: Ilia Mirkin 
>>> Cc: stable at vger.kernel.org # 3.10+
>>> ---
>>>
>>> TBH, not sure why this fixes things, as irq_enabled == false should have
>>> caused the vblank wait to not wait, since the condition would be
>>> immediately true.
>>>
>>> Jan, mind double-checking that this version of the patch fixes things
>>> for you? Not 100% sure where you stuck the irq_enabled=true line when
>>> you
>>> tried it out.
>>
>> The core drm vblank code bails out if dev->irq_enabled isn't set. So
>
> Right. And what I'm unclear on is how does bailing out on vblank wait
> cause the originally reported issue -- sluggishness. That seems to
> imply that one is waiting too long rather than not waiting enough.
>
>> if you opt to not use the drm irq helpers and instead roll your own
>> you still need to set this to allow vblank wait ioctls and related
>> stuff. It's even documented in the drm DocBook ;-) So
>>
>> Reviewed-by: Daniel Vetter 
>>
>> if you will.
>>
>> Cheers, Daniel
>> --
>> Daniel Vetter
>> Software Engineer, Intel Corporation
>> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
>

Now I have noticed one more thing:

If you disable GLXVblank globally in xorg.conf in the non-fixed
version, the compton is not able to vsync at all. If you enable it
globally, compton probably still can't use DRM_IOCTL_WAIT_VBLANK
properly, but is forced to vsync using some other method (i guess?)
resulting in "slugishness".
With the fixed version the compton achieves vsync with great
responsiveness using DRM_IOCTL_WAIT_VBLANK, regardless of the
GLXVblank setting in xorg.conf.


[alsa-devel] [PATCH RFC v3 0/8] Beaglebone-Black HDMI audio

2014-01-30 Thread Jean-Francois Moine
On Thu, 30 Jan 2014 14:20:56 +0200
Jyri Sarha  wrote:

> I am having trouble getting the tda998x-codec working on BBB. The 
> problem is I do not have a DT node for the tda998x driver. Instead I 
> have tilcdc-slave node that provides pdata for the tda-driver.
> 
> I am thinking of solving the problem by adding a reference to the 
> i2c-adapter hosting tda998x as an optional DT property to the codec 
> node. I could then dig the driver instance from the i2c adapter's 
> children. Any better ideas?

I better think about a 'normal' DT definition:

- in the DT, define the tda998x in a i2c subnode:

   {
tda998x: hdmi-encoder {
compatible = "nxp,tda998x";
reg = <0x70>;
/* the video ports are OK by default */
/* define the interrupt if you want to use it */
};
  };

- in tilcdc_slave.c, in the function slave_encoder_create(), instead of
  using drm_i2c_encoder_init(), do quite the same, but without calling
  request_module() nor i2c_new_device().

  This can be done as follows (the code is not compiled):

8<-
static struct drm_encoder *slave_encoder_create(struct drm_device *dev,
struct slave_module *mod)
{
struct slave_encoder *slave_encoder;
struct drm_encoder *encoder;
int ret;
/* -- added -- */
struct device_node *np;
static const struct of_device_id tda_dt[] = {
{ .compatible = "nxp,tda998x" },
{ },
};
/* -- end added -- */

... no change ...

 drm_encoder_helper_add(encoder, _encoder_helper_funcs);

/* -- added -- */

/* search the tda998x device */
np = of_find_matching_node_and_match(NULL, tda_dt, NULL);
if (np && of_device_is_available(np)) {
struct i2c_client *i2c_client;
struct drm_i2c_encoder_driver *encoder_drv;
struct module *module;

/* the tda998x is in the DT */

i2c_client = of_find_i2c_device_by_node(np);
of_node_put(np);
if (!i2c_client) {
dev_err(dev->dev, "no tda998x i2c client\n");
goto fail;
}

to_encoder_slave(encoder)->bus_priv = i2c_client;

encoder_drv = to_drm_i2c_encoder_driver(
to_i2c_driver(i2c_client->dev.driver));

/* lock the tda998x module in memory */
module = to_i2c_driver(i2c_client->dev.driver)->driver.owner;
if (!module || !try_module_get(module)) {
dev_err(dev->dev, "cannot get module %s\n", 
module->name);
goto fail;
}

ret = encoder_drv->encoder_init(i2c_client, dev, encoder_slave);
if (ret < 0) {
dev_err(dev->dev, "slave encoder init failed\n");
module_put(module);
goto fail;
}
/* set_config is useless */
return encoder;
}

/* -- end added -- */

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

return encoder;

fail:
slave_encoder_destroy(encoder);
return NULL;
}
8<-

When the tda998x is in the DT, the i2c_client is already created.
It must not be freed, and so, the function drm_i2c_encoder_destroy()
must not be called. But, the module must be explicitly unlocked in
slave_encoder_destroy(), and then, there must be some flag in the
structures for this job to be done...

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


[Bug 69120] With dpm=1 vdpau is not usable

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=69120

--- Comment #25 from Chris Humbert  ---
Created attachment 93076
  --> https://bugs.freedesktop.org/attachment.cgi?id=93076=edit
cedar-3.13.1-xorg

-- 
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/20140130/0b9184ae/attachment.html>


[Bug 69120] With dpm=1 vdpau is not usable

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=69120

--- Comment #24 from Chris Humbert  ---
Created attachment 93075
  --> https://bugs.freedesktop.org/attachment.cgi?id=93075=edit
cedar-3.13.1-dmesg

radeon.dpm=1 vdpau causes Cedar [HD 5450] to GPU lockup CP stall immediately.
The player hangs with a black window.
radeon.dpm=0 vdpau works very well.

01:00.0 VGA compatible controller: [AMD/ATI] Cedar [Radeon HD 5450]
Linux 3.13.1, xf86-video-ati 7.3.0, mesa 9.5

[  107.875202] switching to power state:
[  107.875203]  ui class: none
[  107.875204]  internal class: uvd 
[  107.875206]  caps: video 
[  107.875208]  uvdvclk: 54000 dclk: 4
[  107.875210]  power level 0sclk: 65000 mclk: 4 vddc: 1070
vddci: 0
[  107.875212]  power level 1sclk: 65000 mclk: 4 vddc: 1070
vddci: 0
[  107.875213]  power level 2sclk: 65000 mclk: 4 vddc: 1070
vddci: 0
[  107.875214]  status: r 
[  108.178542] [drm:cypress_dpm_set_power_state] *ERROR*
rv770_restrict_performance_levels_before_switch failed
[  118.396040] radeon :01:00.0: GPU lockup CP stall for more than 10068msec
[  118.396046] radeon :01:00.0: GPU lockup (waiting for 0x0004
last fence id 0x0002 on ring 5)
[  118.545687] [drm:rv770_stop_dpm] *ERROR* Could not force DPM to low.
[  118.545698] [drm] Disabling audio 0 support
[  118.698386] radeon :01:00.0: GPU reset succeeded, trying to resume

-- 
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/20140130/e5af8a12/attachment-0001.html>


[Bug 69723] GPU lockups with kernel 3.11.0 / 3.12-rc1 when dpm=1 on r600g (Cayman)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=69723

--- Comment #104 from Alexandre Demers  ---
(In reply to comment #103)
> I don't remember if we've tried this recently, but does disabling power
> containment help?
> 
> diff --git a/drivers/gpu/drm/radeon/ni_dpm.c
> b/drivers/gpu/drm/radeon/ni_dpm.c
> index 22c3391..19b7c68 100644
> --- a/drivers/gpu/drm/radeon/ni_dpm.c
> +++ b/drivers/gpu/drm/radeon/ni_dpm.c
> @@ -4250,7 +4250,7 @@ int ni_dpm_init(struct radeon_device *rdev)
> break;
> }
>  
> -   if (ni_pi->cac_weights->enable_power_containment_by_default) {
> +   if (0/*ni_pi->cac_weights->enable_power_containment_by_default*/) {
> ni_pi->enable_power_containment = true;
> ni_pi->enable_cac = true;
> ni_pi->enable_sq_ramping = true;

I don't remember playing with it lately, so I'll try it either later today
(tonight) or tomorrow. I have to complete a report first for a personal
project.

-- 
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/20140130/9a78b522/attachment.html>


[PATCH] drm/radeon: allow geom rings to be setup on r600/r700

2014-01-30 Thread Michel Dänzer
On Don, 2014-01-30 at 14:11 +1000, Dave Airlie wrote:
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index ec8c388..357cffb 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -78,9 +78,10 @@
>   *   2.34.0 - Add CIK tiling mode array query
>   *   2.35.0 - Add CIK macrotile mode array query
>   *   2.36.0 - Fix CIK DCE tiling setup
> + *   2.37.0 - allow ring setup on r6xx/r7xx

'ring setup' is a bit ambiguous, maybe 'GS ring setup'?


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



[PATCH] drm: Fix use-after-free in the shadow-attache exit code

2014-01-30 Thread David Herrmann
Hi

On Thu, Jan 30, 2014 at 5:58 PM, Daniel Vetter  
wrote:
> This regression has been introduced in
>
> commit b3f2333de8e81b089262b26d52272911523e605f
> Author: Daniel Vetter 
> Date:   Wed Dec 11 11:34:31 2013 +0100
>
> drm: restrict the device list for shadow attached drivers
>
> Reported-by: Dave Jones 
> Cc: Dave Jones 
> Cc: Dave Airlie 
> Cc: David Herrmann 
> Signed-off-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/drm_pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 5736aaa7e86c..f7af69bcf3f4 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -468,8 +468,8 @@ void drm_pci_exit(struct drm_driver *driver, struct 
> pci_driver *pdriver)
> } else {
> list_for_each_entry_safe(dev, tmp, >legacy_dev_list,
>  legacy_dev_list) {
> -   drm_put_dev(dev);
> list_del(>legacy_dev_list);
> +   drm_put_dev(dev);

This code-path is the only user of legacy_dev_list (besides ->probe)
and both are locked against each other. So removing the device before
destroying it is fine. So no objections from me:

Reviewed-by: David Herrmann 

Thanks
David

> }
> }
> DRM_INFO("Module unloaded\n");
> --
> 1.8.5.2
>


[PATCH] drm: Fix use-after-free in the shadow-attache exit code

2014-01-30 Thread Daniel Vetter
This regression has been introduced in

commit b3f2333de8e81b089262b26d52272911523e605f
Author: Daniel Vetter 
Date:   Wed Dec 11 11:34:31 2013 +0100

drm: restrict the device list for shadow attached drivers

Reported-by: Dave Jones 
Cc: Dave Jones 
Cc: Dave Airlie 
Cc: David Herrmann 
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/drm_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 5736aaa7e86c..f7af69bcf3f4 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -468,8 +468,8 @@ void drm_pci_exit(struct drm_driver *driver, struct 
pci_driver *pdriver)
} else {
list_for_each_entry_safe(dev, tmp, >legacy_dev_list,
 legacy_dev_list) {
-   drm_put_dev(dev);
list_del(>legacy_dev_list);
+   drm_put_dev(dev);
}
}
DRM_INFO("Module unloaded\n");
-- 
1.8.5.2



[Bug 71448] [UVD] qvdpautest is very slow on radeonsi (HD 7950)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=71448

--- Comment #28 from Christian K?nig  ---
Created attachment 93072
  --> https://bugs.freedesktop.org/attachment.cgi?id=93072=edit
Fix.

Sorry that it took me so long to find this. It's a rather simple issue that the
IRQ support for UVD on SI wasn't activated.

With this patch in place I now get 52fps with 1080p H264 decoding.

-- 
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/20140130/734dc5bd/attachment.html>


[Bug 69723] GPU lockups with kernel 3.11.0 / 3.12-rc1 when dpm=1 on r600g (Cayman)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=69723

--- Comment #103 from Alex Deucher  ---
I don't remember if we've tried this recently, but does disabling power
containment help?

diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
index 22c3391..19b7c68 100644
--- a/drivers/gpu/drm/radeon/ni_dpm.c
+++ b/drivers/gpu/drm/radeon/ni_dpm.c
@@ -4250,7 +4250,7 @@ int ni_dpm_init(struct radeon_device *rdev)
break;
}

-   if (ni_pi->cac_weights->enable_power_containment_by_default) {
+   if (0/*ni_pi->cac_weights->enable_power_containment_by_default*/) {
ni_pi->enable_power_containment = true;
ni_pi->enable_cac = true;
ni_pi->enable_sq_ramping = true;

-- 
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/20140130/5d58da7d/attachment.html>


[Bug 69301] no screen on update from 3.12.0

2014-01-30 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=69301

--- Comment #10 from Alex Deucher  ---
Does 3.14 (Linus git) work any better?

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


[git pull] drm next tree

2014-01-30 Thread Jiri Kosina
On Thu, 30 Jan 2014, Dave Airlie wrote:

>   git://people.freedesktop.org/~airlied/linux drm-next
[ ... snip ... ]
> Daniel Vetter (59):
[ ... snip ... ]
>   drm/i915: dp aux irq support for g4x/vlv

This commit causes all kinds of havoc on my ThinkPad x200s. It results in

 irq 16: nobody cared (try booting with the "irqpoll" option)
 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.12.0-00854-g4aeebd7 #1
 Hardware name: LENOVO 7470BN2/7470BN2, BIOS 6DET38WW (2.02 ) 12/19/2008
  8800795186c0 88007c203e08 81582503 88007c203e38
  810a6a98 88007c203e88 880079518600 
  0010 88007c203e78 810a6d43 0010ffc4af9d
 Call Trace:
[] dump_stack+0x7a/0x97
  [] __report_bad_irq+0x38/0xf0
  [] note_interrupt+0x1f3/0x240
  [] handle_irq_event_percpu+0x142/0x220
  [] handle_irq_event+0x49/0x70
  [] handle_fasteoi_irq+0x61/0x100
  [] handle_irq+0x59/0x150
  [] ? _local_bh_enable+0xe/0x10
  [] ? irq_enter+0x81/0x90
  [] do_IRQ+0x5b/0xe0
  [] common_interrupt+0x6f/0x6f
[] ? retint_restore_args+0xe/0xe
  [] ? poll_idle+0x47/0x90
  [] ? poll_idle+0x20/0x90
  [] ? ktime_get+0x56/0xd0
  [] cpuidle_enter_state+0x40/0xd0
  [] cpuidle_idle_call+0x10a/0x160
  [] arch_cpu_idle+0x9/0x30
  [] cpu_idle_loop+0x8b/0x270
  [] cpu_startup_entry+0x1e/0x20
  [] rest_init+0xd3/0xe0
  [] ? csum_partial_copy_generic+0x170/0x170
  [] start_kernel+0x3b3/0x461
  [] ? repair_env_string+0x58/0x58
  [] x86_64_start_reservations+0x1b/0x32
  [] x86_64_start_kernel+0x13a/0x141
 handlers:
 [] usb_hcd_irq [usbcore]
 Disabling IRQ #16

and things go south afterwards (the machine hangs randomly, I/O is 
horribly slow, etc etc).

This is the same machine that was the reason for

commit c12aba5aa0e60b7947bc8b6ea25ef55c4acf81a4
Author: Jiri Kosina 
Date:   Tue Mar 19 09:56:57 2013 +0100

drm/i915: stop using GMBUS IRQs on Gen4 chips

back then in 3.9 timeframe, so it might be somehow related. It's, at the 
end of the day, again IRQ 16 -- and see the changelog of c12aba5a why this 
is rather mysterious (IRQ 16 is assigned to the card when it's not using 
MSI, but it *is* in fact using MSI in all the cases).

-- 
Jiri Kosina
SUSE Labs



[PATCH v5 32/34] drm/exynos: Implement drm_connector directly in vidi driver

2014-01-30 Thread Sean Paul
This patch implements drm_connector directly in the vidi
driver, this will allow us to move away from the exynos_drm_connector
layer.

Signed-off-by: Sean Paul 
---

Changes in v3:
 - Added to the patchset
Changes in v4: None
Changes in v5:
 - Resolved merge conflict kruft

 drivers/gpu/drm/exynos/exynos_drm_vidi.c | 162 ---
 1 file changed, 108 insertions(+), 54 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c 
b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 5d0b5cd..7afead9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -29,6 +29,8 @@
 #define WINDOWS_NR 3

 #define get_vidi_mgr(dev)  platform_get_drvdata(to_platform_device(dev))
+#define ctx_from_connector(c)  container_of(c, struct vidi_context, \
+   connector)

 struct vidi_win_data {
unsigned intoffset_x;
@@ -47,6 +49,8 @@ struct vidi_win_data {
 struct vidi_context {
struct drm_device   *drm_dev;
struct drm_crtc *crtc;
+   struct drm_encoder  *encoder;
+   struct drm_connectorconnector;
struct vidi_win_datawin_data[WINDOWS_NR];
struct edid *raw_edid;
unsigned intclkdiv;
@@ -86,60 +90,6 @@ static const char fake_edid_info[] = {
0x00, 0x00, 0x00, 0x06
 };

-static bool vidi_display_is_connected(struct exynos_drm_display *display)
-{
-   struct vidi_context *ctx = display->ctx;
-
-   /*
-* connection request would come from user side
-* to do hotplug through specific ioctl.
-*/
-   return ctx->connected ? true : false;
-}
-
-static struct edid *vidi_get_edid(struct exynos_drm_display *display,
-   struct drm_connector *connector)
-{
-   struct vidi_context *ctx = display->ctx;
-   struct edid *edid;
-
-   /*
-* the edid data comes from user side and it would be set
-* to ctx->raw_edid through specific ioctl.
-*/
-   if (!ctx->raw_edid) {
-   DRM_DEBUG_KMS("raw_edid is null.\n");
-   return ERR_PTR(-EFAULT);
-   }
-
-   edid = drm_edid_duplicate(ctx->raw_edid);
-   if (!edid) {
-   DRM_DEBUG_KMS("failed to allocate edid\n");
-   return ERR_PTR(-ENOMEM);
-   }
-
-   return edid;
-}
-
-static int vidi_check_mode(struct exynos_drm_display *display,
-   struct drm_display_mode *mode)
-{
-   /* TODO. */
-
-   return 0;
-}
-
-static struct exynos_drm_display_ops vidi_display_ops = {
-   .is_connected = vidi_display_is_connected,
-   .get_edid = vidi_get_edid,
-   .check_mode = vidi_check_mode,
-};
-
-static struct exynos_drm_display vidi_display = {
-   .type = EXYNOS_DISPLAY_TYPE_VIDI,
-   .ops = _display_ops,
-};
-
 static void vidi_apply(struct exynos_drm_manager *mgr)
 {
struct vidi_context *ctx = mgr->ctx;
@@ -532,6 +482,110 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, 
void *data,
return 0;
 }

+static enum drm_connector_status vidi_detect(struct drm_connector *connector,
+   bool force)
+{
+   struct vidi_context *ctx = ctx_from_connector(connector);
+
+   /*
+* connection request would come from user side
+* to do hotplug through specific ioctl.
+*/
+   return ctx->connected ? connector_status_connected :
+   connector_status_disconnected;
+}
+
+static void vidi_connector_destroy(struct drm_connector *connector)
+{
+}
+
+static struct drm_connector_funcs vidi_connector_funcs = {
+   .dpms = drm_helper_connector_dpms,
+   .fill_modes = drm_helper_probe_single_connector_modes,
+   .detect = vidi_detect,
+   .destroy = vidi_connector_destroy,
+};
+
+static int vidi_get_modes(struct drm_connector *connector)
+{
+   struct vidi_context *ctx = ctx_from_connector(connector);
+   struct edid *edid;
+   int edid_len;
+
+   /*
+* the edid data comes from user side and it would be set
+* to ctx->raw_edid through specific ioctl.
+*/
+   if (!ctx->raw_edid) {
+   DRM_DEBUG_KMS("raw_edid is null.\n");
+   return -EFAULT;
+   }
+
+   edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH;
+   edid = kmemdup(ctx->raw_edid, edid_len, GFP_KERNEL);
+   if (!edid) {
+   DRM_DEBUG_KMS("failed to allocate edid\n");
+   return -ENOMEM;
+   }
+
+   drm_mode_connector_update_edid_property(connector, edid);
+
+   return drm_add_edid_modes(connector, edid);
+}
+
+static int vidi_mode_valid(struct drm_connector *connector,
+   struct drm_display_mode *mode)
+{
+   return MODE_OK;
+}
+
+static struct drm_encoder *vidi_best_encoder(struct drm_connector *connector)
+{
+   

[PATCH v4 34/34] drm/exynos: Remove the exynos_drm_connector shim

2014-01-30 Thread Sean Paul
This path removes the exynos_drm_connector code since it was just
passing hooks through display_ops. The individual device drivers are now
responsible for implementing drm_connector directly.

Signed-off-by: Sean Paul 
---

Changes in v3:
 - Added to the patchset
Changes in v4: None

 drivers/gpu/drm/exynos/Makefile   |   2 +-
 drivers/gpu/drm/exynos/exynos_drm_connector.c | 258 --
 drivers/gpu/drm/exynos/exynos_drm_connector.h |  20 --
 drivers/gpu/drm/exynos/exynos_drm_core.c  |  18 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |  11 --
 drivers/gpu/drm/exynos/exynos_drm_encoder.c   |   1 -
 6 files changed, 4 insertions(+), 306 deletions(-)
 delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_connector.c
 delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_connector.h

diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index fc8555c..b1839e8 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -3,7 +3,7 @@
 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.

 ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/exynos
-exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o exynos_drm_connector.o \
+exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o \
exynos_drm_crtc.o exynos_drm_fbdev.o exynos_drm_fb.o \
exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \
exynos_drm_plane.o
diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c 
b/drivers/gpu/drm/exynos/exynos_drm_connector.c
deleted file mode 100644
index 9a16dbe..000
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd.
- * Authors:
- * Inki Dae 
- * Joonyoung Shim 
- * Seung-Woo Kim 
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-
-#include 
-#include 
-
-#include 
-#include "exynos_drm_drv.h"
-#include "exynos_drm_encoder.h"
-#include "exynos_drm_connector.h"
-
-#define to_exynos_connector(x) container_of(x, struct exynos_drm_connector,\
-   drm_connector)
-
-struct exynos_drm_connector {
-   struct drm_connectordrm_connector;
-   uint32_tencoder_id;
-   struct exynos_drm_display   *display;
-};
-
-static int exynos_drm_connector_get_modes(struct drm_connector *connector)
-{
-   struct exynos_drm_connector *exynos_connector =
-   to_exynos_connector(connector);
-   struct exynos_drm_display *display = exynos_connector->display;
-   struct edid *edid = NULL;
-   unsigned int count = 0;
-   int ret;
-
-   /*
-* if get_edid() exists then get_edid() callback of hdmi side
-* is called to get edid data through i2c interface else
-* get timing from the FIMD driver(display controller).
-*
-* P.S. in case of lcd panel, count is always 1 if success
-* because lcd panel has only one mode.
-*/
-   if (display->ops->get_edid) {
-   edid = display->ops->get_edid(display, connector);
-   if (IS_ERR_OR_NULL(edid)) {
-   ret = PTR_ERR(edid);
-   edid = NULL;
-   DRM_ERROR("Panel operation get_edid failed %d\n", ret);
-   goto out;
-   }
-
-   count = drm_add_edid_modes(connector, edid);
-   if (!count) {
-   DRM_ERROR("Add edid modes failed %d\n", count);
-   goto out;
-   }
-
-   drm_mode_connector_update_edid_property(connector, edid);
-   } else {
-   struct exynos_drm_panel_info *panel;
-   struct drm_display_mode *mode = drm_mode_create(connector->dev);
-   if (!mode) {
-   DRM_ERROR("failed to create a new display mode.\n");
-   return 0;
-   }
-
-   if (display->ops->get_panel)
-   panel = display->ops->get_panel(display);
-   else {
-   drm_mode_destroy(connector->dev, mode);
-   return 0;
-   }
-
-   drm_display_mode_from_videomode(>vm, mode);
-   mode->width_mm = panel->width_mm;
-   mode->height_mm = panel->height_mm;
-   connector->display_info.width_mm = mode->width_mm;
-   connector->display_info.height_mm = mode->height_mm;
-
-   mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
-   drm_mode_set_name(mode);
-   drm_mode_probed_add(connector, mode);
-
-   count = 

[PATCH v4 33/34] drm/exynos: Move lvds bridge discovery into DP driver

2014-01-30 Thread Sean Paul
This patch moves the lvds bridge discovery and connector pre-emption
code from exynos common code into the dp driver (since the bridge is
only applicable for dp).

Signed-off-by: Sean Paul 
---

Changes in v3:
 - Added to the patchset
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_dp_core.c  | 41 
 drivers/gpu/drm/exynos/exynos_drm_core.c | 41 
 2 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c 
b/drivers/gpu/drm/exynos/exynos_dp_core.c
index af2c9d2..a59bca9 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 

 #include "exynos_drm_drv.h"
 #include "exynos_dp_core.h"
@@ -32,6 +33,11 @@
 #define ctx_from_connector(c)  container_of(c, struct exynos_dp_device, \
connector)

+struct bridge_init {
+   struct i2c_client *client;
+   struct device_node *node;
+};
+
 static int exynos_dp_init_dp(struct exynos_dp_device *dp)
 {
exynos_dp_reset(dp);
@@ -973,6 +979,35 @@ static int exynos_dp_initialize(struct exynos_drm_display 
*display,
return 0;
 }

+static bool find_bridge(const char *compat, struct bridge_init *bridge)
+{
+   bridge->client = NULL;
+   bridge->node = of_find_compatible_node(NULL, NULL, compat);
+   if (!bridge->node)
+   return false;
+
+   bridge->client = of_find_i2c_device_by_node(bridge->node);
+   if (!bridge->client)
+   return false;
+
+   return true;
+}
+
+/* returns the number of bridges attached */
+static int exynos_drm_attach_lcd_bridge(struct drm_device *dev,
+   struct drm_encoder *encoder)
+{
+   struct bridge_init bridge;
+   int ret;
+
+   if (find_bridge("nxp,ptn3460", )) {
+   ret = ptn3460_init(dev, encoder, bridge.client, bridge.node);
+   if (!ret)
+   return 1;
+   }
+   return 0;
+}
+
 static int exynos_dp_create_connector(struct exynos_drm_display *display,
struct drm_encoder *encoder)
 {
@@ -981,6 +1016,12 @@ static int exynos_dp_create_connector(struct 
exynos_drm_display *display,
int ret;

dp->encoder = encoder;
+
+   /* Pre-empt DP connector creation if there's a bridge */
+   ret = exynos_drm_attach_lcd_bridge(dp->drm_dev, encoder);
+   if (ret)
+   return 0;
+
connector->polled = DRM_CONNECTOR_POLL_HPD;

ret = drm_connector_init(dp->drm_dev, connector,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c 
b/drivers/gpu/drm/exynos/exynos_drm_core.c
index 1a60f5a..2446352 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_core.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_core.c
@@ -14,7 +14,6 @@

 #include 
 #include 
-#include 
 #include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
 #include "exynos_drm_encoder.h"
@@ -25,40 +24,6 @@ static LIST_HEAD(exynos_drm_subdrv_list);
 static LIST_HEAD(exynos_drm_manager_list);
 static LIST_HEAD(exynos_drm_display_list);

-struct bridge_init {
-   struct i2c_client *client;
-   struct device_node *node;
-};
-
-static bool find_bridge(const char *compat, struct bridge_init *bridge)
-{
-   bridge->client = NULL;
-   bridge->node = of_find_compatible_node(NULL, NULL, compat);
-   if (!bridge->node)
-   return false;
-
-   bridge->client = of_find_i2c_device_by_node(bridge->node);
-   if (!bridge->client)
-   return false;
-
-   return true;
-}
-
-/* returns the number of bridges attached */
-static int exynos_drm_attach_lcd_bridge(struct drm_device *dev,
-   struct drm_encoder *encoder)
-{
-   struct bridge_init bridge;
-   int ret;
-
-   if (find_bridge("nxp,ptn3460", )) {
-   ret = ptn3460_init(dev, encoder, bridge.client, bridge.node);
-   if (!ret)
-   return 1;
-   }
-   return 0;
-}
-
 static int exynos_drm_create_enc_conn(struct drm_device *dev,
struct exynos_drm_display *display)
 {
@@ -81,12 +46,6 @@ static int exynos_drm_create_enc_conn(struct drm_device *dev,
}
display->encoder = encoder;

-   if (display->type == EXYNOS_DISPLAY_TYPE_LCD) {
-   ret = exynos_drm_attach_lcd_bridge(dev, encoder);
-   if (ret)
-   return 0;
-   }
-
if (display->ops->create_connector)
return display->ops->create_connector(display, encoder);

-- 
1.8.5.1



[PATCH v4 32/34] drm/exynos: Implement drm_connector directly in vidi driver

2014-01-30 Thread Sean Paul
This patch implements drm_connector directly in the vidi
driver, this will allow us to move away from the exynos_drm_connector
layer.

Signed-off-by: Sean Paul 
---

Changes in v3:
 - Added to the patchset
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_vidi.c | 122 ---
 1 file changed, 111 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c 
b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 5d0b5cd..b914513 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -29,6 +29,8 @@
 #define WINDOWS_NR 3

 #define get_vidi_mgr(dev)  platform_get_drvdata(to_platform_device(dev))
+#define ctx_from_connector(c)  container_of(c, struct vidi_context, \
+   connector)

 struct vidi_win_data {
unsigned intoffset_x;
@@ -47,6 +49,8 @@ struct vidi_win_data {
 struct vidi_context {
struct drm_device   *drm_dev;
struct drm_crtc *crtc;
+   struct drm_encoder  *encoder;
+   struct drm_connectorconnector;
struct vidi_win_datawin_data[WINDOWS_NR];
struct edid *raw_edid;
unsigned intclkdiv;
@@ -129,17 +133,6 @@ static int vidi_check_mode(struct exynos_drm_display 
*display,
return 0;
 }

-static struct exynos_drm_display_ops vidi_display_ops = {
-   .is_connected = vidi_display_is_connected,
-   .get_edid = vidi_get_edid,
-   .check_mode = vidi_check_mode,
-};
-
-static struct exynos_drm_display vidi_display = {
-   .type = EXYNOS_DISPLAY_TYPE_VIDI,
-   .ops = _display_ops,
-};
-
 static void vidi_apply(struct exynos_drm_manager *mgr)
 {
struct vidi_context *ctx = mgr->ctx;
@@ -532,6 +525,113 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, 
void *data,
return 0;
 }

+static enum drm_connector_status vidi_detect(struct drm_connector *connector,
+   bool force)
+{
+   struct vidi_context *ctx = ctx_from_connector(connector);
+
+   /*
+* connection request would come from user side
+* to do hotplug through specific ioctl.
+*/
+   return ctx->connected ? connector_status_connected :
+   connector_status_disconnected;
+}
+
+static void vidi_connector_destroy(struct drm_connector *connector)
+{
+}
+
+static struct drm_connector_funcs vidi_connector_funcs = {
+   .dpms = drm_helper_connector_dpms,
+   .fill_modes = drm_helper_probe_single_connector_modes,
+   .detect = vidi_detect,
+   .destroy = vidi_connector_destroy,
+};
+
+static int vidi_get_modes(struct drm_connector *connector)
+{
+   struct vidi_context *ctx = ctx_from_connector(connector);
+   struct edid *edid;
+   int edid_len;
+
+   /*
+* the edid data comes from user side and it would be set
+* to ctx->raw_edid through specific ioctl.
+*/
+   if (!ctx->raw_edid) {
+   DRM_DEBUG_KMS("raw_edid is null.\n");
+   return -EFAULT;
+   }
+
+   edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH;
+   edid = kmemdup(ctx->raw_edid, edid_len, GFP_KERNEL);
+   if (!edid) {
+   DRM_DEBUG_KMS("failed to allocate edid\n");
+   return -ENOMEM;
+   }
+
+   drm_mode_connector_update_edid_property(connector, edid);
+
+   return drm_add_edid_modes(connector, edid);
+}
+
+static int vidi_mode_valid(struct drm_connector *connector,
+   struct drm_display_mode *mode)
+{
+   return MODE_OK;
+}
+
+static struct drm_encoder *vidi_best_encoder(struct drm_connector *connector)
+{
+   struct vidi_context *ctx = ctx_from_connector(connector);
+
+   return ctx->encoder;
+}
+
+static struct drm_connector_helper_funcs vidi_connector_helper_funcs = {
+   .get_modes = vidi_get_modes,
+   .mode_valid = vidi_mode_valid,
+   .best_encoder = vidi_best_encoder,
+};
+
+static int vidi_create_connector(struct exynos_drm_display *display,
+   struct drm_encoder *encoder)
+{
+   struct vidi_context *ctx = display->ctx;
+   struct drm_connector *connector = >connector;
+   int ret;
+
+   ctx->encoder = encoder;
+   connector->polled = DRM_CONNECTOR_POLL_HPD;
+
+   ret = drm_connector_init(ctx->drm_dev, connector,
+   _connector_funcs, DRM_MODE_CONNECTOR_VIRTUAL);
+   if (ret) {
+   DRM_ERROR("Failed to initialize connector with drm\n");
+   return ret;
+   }
+
+   drm_connector_helper_add(connector, _connector_helper_funcs);
+   drm_sysfs_connector_add(connector);
+   drm_mode_connector_attach_encoder(connector, encoder);
+
+   return 0;
+}
+
+
+static struct exynos_drm_display_ops vidi_display_ops = {
+   .is_connected = vidi_display_is_connected,
+  

[PATCH v4 31/34] drm/exynos: Implement drm_connector directly in dp driver

2014-01-30 Thread Sean Paul
This patch implements drm_connector directly in the dp driver, this will
allow us to move away from the exynos_drm_connector layer.

Signed-off-by: Sean Paul 
---

Changes in v3:
 - Added to the patchset
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_dp_core.c | 99 ++---
 drivers/gpu/drm/exynos/exynos_dp_core.h |  4 ++
 2 files changed, 94 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c 
b/drivers/gpu/drm/exynos/exynos_dp_core.c
index 05ce947..af2c9d2 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -23,10 +23,15 @@
 #include 

 #include 
+#include 
+#include 

 #include "exynos_drm_drv.h"
 #include "exynos_dp_core.h"

+#define ctx_from_connector(c)  container_of(c, struct exynos_dp_device, \
+   connector)
+
 static int exynos_dp_init_dp(struct exynos_dp_device *dp)
 {
exynos_dp_reset(dp);
@@ -897,21 +902,98 @@ static void exynos_dp_hotplug(struct work_struct *work)
dev_err(dp->dev, "unable to config video\n");
 }

-static bool exynos_dp_display_is_connected(struct exynos_drm_display *display)
+static enum drm_connector_status exynos_dp_detect(
+   struct drm_connector *connector, bool force)
 {
-   return true;
+   return connector_status_connected;
 }

-static void *exynos_dp_get_panel(struct exynos_drm_display *display)
+static void exynos_dp_connector_destroy(struct drm_connector *connector)
 {
-   struct exynos_dp_device *dp = display->ctx;
+}
+
+static struct drm_connector_funcs exynos_dp_connector_funcs = {
+   .dpms = drm_helper_connector_dpms,
+   .fill_modes = drm_helper_probe_single_connector_modes,
+   .detect = exynos_dp_detect,
+   .destroy = exynos_dp_connector_destroy,
+};
+
+static int exynos_dp_get_modes(struct drm_connector *connector)
+{
+   struct exynos_dp_device *dp = ctx_from_connector(connector);
+   struct drm_display_mode *mode;
+
+   mode = drm_mode_create(connector->dev);
+   if (!mode) {
+   DRM_ERROR("failed to create a new display mode.\n");
+   return 0;
+   }

-   return >panel;
+   drm_display_mode_from_videomode(>panel.vm, mode);
+   mode->width_mm = dp->panel.width_mm;
+   mode->height_mm = dp->panel.height_mm;
+   connector->display_info.width_mm = mode->width_mm;
+   connector->display_info.height_mm = mode->height_mm;
+
+   mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
+   drm_mode_set_name(mode);
+   drm_mode_probed_add(connector, mode);
+
+   return 1;
 }

-static int exynos_dp_check_mode(struct exynos_drm_display *display,
+static int exynos_dp_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
 {
+   return MODE_OK;
+}
+
+static struct drm_encoder *exynos_dp_best_encoder(
+   struct drm_connector *connector)
+{
+   struct exynos_dp_device *dp = ctx_from_connector(connector);
+
+   return dp->encoder;
+}
+
+static struct drm_connector_helper_funcs exynos_dp_connector_helper_funcs = {
+   .get_modes = exynos_dp_get_modes,
+   .mode_valid = exynos_dp_mode_valid,
+   .best_encoder = exynos_dp_best_encoder,
+};
+
+static int exynos_dp_initialize(struct exynos_drm_display *display,
+   struct drm_device *drm_dev)
+{
+   struct exynos_dp_device *dp = display->ctx;
+
+   dp->drm_dev = drm_dev;
+
+   return 0;
+}
+
+static int exynos_dp_create_connector(struct exynos_drm_display *display,
+   struct drm_encoder *encoder)
+{
+   struct exynos_dp_device *dp = display->ctx;
+   struct drm_connector *connector = >connector;
+   int ret;
+
+   dp->encoder = encoder;
+   connector->polled = DRM_CONNECTOR_POLL_HPD;
+
+   ret = drm_connector_init(dp->drm_dev, connector,
+   _dp_connector_funcs, DRM_MODE_CONNECTOR_eDP);
+   if (ret) {
+   DRM_ERROR("Failed to initialize connector with drm\n");
+   return ret;
+   }
+
+   drm_connector_helper_add(connector, _dp_connector_helper_funcs);
+   drm_sysfs_connector_add(connector);
+   drm_mode_connector_attach_encoder(connector, encoder);
+
return 0;
 }

@@ -983,9 +1065,8 @@ static void exynos_dp_dpms(struct exynos_drm_display 
*display, int mode)
 }

 static struct exynos_drm_display_ops exynos_dp_display_ops = {
-   .is_connected = exynos_dp_display_is_connected,
-   .get_panel = exynos_dp_get_panel,
-   .check_mode = exynos_dp_check_mode,
+   .initialize = exynos_dp_initialize,
+   .create_connector = exynos_dp_create_connector,
.dpms = exynos_dp_dpms,
 };

diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.h 
b/drivers/gpu/drm/exynos/exynos_dp_core.h
index ccaeadc..d6a900d 100644
--- 

[PATCH v4 30/34] drm/exynos: Implement drm_connector in hdmi directly

2014-01-30 Thread Sean Paul
This patch implements drm_connector in the hdmi driver directly, instead
of using exynos_drm_connector.

Signed-off-by: Sean Paul 
---

Changes in v3:
 - Added to the patchset
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_hdmi.c | 126 +++
 1 file changed, 85 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 3313743..925b2a2 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -44,9 +44,8 @@
 #include 
 #include 

-#define MAX_WIDTH  1920
-#define MAX_HEIGHT 1080
 #define get_hdmi_display(dev)  platform_get_drvdata(to_platform_device(dev))
+#define ctx_from_connector(c)  container_of(c, struct hdmi_context, connector)

 /* AVI header and aspect ratio */
 #define HDMI_AVI_VERSION   0x02
@@ -182,6 +181,8 @@ struct hdmi_conf_regs {
 struct hdmi_context {
struct device   *dev;
struct drm_device   *drm_dev;
+   struct drm_connectorconnector;
+   struct drm_encoder  *encoder;
boolhpd;
boolpowered;
booldvi_mode;
@@ -740,42 +741,46 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata,
}
 }

-static int hdmi_initialize(struct exynos_drm_display *display,
-   struct drm_device *drm_dev)
+static enum drm_connector_status hdmi_detect(struct drm_connector *connector,
+   bool force)
 {
-   struct hdmi_context *hdata = display->ctx;
+   struct hdmi_context *hdata = ctx_from_connector(connector);

-   hdata->drm_dev = drm_dev;
-
-   return 0;
+   return hdata->hpd ? connector_status_connected :
+   connector_status_disconnected;
 }

-static bool hdmi_is_connected(struct exynos_drm_display *display)
+static void hdmi_connector_destroy(struct drm_connector *connector)
 {
-   struct hdmi_context *hdata = display->ctx;
-
-   return hdata->hpd;
 }

-static struct edid *hdmi_get_edid(struct exynos_drm_display *display,
-   struct drm_connector *connector)
+static struct drm_connector_funcs hdmi_connector_funcs = {
+   .dpms = drm_helper_connector_dpms,
+   .fill_modes = drm_helper_probe_single_connector_modes,
+   .detect = hdmi_detect,
+   .destroy = hdmi_connector_destroy,
+};
+
+static int hdmi_get_modes(struct drm_connector *connector)
 {
-   struct edid *raw_edid;
-   struct hdmi_context *hdata = display->ctx;
+   struct hdmi_context *hdata = ctx_from_connector(connector);
+   struct edid *edid;

if (!hdata->ddc_port)
-   return ERR_PTR(-ENODEV);
+   return -ENODEV;

-   raw_edid = drm_get_edid(connector, hdata->ddc_port->adapter);
-   if (!raw_edid)
-   return ERR_PTR(-ENODEV);
+   edid = drm_get_edid(connector, hdata->ddc_port->adapter);
+   if (!edid)
+   return -ENODEV;

-   hdata->dvi_mode = !drm_detect_hdmi_monitor(raw_edid);
+   hdata->dvi_mode = !drm_detect_hdmi_monitor(edid);
DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n",
(hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"),
-   raw_edid->width_cm, raw_edid->height_cm);
+   edid->width_cm, edid->height_cm);
+
+   drm_mode_connector_update_edid_property(connector, edid);

-   return raw_edid;
+   return drm_add_edid_modes(connector, edid);
 }

 static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock)
@@ -800,10 +805,10 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, 
u32 pixel_clock)
return -EINVAL;
 }

-static int hdmi_check_mode(struct exynos_drm_display *display,
+static int hdmi_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
 {
-   struct hdmi_context *hdata = display->ctx;
+   struct hdmi_context *hdata = ctx_from_connector(connector);
int ret;

DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n",
@@ -813,11 +818,60 @@ static int hdmi_check_mode(struct exynos_drm_display 
*display,

ret = mixer_check_mode(mode);
if (ret)
-   return ret;
+   return MODE_BAD;

ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
if (ret < 0)
+   return MODE_BAD;
+
+   return MODE_OK;
+}
+
+static struct drm_encoder *hdmi_best_encoder(struct drm_connector *connector)
+{
+   struct hdmi_context *hdata = ctx_from_connector(connector);
+
+   return hdata->encoder;
+}
+
+static struct drm_connector_helper_funcs hdmi_connector_helper_funcs = {
+   .get_modes = hdmi_get_modes,
+   .mode_valid = hdmi_mode_valid,
+   .best_encoder = hdmi_best_encoder,
+};
+
+static int hdmi_create_connector(struct 

[PATCH v4 29/34] drm/exynos: Add create_connector callback

2014-01-30 Thread Sean Paul
This creates a new display hook called create_connector. The purpose is
to allow the display driver to create its own drm_connector instead of
using the exynos_drm_connector. This moves things closer to completely
removing the exynos_drm_connector abstraction.

Signed-off-by: Sean Paul 
---

Changes in v3:
 - Added to the patchset
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_core.c | 3 +++
 drivers/gpu/drm/exynos/exynos_drm_drv.h  | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c 
b/drivers/gpu/drm/exynos/exynos_drm_core.c
index e76098d..1a60f5a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_core.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_core.c
@@ -87,6 +87,9 @@ static int exynos_drm_create_enc_conn(struct drm_device *dev,
return 0;
}

+   if (display->ops->create_connector)
+   return display->ops->create_connector(display, encoder);
+
/*
 * create and initialize a connector for this sub driver and
 * attach the encoder created above to the connector.
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 09c158a..b1b02d0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -139,6 +139,8 @@ struct exynos_drm_display;
 struct exynos_drm_display_ops {
int (*initialize)(struct exynos_drm_display *display,
struct drm_device *drm_dev);
+   int (*create_connector)(struct exynos_drm_display *display,
+   struct drm_encoder *encoder);
void (*remove)(struct exynos_drm_display *display);
bool (*is_connected)(struct exynos_drm_display *display);
void (*get_max_resol)(struct exynos_drm_display *display,
-- 
1.8.5.1



[PATCH v4 28/34] drm/exynos: Consolidate suspend/resume in drm_drv

2014-01-30 Thread Sean Paul
This patch removes all of the suspend/resume logic from the individual
drivers and consolidates it in drm_drv. This consolidation reduces the
number of functions which enable/disable the hardware to just one -- the
dpms callback. This ensures that we always power up/down in a consistent
manner.

Signed-off-by: Sean Paul 
---

Changes in v2:
 - Added to the patchset
Changes in v3:
 - Made appropriate changes to vidi as well (removed pm_ops)
Changes in v4:
 - Added pm_runtime_get/put back into the dpms handlers for hdmi

 drivers/gpu/drm/exynos/exynos_drm_drv.c  |  97 +
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |  86 +++---
 drivers/gpu/drm/exynos/exynos_drm_vidi.c | 119 +--
 drivers/gpu/drm/exynos/exynos_hdmi.c |  88 +++
 drivers/gpu/drm/exynos/exynos_mixer.c|  68 ++
 5 files changed, 170 insertions(+), 288 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 87ac369..c8869de 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -11,6 +11,7 @@
  * option) any later version.
  */

+#include 
 #include 
 #include 

@@ -53,6 +54,7 @@ static int exynos_drm_load(struct drm_device *dev, unsigned 
long flags)
return -ENOMEM;

INIT_LIST_HEAD(>pageflip_event_list);
+   dev_set_drvdata(dev->dev, dev);
dev->dev_private = (void *)private;

/*
@@ -163,6 +165,41 @@ static const struct file_operations exynos_drm_gem_fops = {
.mmap = exynos_drm_gem_mmap_buffer,
 };

+static int exynos_drm_suspend(struct drm_device *dev, pm_message_t state)
+{
+   struct drm_connector *connector;
+
+   drm_modeset_lock_all(dev);
+   list_for_each_entry(connector, >mode_config.connector_list, head) {
+   int old_dpms = connector->dpms;
+
+   if (connector->funcs->dpms)
+   connector->funcs->dpms(connector, DRM_MODE_DPMS_OFF);
+
+   /* Set the old mode back to the connector for resume */
+   connector->dpms = old_dpms;
+   }
+   drm_modeset_unlock_all(dev);
+
+   return 0;
+}
+
+static int exynos_drm_resume(struct drm_device *dev)
+{
+   struct drm_connector *connector;
+
+   drm_modeset_lock_all(dev);
+   list_for_each_entry(connector, >mode_config.connector_list, head) {
+   if (connector->funcs->dpms)
+   connector->funcs->dpms(connector, connector->dpms);
+   }
+
+   drm_helper_resume_force_mode(dev);
+   drm_modeset_unlock_all(dev);
+
+   return 0;
+}
+
 static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
 {
struct drm_exynos_file_private *file_priv;
@@ -296,6 +333,8 @@ static struct drm_driver exynos_drm_driver = {
DRIVER_GEM | DRIVER_PRIME,
.load   = exynos_drm_load,
.unload = exynos_drm_unload,
+   .suspend= exynos_drm_suspend,
+   .resume = exynos_drm_resume,
.open   = exynos_drm_open,
.preclose   = exynos_drm_preclose,
.lastclose  = exynos_drm_lastclose,
@@ -330,6 +369,9 @@ static int exynos_drm_platform_probe(struct platform_device 
*pdev)
if (ret)
return ret;

+   pm_runtime_enable(>dev);
+   pm_runtime_get_sync(>dev);
+
return drm_platform_init(_drm_driver, pdev);
 }

@@ -340,12 +382,67 @@ static int exynos_drm_platform_remove(struct 
platform_device *pdev)
return 0;
 }

+#ifdef CONFIG_PM_SLEEP
+static int exynos_drm_sys_suspend(struct device *dev)
+{
+   struct drm_device *drm_dev = dev_get_drvdata(dev);
+   pm_message_t message;
+
+   if (pm_runtime_suspended(dev))
+   return 0;
+
+   message.event = PM_EVENT_SUSPEND;
+   return exynos_drm_suspend(drm_dev, message);
+}
+
+static int exynos_drm_sys_resume(struct device *dev)
+{
+   struct drm_device *drm_dev = dev_get_drvdata(dev);
+
+   if (pm_runtime_suspended(dev))
+   return 0;
+
+   return exynos_drm_resume(drm_dev);
+}
+#endif
+
+#ifdef CONFIG_PM_RUNTIME
+static int exynos_drm_runtime_suspend(struct device *dev)
+{
+   struct drm_device *drm_dev = dev_get_drvdata(dev);
+   pm_message_t message;
+
+   if (pm_runtime_suspended(dev))
+   return 0;
+
+   message.event = PM_EVENT_SUSPEND;
+   return exynos_drm_suspend(drm_dev, message);
+}
+
+static int exynos_drm_runtime_resume(struct device *dev)
+{
+   struct drm_device *drm_dev = dev_get_drvdata(dev);
+
+   if (!pm_runtime_suspended(dev))
+   return 0;
+
+   return exynos_drm_resume(drm_dev);
+}
+#endif
+
+static const struct dev_pm_ops exynos_drm_pm_ops = {
+   SET_SYSTEM_SLEEP_PM_OPS(exynos_drm_sys_suspend, 

[PATCH v4 27/34] drm/exynos: Clean up FIMD power on/off routines

2014-01-30 Thread Sean Paul
This patch separates the fimd_activate function into poweron/poweroff
functions to be more consistent with the other drivers in exynos drm. It
also properly cleans up after failures in poweron. The functions have
also been shuffled around such that they are all in the same
spot in the file and poweron/poweroff can be called from the dpms function.

Signed-off-by: Sean Paul 
---

Changes in v2:
 - Added to the patchset
Changes in v3: None
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 245 +--
 1 file changed, 134 insertions(+), 111 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 6eb0008..1efdcac 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -519,6 +519,12 @@ static void fimd_win_commit(struct exynos_drm_manager 
*mgr, int zpos)

win_data = >win_data[win];

+   /* If suspended, enable this on resume */
+   if (ctx->suspended) {
+   win_data->resume = true;
+   return;
+   }
+
/*
 * SHADOWCON/PRTCON register is used for enabling timing.
 *
@@ -660,6 +666,129 @@ static void fimd_win_disable(struct exynos_drm_manager 
*mgr, int zpos)
win_data->enabled = false;
 }

+static void fimd_clear_win(struct fimd_context *ctx, int win)
+{
+   writel(0, ctx->regs + WINCON(win));
+   writel(0, ctx->regs + VIDOSD_A(win));
+   writel(0, ctx->regs + VIDOSD_B(win));
+   writel(0, ctx->regs + VIDOSD_C(win));
+
+   if (win == 1 || win == 2)
+   writel(0, ctx->regs + VIDOSD_D(win));
+
+   fimd_shadow_protect_win(ctx, win, false);
+}
+
+static void fimd_window_suspend(struct exynos_drm_manager *mgr)
+{
+   struct fimd_context *ctx = mgr->ctx;
+   struct fimd_win_data *win_data;
+   int i;
+
+   for (i = 0; i < WINDOWS_NR; i++) {
+   win_data = >win_data[i];
+   win_data->resume = win_data->enabled;
+   if (win_data->enabled)
+   fimd_win_disable(mgr, i);
+   }
+   fimd_wait_for_vblank(mgr);
+}
+
+static void fimd_window_resume(struct exynos_drm_manager *mgr)
+{
+   struct fimd_context *ctx = mgr->ctx;
+   struct fimd_win_data *win_data;
+   int i;
+
+   for (i = 0; i < WINDOWS_NR; i++) {
+   win_data = >win_data[i];
+   win_data->enabled = win_data->resume;
+   win_data->resume = false;
+   }
+}
+
+static void fimd_apply(struct exynos_drm_manager *mgr)
+{
+   struct fimd_context *ctx = mgr->ctx;
+   struct fimd_win_data *win_data;
+   int i;
+
+   for (i = 0; i < WINDOWS_NR; i++) {
+   win_data = >win_data[i];
+   if (win_data->enabled)
+   fimd_win_commit(mgr, i);
+   }
+
+   fimd_commit(mgr);
+}
+
+static int fimd_poweron(struct exynos_drm_manager *mgr)
+{
+   struct fimd_context *ctx = mgr->ctx;
+   int ret;
+
+   if (!ctx->suspended)
+   return 0;
+
+   ctx->suspended = false;
+
+   ret = clk_prepare_enable(ctx->bus_clk);
+   if (ret < 0) {
+   DRM_ERROR("Failed to prepare_enable the bus clk [%d]\n", ret);
+   goto bus_clk_err;
+   }
+
+   ret = clk_prepare_enable(ctx->lcd_clk);
+   if  (ret < 0) {
+   DRM_ERROR("Failed to prepare_enable the lcd clk [%d]\n", ret);
+   goto lcd_clk_err;
+   }
+
+   /* if vblank was enabled status, enable it again. */
+   if (test_and_clear_bit(0, >irq_flags)) {
+   ret = fimd_enable_vblank(mgr);
+   if (ret) {
+   DRM_ERROR("Failed to re-enable vblank [%d]\n", ret);
+   goto enable_vblank_err;
+   }
+   }
+
+   fimd_window_resume(mgr);
+
+   fimd_apply(mgr);
+
+   return 0;
+
+enable_vblank_err:
+   clk_disable_unprepare(ctx->lcd_clk);
+lcd_clk_err:
+   clk_disable_unprepare(ctx->bus_clk);
+bus_clk_err:
+   ctx->suspended = true;
+   return ret;
+}
+
+static int fimd_poweroff(struct exynos_drm_manager *mgr)
+{
+   struct fimd_context *ctx = mgr->ctx;
+
+   if (ctx->suspended)
+   return 0;
+
+   /*
+* We need to make sure that all windows are disabled before we
+* suspend that connector. Otherwise we might try to scan from
+* a destroyed buffer later.
+*/
+   fimd_window_suspend(mgr);
+
+   clk_disable_unprepare(ctx->lcd_clk);
+   clk_disable_unprepare(ctx->bus_clk);
+
+   ctx->suspended = true;
+   return 0;
+}
+
 static void fimd_dpms(struct exynos_drm_manager *mgr, int mode)
 {
struct fimd_context *ctx = mgr->ctx;
@@ -736,113 +865,6 @@ out:
return IRQ_HANDLED;
 }

-static void fimd_clear_win(struct fimd_context *ctx, int win)
-{
-   writel(0, ctx->regs + WINCON(win));
-   writel(0, ctx->regs + 

[PATCH v4 26/34] drm/exynos: Implement dpms display callback in DP

2014-01-30 Thread Sean Paul
This patch implements the dpms display callback for the DP driver.

Signed-off-by: Sean Paul 
---

Changes in v2:
 - Added to the patchset
Changes in v3: None
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_dp_core.c | 142 ++--
 drivers/gpu/drm/exynos/exynos_dp_core.h |   1 +
 2 files changed, 81 insertions(+), 62 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c 
b/drivers/gpu/drm/exynos/exynos_dp_core.c
index 5c26161..05ce947 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -915,10 +915,78 @@ static int exynos_dp_check_mode(struct exynos_drm_display 
*display,
return 0;
 }

+static void exynos_dp_phy_init(struct exynos_dp_device *dp)
+{
+   if (dp->phy) {
+   phy_power_on(dp->phy);
+   } else if (dp->phy_addr) {
+   u32 reg;
+
+   reg = __raw_readl(dp->phy_addr);
+   reg |= dp->enable_mask;
+   __raw_writel(reg, dp->phy_addr);
+   }
+}
+
+static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
+{
+   if (dp->phy) {
+   phy_power_off(dp->phy);
+   } else if (dp->phy_addr) {
+   u32 reg;
+
+   reg = __raw_readl(dp->phy_addr);
+   reg &= ~(dp->enable_mask);
+   __raw_writel(reg, dp->phy_addr);
+   }
+}
+
+static void exynos_dp_poweron(struct exynos_dp_device *dp)
+{
+   if (dp->dpms_mode == DRM_MODE_DPMS_ON)
+   return;
+
+   clk_prepare_enable(dp->clock);
+   exynos_dp_phy_init(dp);
+   exynos_dp_init_dp(dp);
+   enable_irq(dp->irq);
+}
+
+static void exynos_dp_poweroff(struct exynos_dp_device *dp)
+{
+   if (dp->dpms_mode != DRM_MODE_DPMS_ON)
+   return;
+
+   disable_irq(dp->irq);
+   flush_work(>hotplug_work);
+   exynos_dp_phy_exit(dp);
+   clk_disable_unprepare(dp->clock);
+}
+
+static void exynos_dp_dpms(struct exynos_drm_display *display, int mode)
+{
+   struct exynos_dp_device *dp = display->ctx;
+
+   switch (mode) {
+   case DRM_MODE_DPMS_ON:
+   exynos_dp_poweron(dp);
+   break;
+   case DRM_MODE_DPMS_STANDBY:
+   case DRM_MODE_DPMS_SUSPEND:
+   case DRM_MODE_DPMS_OFF:
+   exynos_dp_poweroff(dp);
+   break;
+   default:
+   break;
+   };
+   dp->dpms_mode = mode;
+}
+
 static struct exynos_drm_display_ops exynos_dp_display_ops = {
.is_connected = exynos_dp_display_is_connected,
.get_panel = exynos_dp_get_panel,
.check_mode = exynos_dp_check_mode,
+   .dpms = exynos_dp_dpms,
 };

 static struct exynos_drm_display exynos_dp_display = {
@@ -1040,54 +1108,6 @@ static int exynos_dp_dt_parse_panel(struct 
exynos_dp_device *dp)
return 0;
 }

-static void exynos_dp_phy_init(struct exynos_dp_device *dp)
-{
-   if (dp->phy) {
-   phy_power_on(dp->phy);
-   } else if (dp->phy_addr) {
-   u32 reg;
-
-   reg = __raw_readl(dp->phy_addr);
-   reg |= dp->enable_mask;
-   __raw_writel(reg, dp->phy_addr);
-   }
-}
-
-static void exynos_dp_phy_exit(struct exynos_dp_device *dp)
-{
-   if (dp->phy) {
-   phy_power_off(dp->phy);
-   } else if (dp->phy_addr) {
-   u32 reg;
-
-   reg = __raw_readl(dp->phy_addr);
-   reg &= ~(dp->enable_mask);
-   __raw_writel(reg, dp->phy_addr);
-   }
-}
-
-void exynos_dp_poweron(struct exynos_dp_device *dp)
-{
-   exynos_dp_phy_init(dp);
-
-   clk_prepare_enable(dp->clock);
-
-   exynos_dp_init_dp(dp);
-
-   enable_irq(dp->irq);
-}
-
-void exynos_dp_poweroff(struct exynos_dp_device *dp)
-{
-   disable_irq(dp->irq);
-
-   flush_work(>hotplug_work);
-
-   exynos_dp_phy_exit(dp);
-
-   clk_disable_unprepare(dp->clock);
-}
-
 static int exynos_dp_probe(struct platform_device *pdev)
 {
struct resource *res;
@@ -1103,6 +1123,7 @@ static int exynos_dp_probe(struct platform_device *pdev)
}

dp->dev = >dev;
+   dp->dpms_mode = DRM_MODE_DPMS_OFF;

dp->video_info = exynos_dp_dt_parse_pdata(>dev);
if (IS_ERR(dp->video_info))
@@ -1148,10 +1169,11 @@ static int exynos_dp_probe(struct platform_device *pdev)
dev_err(>dev, "failed to request irq\n");
return ret;
}
-
-   platform_set_drvdata(pdev, dp);
+   disable_irq(dp->irq);

exynos_dp_display.ctx = dp;
+
+   platform_set_drvdata(pdev, _dp_display);
exynos_drm_display_register(_dp_display);

return 0;
@@ -1159,34 +1181,30 @@ static int exynos_dp_probe(struct platform_device *pdev)

 static int exynos_dp_remove(struct platform_device *pdev)
 {
-   struct exynos_dp_device *dp = platform_get_drvdata(pdev);
+   struct exynos_drm_display *display = platform_get_drvdata(pdev);

+   exynos_dp_dpms(display, 

[PATCH v4 25/34] ARM: dts: Move display-timings node from fimd to dp

2014-01-30 Thread Sean Paul
This patch moves the display-timings node from fimd to dp to reflect the
device tree bindings change.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4: None

 arch/arm/boot/dts/exynos5250-arndale.dts  | 7 ---
 arch/arm/boot/dts/exynos5250-smdk5250.dts | 7 ---
 arch/arm/boot/dts/exynos5250-snow.dts | 7 ---
 arch/arm/boot/dts/exynos5420-smdk5420.dts | 7 ---
 4 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts 
b/arch/arm/boot/dts/exynos5250-arndale.dts
index 6845270..8aa8d8c 100644
--- a/arch/arm/boot/dts/exynos5250-arndale.dts
+++ b/arch/arm/boot/dts/exynos5250-arndale.dts
@@ -542,10 +542,7 @@
samsung,link-rate = <0x0a>;
samsung,lane-count = <4>;
status = "okay";
-   };

-   fimd: fimd at 1440 {
-   status = "okay";
display-timings {
native-mode = <>;
timing0: timing at 0 {
@@ -563,6 +560,10 @@
};
};

+   fimd: fimd at 1440 {
+   status = "okay";
+   };
+
usb_hub_bus {
compatible = "simple-bus";
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts 
b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index b14985a..460ec90 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -255,10 +255,7 @@
pinctrl-names = "default";
pinctrl-0 = <_hpd>;
status = "okay";
-   };

-   fimd at 1440 {
-   status = "okay";
display-timings {
native-mode = <>;
timing0: timing at 0 {
@@ -276,6 +273,10 @@
};
};

+   fimd at 1440 {
+   status = "okay";
+   };
+
fixed-rate-clocks {
xxti {
compatible = "samsung,clock-xxti";
diff --git a/arch/arm/boot/dts/exynos5250-snow.dts 
b/arch/arm/boot/dts/exynos5250-snow.dts
index 8c92df8..b2783d8 100644
--- a/arch/arm/boot/dts/exynos5250-snow.dts
+++ b/arch/arm/boot/dts/exynos5250-snow.dts
@@ -216,10 +216,7 @@
pinctrl-names = "default";
pinctrl-0 = <_hpd>;
status = "okay";
-   };

-   fimd: fimd at 1440 {
-   status = "okay";
display-timings {
native-mode = <_timing>;
lcd_timing: 1366x768 {
@@ -236,6 +233,10 @@
};
};

+   fimd: fimd at 1440 {
+   status = "okay";
+   };
+
fixed-rate-clocks {
xxti {
compatible = "samsung,clock-xxti";
diff --git a/arch/arm/boot/dts/exynos5420-smdk5420.dts 
b/arch/arm/boot/dts/exynos5420-smdk5420.dts
index 79524c7..b477f76 100644
--- a/arch/arm/boot/dts/exynos5420-smdk5420.dts
+++ b/arch/arm/boot/dts/exynos5420-smdk5420.dts
@@ -41,10 +41,7 @@
samsung,link-rate = <0x0a>;
samsung,lane-count = <4>;
status = "okay";
-   };

-   fimd at 1440 {
-   status = "okay";
display-timings {
native-mode = <>;
timing0: timing at 0 {
@@ -87,4 +84,8 @@
reg = <0x50>;
};
};
+
+   fimd at 1440 {
+   status = "okay";
+   };
 };
-- 
1.8.5.1



[PATCH v4 24/34] drm/exynos: Move display implementation into dp

2014-01-30 Thread Sean Paul
This patch moves the exynos_drm_display implementation from fimd into
the dp driver. This will allow for tighter integration of the dp driver
into the exynos drm driver.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4:
 - Changed _ to - in dts documentation

 .../devicetree/bindings/video/exynos_dp.txt|  17 
 .../devicetree/bindings/video/samsung-fimd.txt |   2 +
 drivers/gpu/drm/exynos/exynos_dp_core.c| 100 +
 drivers/gpu/drm/exynos/exynos_dp_core.h|   4 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c|  14 +++
 drivers/gpu/drm/exynos/exynos_drm_drv.h|   1 +
 drivers/gpu/drm/exynos/exynos_drm_fimd.c   |  79 +++-
 7 files changed, 131 insertions(+), 86 deletions(-)

diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt 
b/Documentation/devicetree/bindings/video/exynos_dp.txt
index 3289d76..57ccdde 100644
--- a/Documentation/devicetree/bindings/video/exynos_dp.txt
+++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
@@ -49,6 +49,8 @@ Required properties for dp-controller:
-samsung,lane-count:
number of lanes supported by the panel.
LANE_COUNT1 = 1, LANE_COUNT2 = 2, LANE_COUNT4 = 4
+   - display-timings: timings for the connected panel as described by
+   Documentation/devicetree/bindings/video/display-timing.txt

 Optional properties for dp-controller:
-interlaced:
@@ -84,4 +86,19 @@ Board Specific portion:
samsung,color-depth = <1>;
samsung,link-rate = <0x0a>;
samsung,lane-count = <4>;
+
+   display-timings {
+   native-mode = <_timing>;
+   lcd_timing: 1366x768 {
+   clock-frequency = <70589280>;
+   hactive = <1366>;
+   vactive = <768>;
+   hfront-porch = <40>;
+   hback-porch = <40>;
+   hsync-len = <32>;
+   vback-porch = <10>;
+   vfront-porch = <12>;
+   vsync-len = <6>;
+   };
+   };
};
diff --git a/Documentation/devicetree/bindings/video/samsung-fimd.txt 
b/Documentation/devicetree/bindings/video/samsung-fimd.txt
index 778838a..36b7895 100644
--- a/Documentation/devicetree/bindings/video/samsung-fimd.txt
+++ b/Documentation/devicetree/bindings/video/samsung-fimd.txt
@@ -39,6 +39,8 @@ Required properties:

 Optional Properties:
 - samsung,power-domain: a phandle to FIMD power domain node.
+- samsung,invert-vden: video enable signal is inverted
+- samsung,invert-vclk: video clock signal is inverted

 Example:

diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c 
b/drivers/gpu/drm/exynos/exynos_dp_core.c
index b3af496..5c26161 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -19,7 +19,12 @@
 #include 
 #include 
 #include 
+#include 
+#include 

+#include 
+
+#include "exynos_drm_drv.h"
 #include "exynos_dp_core.h"

 static int exynos_dp_init_dp(struct exynos_dp_device *dp)
@@ -892,6 +897,35 @@ static void exynos_dp_hotplug(struct work_struct *work)
dev_err(dp->dev, "unable to config video\n");
 }

+static bool exynos_dp_display_is_connected(struct exynos_drm_display *display)
+{
+   return true;
+}
+
+static void *exynos_dp_get_panel(struct exynos_drm_display *display)
+{
+   struct exynos_dp_device *dp = display->ctx;
+
+   return >panel;
+}
+
+static int exynos_dp_check_mode(struct exynos_drm_display *display,
+   struct drm_display_mode *mode)
+{
+   return 0;
+}
+
+static struct exynos_drm_display_ops exynos_dp_display_ops = {
+   .is_connected = exynos_dp_display_is_connected,
+   .get_panel = exynos_dp_get_panel,
+   .check_mode = exynos_dp_check_mode,
+};
+
+static struct exynos_drm_display exynos_dp_display = {
+   .type = EXYNOS_DISPLAY_TYPE_LCD,
+   .ops = _dp_display_ops,
+};
+
 static struct video_info *exynos_dp_dt_parse_pdata(struct device *dev)
 {
struct device_node *dp_node = dev->of_node;
@@ -993,6 +1027,19 @@ err:
return ret;
 }

+static int exynos_dp_dt_parse_panel(struct exynos_dp_device *dp)
+{
+   int ret;
+
+   ret = of_get_videomode(dp->dev->of_node, >panel.vm,
+   OF_USE_NATIVE_MODE);
+   if (ret) {
+   DRM_ERROR("failed: of_get_videomode() : %d\n", ret);
+   return ret;
+   }
+   return 0;
+}
+
 static void exynos_dp_phy_init(struct exynos_dp_device *dp)
 {
if (dp->phy) {
@@ -1019,6 +1066,28 @@ static void exynos_dp_phy_exit(struct exynos_dp_device 
*dp)
}
 }

+void exynos_dp_poweron(struct exynos_dp_device *dp)
+{
+   exynos_dp_phy_init(dp);

[PATCH v4 23/34] drm/exynos: Move dp driver from video/ to drm/

2014-01-30 Thread Sean Paul
This patch moves the code from video/ to drm/. This is required the DP
driver needs to power on/off in the correct order in relation to fimd.
This will also allow the DP driver to participate in drm modeset as well
as provide accurate connection detection and edid.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4:
 - Added MAINTAINERS change
 - Made DP config value default with DRM_EXYNOS

 MAINTAINERS |7 -
 drivers/gpu/drm/exynos/Kconfig  |7 +
 drivers/gpu/drm/exynos/Makefile |1 +
 drivers/gpu/drm/exynos/exynos_dp_core.c | 1155 
 drivers/gpu/drm/exynos/exynos_dp_core.h |  320 
 drivers/gpu/drm/exynos/exynos_dp_reg.c  | 1243 +++
 drivers/gpu/drm/exynos/exynos_dp_reg.h  |  366 +
 drivers/video/exynos/Kconfig|7 -
 drivers/video/exynos/Makefile   |1 -
 drivers/video/exynos/exynos_dp_core.c   | 1155 
 drivers/video/exynos/exynos_dp_core.h   |  320 
 drivers/video/exynos/exynos_dp_reg.c| 1243 ---
 drivers/video/exynos/exynos_dp_reg.h|  366 -
 13 files changed, 3092 insertions(+), 3099 deletions(-)
 create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.h
 create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.h
 delete mode 100644 drivers/video/exynos/exynos_dp_core.c
 delete mode 100644 drivers/video/exynos/exynos_dp_core.h
 delete mode 100644 drivers/video/exynos/exynos_dp_reg.c
 delete mode 100644 drivers/video/exynos/exynos_dp_reg.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 31a0462..c04bc3f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3339,13 +3339,6 @@ S:   Maintained
 F: drivers/extcon/
 F: Documentation/extcon/

-EXYNOS DP DRIVER
-M: Jingoo Han 
-L: linux-fbdev at vger.kernel.org
-S: Maintained
-F: drivers/video/exynos/exynos_dp*
-F: include/video/exynos_dp*
-
 EXYNOS MIPI DISPLAY DRIVERS
 M: Inki Dae 
 M: Donghwa Lee 
diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 6e1a1a2..7eea698 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -31,6 +31,13 @@ config DRM_EXYNOS_FIMD
help
  Choose this option if you want to use Exynos FIMD for DRM.

+config DRM_EXYNOS_DP
+   bool "EXYNOS DRM DP driver support"
+   depends on DRM_EXYNOS && ARCH_EXYNOS
+   default DRM_EXYNOS
+   help
+ This enables support for DP device.
+
 config DRM_EXYNOS_HDMI
bool "Exynos DRM HDMI"
depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index afbe499..fc8555c 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -11,6 +11,7 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o 
exynos_drm_connector.o \
 exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) += exynos_drm_dmabuf.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)+= exynos_drm_fimd.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_DP)  += exynos_dp_core.o exynos_dp_reg.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o
diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c 
b/drivers/gpu/drm/exynos/exynos_dp_core.c
new file mode 100644
index 000..b3af496
--- /dev/null
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -0,0 +1,1155 @@
+/*
+ * Samsung SoC DP (Display Port) interface driver.
+ *
+ * Copyright (C) 2012 Samsung Electronics Co., Ltd.
+ * Author: Jingoo Han 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "exynos_dp_core.h"
+
+static int exynos_dp_init_dp(struct exynos_dp_device *dp)
+{
+   exynos_dp_reset(dp);
+
+   exynos_dp_swreset(dp);
+
+   exynos_dp_init_analog_param(dp);
+   exynos_dp_init_interrupt(dp);
+
+   /* SW defined function Normal operation */
+   exynos_dp_enable_sw_function(dp);
+
+   exynos_dp_config_interrupt(dp);
+   exynos_dp_init_analog_func(dp);
+
+   exynos_dp_init_hpd(dp);
+   exynos_dp_init_aux(dp);
+
+   return 0;
+}
+
+static int exynos_dp_detect_hpd(struct exynos_dp_device *dp)
+{
+   int timeout_loop = 0;
+
+   while (exynos_dp_get_plug_in_status(dp) != 0) {
+   timeout_loop++;
+   if (DP_TIMEOUT_LOOP_COUNT < 

[PATCH v4 22/34] drm/exynos: Remove unused/useless fimd_context members

2014-01-30 Thread Sean Paul
This patch removes a few fimd_context members which are either entirely
unused or unneeded.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 53d92fe..9419513 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -107,8 +107,6 @@ struct fimd_win_data {
 struct fimd_context {
struct device   *dev;
struct drm_device   *drm_dev;
-   int irq;
-   struct drm_crtc *crtc;
struct clk  *bus_clk;
struct clk  *lcd_clk;
void __iomem*regs;
@@ -120,7 +118,6 @@ struct fimd_context {
u32 vidcon1;
boolsuspended;
int pipe;
-   struct mutexlock;
wait_queue_head_t   wait_vsync_queue;
atomic_twait_vsync_event;

@@ -697,8 +694,6 @@ static void fimd_dpms(struct exynos_drm_manager *mgr, int 
mode)

DRM_DEBUG_KMS("%d\n", mode);

-   mutex_lock(>lock);
-
switch (mode) {
case DRM_MODE_DPMS_ON:
/*
@@ -720,8 +715,6 @@ static void fimd_dpms(struct exynos_drm_manager *mgr, int 
mode)
DRM_DEBUG_KMS("unspecified mode %d\n", mode);
break;
}
-
-   mutex_unlock(>lock);
 }

 static struct exynos_drm_manager_ops fimd_manager_ops = {
@@ -947,9 +940,7 @@ static int fimd_probe(struct platform_device *pdev)
return -ENXIO;
}

-   ctx->irq = res->start;
-
-   ret = devm_request_irq(dev, ctx->irq, fimd_irq_handler,
+   ret = devm_request_irq(dev, res->start, fimd_irq_handler,
0, "drm_fimd", ctx);
if (ret) {
dev_err(dev, "irq request failed.\n");
@@ -960,8 +951,6 @@ static int fimd_probe(struct platform_device *pdev)
init_waitqueue_head(>wait_vsync_queue);
atomic_set(>wait_vsync_event, 0);

-   mutex_init(>lock);
-
platform_set_drvdata(pdev, _manager);

fimd_manager.ctx = ctx;
-- 
1.8.5.1



[PATCH v4 21/34] drm/exynos: Use mode_set to configure fimd

2014-01-30 Thread Sean Paul
This patch uses the mode passed into mode_set to configure fimd instead
of directly using the panel from context. This will allow us to move
the exynos_drm_display implementation out of fimd, where it doesn't
belong.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4:
 - Use mode supplied via mode_set directly when persisting to HW

 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 143 ---
 1 file changed, 74 insertions(+), 69 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index dc8c5e4..53d92fe 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -112,8 +112,8 @@ struct fimd_context {
struct clk  *bus_clk;
struct clk  *lcd_clk;
void __iomem*regs;
+   struct drm_display_mode mode;
struct fimd_win_datawin_data[WINDOWS_NR];
-   unsigned intclkdiv;
unsigned intdefault_win;
unsigned long   irq_flags;
u32 vidcon0;
@@ -221,38 +221,82 @@ static void fimd_mgr_remove(struct exynos_drm_manager 
*mgr)
drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
 }

+static u32 fimd_calc_clkdiv(struct fimd_context *ctx,
+   const struct drm_display_mode *mode)
+{
+   unsigned long ideal_clk = mode->htotal * mode->vtotal * mode->vrefresh;
+   u32 clkdiv;
+
+   /* Find the clock divider value that gets us closest to ideal_clk */
+   clkdiv = DIV_ROUND_UP(clk_get_rate(ctx->lcd_clk), ideal_clk);
+
+   return (clkdiv < 0x100) ? clkdiv : 0xff;
+}
+
+static bool fimd_mode_fixup(struct exynos_drm_manager *mgr,
+   const struct drm_display_mode *mode,
+   struct drm_display_mode *adjusted_mode)
+{
+   if (adjusted_mode->vrefresh == 0)
+   adjusted_mode->vrefresh = FIMD_DEFAULT_FRAMERATE;
+
+   return true;
+}
+
+static void fimd_mode_set(struct exynos_drm_manager *mgr,
+   const struct drm_display_mode *in_mode)
+{
+   struct fimd_context *ctx = mgr->ctx;
+
+   drm_mode_copy(>mode, in_mode);
+}
+
 static void fimd_commit(struct exynos_drm_manager *mgr)
 {
struct fimd_context *ctx = mgr->ctx;
-   struct exynos_drm_panel_info *panel = >panel;
-   struct videomode *vm = >vm;
+   struct drm_display_mode *mode = >mode;
struct fimd_driver_data *driver_data;
-   u32 val;
+   u32 val, clkdiv;
+   int hblank, vblank, vsync_len, vbpd, vfpd, hsync_len, hbpd, hfpd;

driver_data = ctx->driver_data;
if (ctx->suspended)
return;

+   /* nothing to do if we haven't set the mode yet */
+   if (mode->htotal == 0 || mode->vtotal == 0)
+   return;
+
/* setup polarity values from machine code. */
writel(ctx->vidcon1, ctx->regs + driver_data->timing_base + VIDCON1);

/* setup vertical timing values. */
-   val = VIDTCON0_VBPD(vm->vback_porch - 1) |
-  VIDTCON0_VFPD(vm->vfront_porch - 1) |
-  VIDTCON0_VSPW(vm->vsync_len - 1);
+   vblank = mode->crtc_vblank_end - mode->crtc_vblank_start;
+   vsync_len = mode->crtc_vsync_end - mode->crtc_vsync_start;
+   vbpd = (vblank - vsync_len) / 2;
+   vfpd = vblank - vsync_len - vbpd;
+
+   val = VIDTCON0_VBPD(vbpd - 1) |
+   VIDTCON0_VFPD(vfpd - 1) |
+   VIDTCON0_VSPW(vsync_len - 1);
writel(val, ctx->regs + driver_data->timing_base + VIDTCON0);

/* setup horizontal timing values.  */
-   val = VIDTCON1_HBPD(vm->hback_porch - 1) |
-  VIDTCON1_HFPD(vm->hfront_porch - 1) |
-  VIDTCON1_HSPW(vm->hsync_len - 1);
+   hblank = mode->crtc_hblank_end - mode->crtc_hblank_start;
+   hsync_len = mode->crtc_hsync_end - mode->crtc_hsync_start;
+   hbpd = (hblank - hsync_len) / 2;
+   hfpd = hblank - hsync_len - hbpd;
+
+   val = VIDTCON1_HBPD(hbpd - 1) |
+   VIDTCON1_HFPD(hfpd - 1) |
+   VIDTCON1_HSPW(hsync_len - 1);
writel(val, ctx->regs + driver_data->timing_base + VIDTCON1);

/* setup horizontal and vertical display size. */
-   val = VIDTCON2_LINEVAL(vm->vactive - 1) |
-  VIDTCON2_HOZVAL(vm->hactive - 1) |
-  VIDTCON2_LINEVAL_E(vm->vactive - 1) |
-  VIDTCON2_HOZVAL_E(vm->hactive - 1);
+   val = VIDTCON2_LINEVAL(mode->vdisplay - 1) |
+  VIDTCON2_HOZVAL(mode->hdisplay - 1) |
+  VIDTCON2_LINEVAL_E(mode->vdisplay - 1) |
+  VIDTCON2_HOZVAL_E(mode->hdisplay - 1);
writel(val, ctx->regs + driver_data->timing_base + VIDTCON2);

/* setup clock source, clock divider, enable dma. */
@@ -264,8 +308,9 @@ static void fimd_commit(struct exynos_drm_manager *mgr)
 

[PATCH v4 20/34] drm/exynos: Implement mode_fixup manager operation

2014-01-30 Thread Sean Paul
This patch adds a new manager callback for mode_fixup and pipes it
through exynos_drm_crtc. This will allow the manager drivers to
alter the mode during modeset.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4:
 - Added more detail to the commit msg

 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 7 ++-
 drivers/gpu/drm/exynos/exynos_drm_drv.h  | 4 
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index a5cb104..100a561 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -105,7 +105,12 @@ exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
 {
-   /* drm framework doesn't check NULL */
+   struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+   struct exynos_drm_manager *manager = exynos_crtc->manager;
+
+   if (manager->ops->mode_fixup)
+   return manager->ops->mode_fixup(manager, mode, adjusted_mode);
+
return true;
 }

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index caba299..81f7de4 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -184,6 +184,7 @@ struct exynos_drm_display {
  * @initialize: initializes the manager with drm_dev
  * @remove: cleans up the manager for removal
  * @dpms: control device power.
+ * @mode_fixup: fix mode data before applying it
  * @mode_set: set the given mode to the manager
  * @commit: set current hw specific display mode to hw.
  * @enable_vblank: specific driver callback for enabling vblank interrupt.
@@ -201,6 +202,9 @@ struct exynos_drm_manager_ops {
struct drm_device *drm_dev, int pipe);
void (*remove)(struct exynos_drm_manager *mgr);
void (*dpms)(struct exynos_drm_manager *mgr, int mode);
+   bool (*mode_fixup)(struct exynos_drm_manager *mgr,
+   const struct drm_display_mode *mode,
+   struct drm_display_mode *adjusted_mode);
void (*mode_set)(struct exynos_drm_manager *mgr,
const struct drm_display_mode *mode);
void (*commit)(struct exynos_drm_manager *mgr);
-- 
1.8.5.1



[PATCH v4 19/34] drm/exynos: Add mode_set manager operation

2014-01-30 Thread Sean Paul
This patch adds a mode_set callback to the manager operations which
sets the crtc's current mode to the manager driver. This will allow the
fimd  driver to set its mode using values from drm, instead of the dt.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4:
 - Added a bit more explanation to commit msg

 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 4 
 drivers/gpu/drm/exynos/exynos_drm_drv.h  | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index d019385..a5cb104 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -115,6 +115,7 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct 
drm_display_mode *mode,
  struct drm_framebuffer *old_fb)
 {
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+   struct exynos_drm_manager *manager = exynos_crtc->manager;
struct drm_plane *plane = exynos_crtc->plane;
unsigned int crtc_w;
unsigned int crtc_h;
@@ -129,6 +130,9 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct 
drm_display_mode *mode,
crtc_w = crtc->fb->width - x;
crtc_h = crtc->fb->height - y;

+   if (manager->ops->mode_set)
+   manager->ops->mode_set(manager, >mode);
+
ret = exynos_plane_mode_set(plane, crtc, crtc->fb, 0, 0, crtc_w, crtc_h,
x, y, crtc_w, crtc_h);
if (ret)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 4f03242..caba299 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -184,6 +184,7 @@ struct exynos_drm_display {
  * @initialize: initializes the manager with drm_dev
  * @remove: cleans up the manager for removal
  * @dpms: control device power.
+ * @mode_set: set the given mode to the manager
  * @commit: set current hw specific display mode to hw.
  * @enable_vblank: specific driver callback for enabling vblank interrupt.
  * @disable_vblank: specific driver callback for disabling vblank interrupt.
@@ -200,6 +201,8 @@ struct exynos_drm_manager_ops {
struct drm_device *drm_dev, int pipe);
void (*remove)(struct exynos_drm_manager *mgr);
void (*dpms)(struct exynos_drm_manager *mgr, int mode);
+   void (*mode_set)(struct exynos_drm_manager *mgr,
+   const struct drm_display_mode *mode);
void (*commit)(struct exynos_drm_manager *mgr);
int (*enable_vblank)(struct exynos_drm_manager *mgr);
void (*disable_vblank)(struct exynos_drm_manager *mgr);
-- 
1.8.5.1



[PATCH v4 18/34] drm/exynos: Disable unused crtc planes from crtc

2014-01-30 Thread Sean Paul
This patch moves the code which disables unused crtc planes from the
encoder to the crtc. Since there is a 1:1 encoder/crtc mapping in
exynos, the only valid crtc change the pre-existing code could catch is
disconnecting an active crtc from the encoder. Thus it is functionally
equivalent to just disable all planes attached to a crtc when the crtc
is disabled.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_crtc.c| 13 +-
 drivers/gpu/drm/exynos/exynos_drm_encoder.c | 65 ++---
 2 files changed, 15 insertions(+), 63 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index 347d62d..d019385 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -176,10 +176,19 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc 
*crtc, int x, int y,

 static void exynos_drm_crtc_disable(struct drm_crtc *crtc)
 {
-   struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+   struct drm_plane *plane;
+   int ret;

-   exynos_plane_dpms(exynos_crtc->plane, DRM_MODE_DPMS_OFF);
exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
+
+   list_for_each_entry(plane, >dev->mode_config.plane_list, head) {
+   if (plane->crtc != crtc)
+   continue;
+
+   ret = plane->funcs->disable_plane(plane);
+   if (ret)
+   DRM_ERROR("Failed to disable plane %d\n", ret);
+   }
 }

 static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index d4ae664..bfa2f17 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -29,7 +29,6 @@
  * @display: the display structure that maps to this encoder
  */
 struct exynos_drm_encoder {
-   struct drm_crtc *old_crtc;
struct drm_encoder  drm_encoder;
struct exynos_drm_display   *display;
 };
@@ -67,71 +66,15 @@ exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder,
return true;
 }

-static void disable_plane_to_crtc(struct drm_device *dev,
-   struct drm_crtc *old_crtc,
-   struct drm_crtc *new_crtc)
-{
-   struct drm_plane *plane;
-
-   /*
-* if old_crtc isn't same as encoder->crtc then it means that
-* user changed crtc id to another one so the plane to old_crtc
-* should be disabled and plane->crtc should be set to new_crtc
-* (encoder->crtc)
-*/
-   list_for_each_entry(plane, >mode_config.plane_list, head) {
-   if (plane->crtc == old_crtc) {
-   /*
-* do not change below call order.
-*
-* plane->funcs->disable_plane call checks
-* if encoder->crtc is same as plane->crtc and if same
-* then manager_ops->win_disable callback will be called
-* to diasble current hw overlay so plane->crtc should
-* have new_crtc because new_crtc was set to
-* encoder->crtc in advance.
-*/
-   plane->crtc = new_crtc;
-   plane->funcs->disable_plane(plane);
-   }
-   }
-}
-
 static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,
 struct drm_display_mode *mode,
 struct drm_display_mode *adjusted_mode)
 {
-   struct drm_device *dev = encoder->dev;
-   struct drm_connector *connector;
-   struct exynos_drm_display *display;
-
-   list_for_each_entry(connector, >mode_config.connector_list, head) {
-   if (connector->encoder == encoder) {
-   struct exynos_drm_encoder *exynos_encoder;
-
-   exynos_encoder = to_exynos_encoder(encoder);
-
-   if (exynos_encoder->old_crtc != encoder->crtc &&
-   exynos_encoder->old_crtc) {
-
-   /*
-* disable a plane to old crtc and change
-* crtc of the plane to new one.
-*/
-   disable_plane_to_crtc(dev,
-   exynos_encoder->old_crtc,
-   encoder->crtc);
-   }
-
-   display = exynos_encoder->display;
-
-   if (display->ops->mode_set)
-   display->ops->mode_set(display,
- 

[PATCH v4 17/34] drm/exynos: Use drm_mode_copy to copy modes

2014-01-30 Thread Sean Paul
This patch changes the manual copying of mode to adjusted_mode in
mode_fixup to use drm_mode_copy instead of handling things manually.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_hdmi.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 051aa76..3faea8f 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -847,21 +847,13 @@ static void hdmi_mode_fixup(struct exynos_drm_display 
*display,
mode_ok = hdmi_check_mode(display, m);

if (mode_ok == 0) {
-   struct drm_mode_object base;
-   struct list_head head;
-
DRM_INFO("desired mode doesn't exist so\n");
DRM_INFO("use the most suitable mode among modes.\n");

DRM_DEBUG_KMS("Adjusted Mode: [%d]x[%d] [%d]Hz\n",
m->hdisplay, m->vdisplay, m->vrefresh);

-   /* preserve display mode header while copying. */
-   head = adjusted_mode->head;
-   base = adjusted_mode->base;
-   memcpy(adjusted_mode, m, sizeof(*m));
-   adjusted_mode->head = head;
-   adjusted_mode->base = base;
+   drm_mode_copy(adjusted_mode, m);
break;
}
}
-- 
1.8.5.1



[PATCH v4 16/34] drm/exynos: Remove exynos_drm_hdmi shim

2014-01-30 Thread Sean Paul
This patch trims exynos_drm_hdmi out of the driver. The reason it
existed in the first place was to make up for the mixture of
display/overlay/manager ops being spread across hdmi and mixer. With
that code now rationalized, mixer and hdmi map directly to
exynos_drm_crtc and exynos_drm_encoder, respectively. Since there is a
1:1 mapping, we no longer need this layer.

Signed-off-by: Sean Paul 
---

Changes in v2:
 - hdmi/mixer ops now take display/manager instead of context
Changes in v3:
 - Moved removal of exynos_drm_hdmi.c file here
Changes in v4: None

 drivers/gpu/drm/exynos/Makefile  |   3 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c  |  13 -
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 416 ---
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h |  69 -
 drivers/gpu/drm/exynos/exynos_hdmi.c | 162 +++-
 drivers/gpu/drm/exynos/exynos_mixer.c| 192 +++---
 drivers/gpu/drm/exynos/exynos_mixer.h|  20 ++
 7 files changed, 217 insertions(+), 658 deletions(-)
 delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_hdmi.c
 delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_hdmi.h
 create mode 100644 drivers/gpu/drm/exynos/exynos_mixer.h

diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 819961a..afbe499 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -11,8 +11,7 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o 
exynos_drm_connector.o \
 exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) += exynos_drm_dmabuf.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)+= exynos_drm_fimd.o
-exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o \
-  exynos_drm_hdmi.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 28e2cef..6143742 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -366,13 +366,6 @@ static int __init exynos_drm_init(void)
ret = platform_driver_register(_driver);
if (ret < 0)
goto out_mixer;
-   ret = platform_driver_register(_drm_common_hdmi_driver);
-   if (ret < 0)
-   goto out_common_hdmi;
-
-   ret = exynos_platform_device_hdmi_register();
-   if (ret < 0)
-   goto out_common_hdmi_dev;
 #endif

 #ifdef CONFIG_DRM_EXYNOS_VIDI
@@ -465,10 +458,6 @@ out_vidi:
 #endif

 #ifdef CONFIG_DRM_EXYNOS_HDMI
-   exynos_platform_device_hdmi_unregister();
-out_common_hdmi_dev:
-   platform_driver_unregister(_drm_common_hdmi_driver);
-out_common_hdmi:
platform_driver_unregister(_driver);
 out_mixer:
platform_driver_unregister(_driver);
@@ -510,8 +499,6 @@ static void __exit exynos_drm_exit(void)
 #endif

 #ifdef CONFIG_DRM_EXYNOS_HDMI
-   exynos_platform_device_hdmi_unregister();
-   platform_driver_unregister(_drm_common_hdmi_driver);
platform_driver_unregister(_driver);
platform_driver_unregister(_driver);
 #endif
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
deleted file mode 100644
index b0b09b2..000
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * Copyright (C) 2011 Samsung Electronics Co.Ltd
- * Authors:
- * Inki Dae 
- * Seung-Woo Kim 
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- *
- */
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#include "exynos_drm_drv.h"
-#include "exynos_drm_hdmi.h"
-
-/* platform device pointer for common drm hdmi device. */
-static struct platform_device *exynos_drm_hdmi_pdev;
-
-/* Common hdmi subdrv needs to access the hdmi and mixer though context.
-* These should be initialied by the repective drivers */
-static struct exynos_drm_hdmi_context *hdmi_ctx;
-static struct exynos_drm_hdmi_context *mixer_ctx;
-
-/* these callback points shoud be set by specific drivers. */
-static struct exynos_hdmi_ops *hdmi_ops;
-static struct exynos_mixer_ops *mixer_ops;
-
-struct drm_hdmi_context {
-   struct exynos_drm_hdmi_context  *hdmi_ctx;
-   struct exynos_drm_hdmi_context  *mixer_ctx;
-
-   boolenabled[MIXER_WIN_NR];
-};
-
-int exynos_platform_device_hdmi_register(void)
-{
-   struct platform_device *pdev;
-
-   if (exynos_drm_hdmi_pdev)
-   return -EEXIST;
-
-   pdev = platform_device_register_simple(
-

[PATCH v4 15/34] ARM: dts: exynos: Add i2c phandles to hdmi node

2014-01-30 Thread Sean Paul
This patch references the hdmi ddc and phy i2c nodes directly in the
hdmi node to match the updated bindings.

Signed-off-by: Sean Paul 
---

Changes in v4:
 - Added patch

 arch/arm/boot/dts/cros5250-common.dtsi| 6 --
 arch/arm/boot/dts/exynos5250-smdk5250.dts | 6 --
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/cros5250-common.dtsi 
b/arch/arm/boot/dts/cros5250-common.dtsi
index 9b186ac..ada9d99 100644
--- a/arch/arm/boot/dts/cros5250-common.dtsi
+++ b/arch/arm/boot/dts/cros5250-common.dtsi
@@ -201,7 +201,7 @@
samsung,i2c-sda-delay = <100>;
samsung,i2c-max-bus-freq = <66000>;

-   hdmiddc at 50 {
+   hdmi_ddc_node: hdmiddc at 50 {
compatible = "samsung,exynos4210-hdmiddc";
reg = <0x50>;
};
@@ -235,7 +235,7 @@
samsung,i2c-sda-delay = <100>;
samsung,i2c-max-bus-freq = <378000>;

-   hdmiphy at 38 {
+   hdmi_phy_node: hdmiphy at 38 {
compatible = "samsung,exynos4212-hdmiphy";
reg = <0x38>;
};
@@ -313,6 +313,8 @@

hdmi {
hpd-gpio = < 7 0>;
+   ddc = <_ddc_node>;
+   phy = <_phy_node>;
};

gpio-keys {
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts 
b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index f86d567..b14985a 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -104,7 +104,7 @@
samsung,i2c-sda-delay = <100>;
samsung,i2c-max-bus-freq = <66000>;

-   hdmiddc at 50 {
+   hdmi_ddc_node: hdmiddc at 50 {
compatible = "samsung,exynos4210-hdmiddc";
reg = <0x50>;
};
@@ -134,7 +134,7 @@
samsung,i2c-sda-delay = <100>;
samsung,i2c-max-bus-freq = <66000>;

-   hdmiphy at 38 {
+   hdmi_phy_node: hdmiphy at 38 {
compatible = "samsung,exynos4212-hdmiphy";
reg = <0x38>;
};
@@ -220,6 +220,8 @@

hdmi {
hpd-gpio = < 7 0>;
+   ddc = <_ddc_node>;
+   phy = <_phy_node>;
};

codec at 1100 {
-- 
1.8.5.1



[PATCH v4 14/34] drm/exynos: hdmi: remove the i2c drivers and use devtree

2014-01-30 Thread Sean Paul
From: Daniel Kurtz 

The i2c client was previously being passed into the hdmi driver via a
dedicated i2c driver, and then a global variable. This patch removes all
of that and just uses the device tree to get the i2c_client. This patch
also properly references the client so we don't lose it before we're
done with it.

Signed-off-by: Daniel Kurtz 
[seanpaul changed to phandle lookup instead of using of node name]
Signed-off-by: Sean Paul 
---

Changes in v2:
 - Change include to linux/i2c.h instead of linux/of_i2c.h
Changes in v3: None
Changes in v4:
 - Changed to find phy via phandle instead of by name

 .../devicetree/bindings/video/exynos_hdmi.txt  |  5 ++
 drivers/gpu/drm/exynos/Makefile|  1 -
 drivers/gpu/drm/exynos/exynos_ddc.c| 63 -
 drivers/gpu/drm/exynos/exynos_hdmi.c   | 59 +---
 drivers/gpu/drm/exynos/exynos_hdmi.h   | 23 
 drivers/gpu/drm/exynos/exynos_hdmiphy.c| 65 --
 6 files changed, 32 insertions(+), 184 deletions(-)
 delete mode 100644 drivers/gpu/drm/exynos/exynos_ddc.c
 delete mode 100644 drivers/gpu/drm/exynos/exynos_hdmi.h
 delete mode 100644 drivers/gpu/drm/exynos/exynos_hdmiphy.c

diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt 
b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
index 50decf8..f9187a2 100644
--- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
+++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
@@ -25,6 +25,9 @@ Required properties:
sclk_pixel.
 - clock-names: aliases as per driver requirements for above clock IDs:
"hdmi", "sclk_hdmi", "sclk_pixel", "sclk_hdmiphy" and "mout_hdmi".
+- ddc: phandle to the hdmi ddc node
+- phy: phandle to the hdmi phy node
+
 Example:

hdmi {
@@ -32,4 +35,6 @@ Example:
reg = <0x1453 0x10>;
interrupts = <0 95 0>;
hpd-gpio = < 7 1>;
+   ddc = <_ddc_node>;
+   phy = <_phy_node>;
};
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 639b49e..819961a 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -12,7 +12,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) += exynos_drm_dmabuf.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)+= exynos_drm_fimd.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o \
-  exynos_ddc.o exynos_hdmiphy.o \
   exynos_drm_hdmi.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o
diff --git a/drivers/gpu/drm/exynos/exynos_ddc.c 
b/drivers/gpu/drm/exynos/exynos_ddc.c
deleted file mode 100644
index 6a8c84e..000
--- a/drivers/gpu/drm/exynos/exynos_ddc.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2011 Samsung Electronics Co.Ltd
- * Authors:
- * Seung-Woo Kim 
- * Inki Dae 
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- *
- */
-
-#include 
-
-#include 
-#include 
-#include 
-
-#include "exynos_drm_drv.h"
-#include "exynos_hdmi.h"
-
-static int s5p_ddc_probe(struct i2c_client *client,
-   const struct i2c_device_id *dev_id)
-{
-   hdmi_attach_ddc_client(client);
-
-   dev_info(>adapter->dev,
-   "attached %s into i2c adapter successfully\n",
-   client->name);
-
-   return 0;
-}
-
-static int s5p_ddc_remove(struct i2c_client *client)
-{
-   dev_info(>adapter->dev,
-   "detached %s from i2c adapter successfully\n",
-   client->name);
-
-   return 0;
-}
-
-static struct of_device_id hdmiddc_match_types[] = {
-   {
-   .compatible = "samsung,exynos5-hdmiddc",
-   }, {
-   .compatible = "samsung,exynos4210-hdmiddc",
-   }, {
-   /* end node */
-   }
-};
-
-struct i2c_driver ddc_driver = {
-   .driver = {
-   .name = "exynos-hdmiddc",
-   .owner = THIS_MODULE,
-   .of_match_table = hdmiddc_match_types,
-   },
-   .probe  = s5p_ddc_probe,
-   .remove = s5p_ddc_remove,
-   .command= NULL,
-};
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 7e70228..97a0e57 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 

 #include 
@@ -40,8 +41,6 @@
 #include "exynos_drm_drv.h"
 #include "exynos_drm_hdmi.h"

-#include 

[PATCH v4 13/34] drm/exynos: Split manager/display/subdrv

2014-01-30 Thread Sean Paul
This patch splits display and manager from subdrv. The result is that
crtc functions can directly call into manager callbacks and encoder
functions can directly call into display callbacks. This will allow
us to remove the exynos_drm_hdmi shim and support mixer/hdmi & fimd/dp
with common code.

Signed-off-by: Sean Paul 
---

Changes in v2:
 - Pass display into display_ops instead of context
Changes in v3:
 - Changed vidi args to exynos_drm_display instead of void
 - Moved exynos_drm_hdmi.c removal into next patch
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_connector.c |  50 ++---
 drivers/gpu/drm/exynos/exynos_drm_core.c  | 181 +-
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  | 115 +---
 drivers/gpu/drm/exynos/exynos_drm_crtc.h  |  20 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |  29 +--
 drivers/gpu/drm/exynos/exynos_drm_drv.h   | 106 +++
 drivers/gpu/drm/exynos/exynos_drm_encoder.c   | 258 --
 drivers/gpu/drm/exynos/exynos_drm_encoder.h   |  18 +-
 drivers/gpu/drm/exynos/exynos_drm_fb.c|   4 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 214 ++---
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c  | 211 +
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h  |   2 +
 drivers/gpu/drm/exynos/exynos_drm_plane.c |  15 +-
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 129 ++---
 14 files changed, 642 insertions(+), 710 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c 
b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index ca270e2..9a16dbe 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -23,26 +23,20 @@
drm_connector)

 struct exynos_drm_connector {
-   struct drm_connectordrm_connector;
-   uint32_tencoder_id;
-   struct exynos_drm_manager *manager;
+   struct drm_connectordrm_connector;
+   uint32_tencoder_id;
+   struct exynos_drm_display   *display;
 };

 static int exynos_drm_connector_get_modes(struct drm_connector *connector)
 {
struct exynos_drm_connector *exynos_connector =
to_exynos_connector(connector);
-   struct exynos_drm_manager *manager = exynos_connector->manager;
-   struct exynos_drm_display_ops *display_ops = manager->display_ops;
+   struct exynos_drm_display *display = exynos_connector->display;
struct edid *edid = NULL;
unsigned int count = 0;
int ret;

-   if (!display_ops) {
-   DRM_DEBUG_KMS("display_ops is null.\n");
-   return 0;
-   }
-
/*
 * if get_edid() exists then get_edid() callback of hdmi side
 * is called to get edid data through i2c interface else
@@ -51,8 +45,8 @@ static int exynos_drm_connector_get_modes(struct 
drm_connector *connector)
 * P.S. in case of lcd panel, count is always 1 if success
 * because lcd panel has only one mode.
 */
-   if (display_ops->get_edid) {
-   edid = display_ops->get_edid(manager->dev, connector);
+   if (display->ops->get_edid) {
+   edid = display->ops->get_edid(display, connector);
if (IS_ERR_OR_NULL(edid)) {
ret = PTR_ERR(edid);
edid = NULL;
@@ -75,8 +69,8 @@ static int exynos_drm_connector_get_modes(struct 
drm_connector *connector)
return 0;
}

-   if (display_ops->get_panel)
-   panel = display_ops->get_panel(manager->dev);
+   if (display->ops->get_panel)
+   panel = display->ops->get_panel(display);
else {
drm_mode_destroy(connector->dev, mode);
return 0;
@@ -105,14 +99,13 @@ static int exynos_drm_connector_mode_valid(struct 
drm_connector *connector,
 {
struct exynos_drm_connector *exynos_connector =
to_exynos_connector(connector);
-   struct exynos_drm_manager *manager = exynos_connector->manager;
-   struct exynos_drm_display_ops *display_ops = manager->display_ops;
+   struct exynos_drm_display *display = exynos_connector->display;
int ret = MODE_BAD;

DRM_DEBUG_KMS("%s\n", __FILE__);

-   if (display_ops && display_ops->check_mode)
-   if (!display_ops->check_mode(manager->dev, mode))
+   if (display->ops->check_mode)
+   if (!display->ops->check_mode(display, mode))
ret = MODE_OK;

return ret;
@@ -151,8 +144,7 @@ static int exynos_drm_connector_fill_modes(struct 
drm_connector *connector,
 {
struct exynos_drm_connector *exynos_connector =
to_exynos_connector(connector);
-   

[PATCH v4 12/34] drm/exynos: Use unsigned long for possible_crtcs

2014-01-30 Thread Sean Paul
Change all instances of possible_crtcs in the exynos drm driver to be
unsigned long. This matches the type used in the drm layer.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_drv.c | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_encoder.c | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_encoder.h | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_plane.c   | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_plane.h   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 215131a..46e58b2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -86,7 +86,7 @@ static int exynos_drm_load(struct drm_device *dev, unsigned 
long flags)

for (nr = 0; nr < MAX_PLANE; nr++) {
struct drm_plane *plane;
-   unsigned int possible_crtcs = (1 << MAX_CRTC) - 1;
+   unsigned long possible_crtcs = (1 << MAX_CRTC) - 1;

plane = exynos_plane_init(dev, possible_crtcs, false);
if (!plane)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index a823d53..efe4e60 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -249,7 +249,7 @@ void exynos_drm_encoder_setup(struct drm_device *dev)
 struct drm_encoder *
 exynos_drm_encoder_create(struct drm_device *dev,
   struct exynos_drm_manager *manager,
-  unsigned int possible_crtcs)
+  unsigned long possible_crtcs)
 {
struct drm_encoder *encoder;
struct exynos_drm_encoder *exynos_encoder;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
index 89e2fb0..0f3e5e2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
@@ -19,7 +19,7 @@ struct exynos_drm_manager;
 void exynos_drm_encoder_setup(struct drm_device *dev);
 struct drm_encoder *exynos_drm_encoder_create(struct drm_device *dev,
   struct exynos_drm_manager *mgr,
-  unsigned int possible_crtcs);
+  unsigned long possible_crtcs);
 struct exynos_drm_manager *
 exynos_drm_get_manager(struct drm_encoder *encoder);
 void exynos_drm_fn_encoder(struct drm_crtc *crtc, void *data,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c 
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index fcb0652..cff3aed 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -259,7 +259,7 @@ static void exynos_plane_attach_zpos_property(struct 
drm_plane *plane)
 }

 struct drm_plane *exynos_plane_init(struct drm_device *dev,
-   unsigned int possible_crtcs, bool priv)
+   unsigned long possible_crtcs, bool priv)
 {
struct exynos_plane *exynos_plane;
int err;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h 
b/drivers/gpu/drm/exynos/exynos_drm_plane.h
index 8831245..84d464c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h
@@ -17,4 +17,4 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct 
drm_crtc *crtc,
 void exynos_plane_commit(struct drm_plane *plane);
 void exynos_plane_dpms(struct drm_plane *plane, int mode);
 struct drm_plane *exynos_plane_init(struct drm_device *dev,
-   unsigned int possible_crtcs, bool priv);
+   unsigned long possible_crtcs, bool priv);
-- 
1.8.5.1



[PATCH v4 11/34] drm/exynos: Don't keep dpms state in encoder

2014-01-30 Thread Sean Paul
This patch removes the dpms state tracking in encoder. This
state is at best confusing and at worst incorrect since the display
drivers can turn on and off without propagating the value.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4: None

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

diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index 5bf1e1e..a823d53 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -28,32 +28,22 @@
  * @drm_encoder: encoder object.
  * @manager: specific encoder has its own manager to control a hardware
  * appropriately and we can access a hardware drawing on this manager.
- * @dpms: store the encoder dpms value.
  */
 struct exynos_drm_encoder {
struct drm_crtc *old_crtc;
struct drm_encoder  drm_encoder;
struct exynos_drm_manager   *manager;
-   int dpms;
 };

 static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)
 {
struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);
-   struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
struct exynos_drm_display_ops *display_ops = manager->display_ops;

DRM_DEBUG_KMS("encoder dpms: %d\n", mode);

-   if (exynos_encoder->dpms == mode) {
-   DRM_DEBUG_KMS("desired dpms mode is same as previous one.\n");
-   return;
-   }
-
if (display_ops && display_ops->dpms)
display_ops->dpms(manager->ctx, mode);
-
-   exynos_encoder->dpms = mode;
 }

 static bool
@@ -157,12 +147,6 @@ static void exynos_drm_encoder_commit(struct drm_encoder 
*encoder)

if (manager_ops && manager_ops->commit)
manager_ops->commit(manager);
-
-   /*
-* In case of setcrtc, there is no way to update encoder's dpms
-* so update it here.
-*/
-   exynos_encoder->dpms = DRM_MODE_DPMS_ON;
 }

 void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb)
@@ -281,7 +265,6 @@ exynos_drm_encoder_create(struct drm_device *dev,
if (!exynos_encoder)
return NULL;

-   exynos_encoder->dpms = DRM_MODE_DPMS_OFF;
exynos_encoder->manager = manager;
encoder = _encoder->drm_encoder;
encoder->possible_crtcs = possible_crtcs;
-- 
1.8.5.1



[PATCH v4 10/34] drm/exynos: Rename display_op power_on to dpms

2014-01-30 Thread Sean Paul
This patch renames the display_op power_on to dpms to accurately reflect
what the function does.

The side-effect of this patch is that the new hdmi dpms callback is now
invoked twice in the dpms path. This is safe and will be dealt with when
the exynos_drm shim goes away.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3:
 - Changed vidi to dpms as well
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_drv.h | 4 ++--
 drivers/gpu/drm/exynos/exynos_drm_encoder.c | 4 ++--
 drivers/gpu/drm/exynos/exynos_drm_fimd.c| 8 
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c| 8 
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h| 3 +--
 drivers/gpu/drm/exynos/exynos_drm_vidi.c| 8 
 drivers/gpu/drm/exynos/exynos_hdmi.c| 2 +-
 7 files changed, 10 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 5912841..cf65f65 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -128,7 +128,7 @@ struct exynos_drm_overlay {
  * @get_edid: get edid modes from display driver.
  * @get_panel: get panel object from display driver.
  * @check_mode: check if mode is valid or not.
- * @power_on: display device on or off.
+ * @dpms: display device on or off.
  */
 struct exynos_drm_display_ops {
enum exynos_drm_output_type type;
@@ -138,7 +138,7 @@ struct exynos_drm_display_ops {
struct drm_connector *connector);
void *(*get_panel)(struct device *dev);
int (*check_mode)(struct device *dev, struct drm_display_mode *mode);
-   int (*power_on)(struct device *dev, int mode);
+   int (*dpms)(struct device *dev, int mode);
 };

 /*
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index df4b2852..5bf1e1e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -50,8 +50,8 @@ static void exynos_drm_encoder_dpms(struct drm_encoder 
*encoder, int mode)
return;
}

-   if (display_ops && display_ops->power_on)
-   display_ops->power_on(manager->ctx, mode);
+   if (display_ops && display_ops->dpms)
+   display_ops->dpms(manager->ctx, mode);

exynos_encoder->dpms = mode;
 }
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 810c61f..ff1ba94 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -169,19 +169,11 @@ static int fimd_check_mode(struct device *dev, struct 
drm_display_mode *mode)
return 0;
 }

-static int fimd_display_power_on(struct device *dev, int mode)
-{
-   /* TODO */
-
-   return 0;
-}
-
 static struct exynos_drm_display_ops fimd_display_ops = {
.type = EXYNOS_DISPLAY_TYPE_LCD,
.is_connected = fimd_display_is_connected,
.get_panel = fimd_get_panel,
.check_mode = fimd_check_mode,
-   .power_on = fimd_display_power_on,
 };

 static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index c5de00a..f9a9324 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -159,12 +159,12 @@ static int drm_hdmi_check_mode(struct device *dev,
return drm_hdmi_check_mode_ctx(ctx, mode);
 }

-static int drm_hdmi_power_on(struct device *dev, int mode)
+static int drm_hdmi_display_dpms(struct device *dev, int mode)
 {
struct drm_hdmi_context *ctx = to_context(dev);

-   if (hdmi_ops && hdmi_ops->power_on)
-   return hdmi_ops->power_on(ctx->hdmi_ctx->ctx, mode);
+   if (hdmi_ops && hdmi_ops->dpms)
+   hdmi_ops->dpms(ctx->hdmi_ctx->ctx, mode);

return 0;
 }
@@ -175,7 +175,7 @@ static struct exynos_drm_display_ops drm_hdmi_display_ops = 
{
.is_connected = drm_hdmi_is_connected,
.get_edid = drm_hdmi_get_edid,
.check_mode = drm_hdmi_check_mode,
-   .power_on = drm_hdmi_power_on,
+   .dpms = drm_hdmi_display_dpms,
 };

 static int drm_hdmi_enable_vblank(struct exynos_drm_manager *mgr)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h 
b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
index cf7b1da..923239b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
@@ -33,14 +33,13 @@ struct exynos_hdmi_ops {
struct edid *(*get_edid)(void *ctx,
struct drm_connector *connector);
int (*check_mode)(void *ctx, struct drm_display_mode *mode);
-   int (*power_on)(void *ctx, int mode);
+   void (*dpms)(void *ctx, int mode);

/* manager */
void (*mode_set)(void *ctx, struct drm_display_mode *mode);
void (*get_max_resol)(void *ctx, unsigned int *width,
  

[PATCH v4 09/34] drm/exynos: Remove dpms link between encoder/connector

2014-01-30 Thread Sean Paul
This patch removes the call from encoder dpms into connector dpms (which
will then call back into encoder dpms through the helper function). The
callback is likely to keep connector->dpms in the right state when
initiating dpms from crtc or encoder, but this isn't the right way to do
it. This patch is the first step towards rationalizing power management
in the exynos drm driver.

Signed-off-by: Sean Paul 
---

Changes in v2:
 - Split out the apply change into a new patch
Changes in v3: None
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_connector.c | 42 ++
 drivers/gpu/drm/exynos/exynos_drm_connector.h |  4 ---
 drivers/gpu/drm/exynos/exynos_drm_encoder.c   | 50 +++
 3 files changed, 8 insertions(+), 88 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c 
b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index 23b69d8..ca270e2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -26,7 +26,6 @@ struct exynos_drm_connector {
struct drm_connectordrm_connector;
uint32_tencoder_id;
struct exynos_drm_manager *manager;
-   uint32_tdpms;
 };

 static int exynos_drm_connector_get_modes(struct drm_connector *connector)
@@ -119,7 +118,8 @@ static int exynos_drm_connector_mode_valid(struct 
drm_connector *connector,
return ret;
 }

-struct drm_encoder *exynos_drm_best_encoder(struct drm_connector *connector)
+static struct drm_encoder *exynos_drm_best_encoder(
+   struct drm_connector *connector)
 {
struct drm_device *dev = connector->dev;
struct exynos_drm_connector *exynos_connector =
@@ -146,41 +146,6 @@ static struct drm_connector_helper_funcs 
exynos_connector_helper_funcs = {
.best_encoder   = exynos_drm_best_encoder,
 };

-void exynos_drm_display_power(struct drm_connector *connector, int mode)
-{
-   struct drm_encoder *encoder = exynos_drm_best_encoder(connector);
-   struct exynos_drm_connector *exynos_connector;
-   struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);
-   struct exynos_drm_display_ops *display_ops = manager->display_ops;
-
-   exynos_connector = to_exynos_connector(connector);
-
-   if (exynos_connector->dpms == mode) {
-   DRM_DEBUG_KMS("desired dpms mode is same as previous one.\n");
-   return;
-   }
-
-   if (display_ops && display_ops->power_on)
-   display_ops->power_on(manager->dev, mode);
-
-   exynos_connector->dpms = mode;
-}
-
-static void exynos_drm_connector_dpms(struct drm_connector *connector,
-   int mode)
-{
-   /*
-* in case that drm_crtc_helper_set_mode() is called,
-* encoder/crtc->funcs->dpms() will be just returned
-* because they already were DRM_MODE_DPMS_ON so only
-* exynos_drm_display_power() will be called.
-*/
-   drm_helper_connector_dpms(connector, mode);
-
-   exynos_drm_display_power(connector, mode);
-
-}
-
 static int exynos_drm_connector_fill_modes(struct drm_connector *connector,
unsigned int max_width, unsigned int max_height)
 {
@@ -236,7 +201,7 @@ static void exynos_drm_connector_destroy(struct 
drm_connector *connector)
 }

 static struct drm_connector_funcs exynos_connector_funcs = {
-   .dpms   = exynos_drm_connector_dpms,
+   .dpms   = drm_helper_connector_dpms,
.fill_modes = exynos_drm_connector_fill_modes,
.detect = exynos_drm_connector_detect,
.destroy= exynos_drm_connector_destroy,
@@ -281,7 +246,6 @@ struct drm_connector *exynos_drm_connector_create(struct 
drm_device *dev,

exynos_connector->encoder_id = encoder->base.id;
exynos_connector->manager = manager;
-   exynos_connector->dpms = DRM_MODE_DPMS_OFF;
connector->dpms = DRM_MODE_DPMS_OFF;
connector->encoder = encoder;

diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.h 
b/drivers/gpu/drm/exynos/exynos_drm_connector.h
index 547c6b5..4eb20d7 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.h
@@ -17,8 +17,4 @@
 struct drm_connector *exynos_drm_connector_create(struct drm_device *dev,
   struct drm_encoder *encoder);

-struct drm_encoder *exynos_drm_best_encoder(struct drm_connector *connector);
-
-void exynos_drm_display_power(struct drm_connector *connector, int mode);
-
 #endif
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index 19ee84d..df4b2852 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -29,35 +29,19 @@
  * @manager: specific encoder has its own manager to control a hardware
  * appropriately and we 

[PATCH v4 08/34] drm/exynos: Remove apply manager callback

2014-01-30 Thread Sean Paul
This patch removes the apply() manager callback in favor of putting the
relevant commits in the individual drivers. This will mitigate some of
the difference between the suspend/resume path and the dpms path

Signed-off-by: Sean Paul 
---

Changes in v2:
 - This was previously in another patch, but moved since it warrants its own
Changes in v3:
 - Removed apply() from vidi
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_drv.h |  2 --
 drivers/gpu/drm/exynos/exynos_drm_encoder.c |  6 --
 drivers/gpu/drm/exynos/exynos_drm_fimd.c| 22 +-
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c| 17 -
 drivers/gpu/drm/exynos/exynos_drm_vidi.c|  1 -
 drivers/gpu/drm/exynos/exynos_hdmi.c|  1 +
 drivers/gpu/drm/exynos/exynos_mixer.c   |  2 ++
 7 files changed, 8 insertions(+), 43 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 5e82dc9..5912841 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -146,7 +146,6 @@ struct exynos_drm_display_ops {
  *
  * @initialize: initializes the manager with drm_dev
  * @dpms: control device power.
- * @apply: set timing, vblank and overlay data to registers.
  * @mode_fixup: fix mode data comparing to hw specific display mode.
  * @mode_set: convert drm_display_mode to hw specific display mode and
  *   would be called by encoder->mode_set().
@@ -166,7 +165,6 @@ struct exynos_drm_manager_ops {
int (*initialize)(struct exynos_drm_manager *mgr,
struct drm_device *drm_dev);
void (*dpms)(struct exynos_drm_manager *mgr, int mode);
-   void (*apply)(struct exynos_drm_manager *mgr);
void (*mode_fixup)(struct exynos_drm_manager *mgr,
struct drm_connector *connector,
const struct drm_display_mode *mode,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index ec627fa..19ee84d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -57,8 +57,6 @@ static void exynos_drm_connector_power(struct drm_encoder 
*encoder, int mode)
 static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)
 {
struct drm_device *dev = encoder->dev;
-   struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);
-   struct exynos_drm_manager_ops *manager_ops = manager->ops;
struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);

DRM_DEBUG_KMS("encoder dpms: %d\n", mode);
@@ -72,10 +70,6 @@ static void exynos_drm_encoder_dpms(struct drm_encoder 
*encoder, int mode)

switch (mode) {
case DRM_MODE_DPMS_ON:
-   if (manager_ops && manager_ops->apply)
-   if (!exynos_encoder->updated)
-   manager_ops->apply(manager);
-
exynos_drm_connector_power(encoder, mode);
exynos_encoder->dpms = mode;
break;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 411e90a..810c61f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -672,7 +672,6 @@ static void fimd_win_disable(struct exynos_drm_manager 
*mgr, int zpos)
 static struct exynos_drm_manager_ops fimd_manager_ops = {
.initialize = fimd_mgr_initialize,
.dpms = fimd_dpms,
-   .apply = fimd_apply,
.commit = fimd_commit,
.enable_vblank = fimd_enable_vblank,
.disable_vblank = fimd_disable_vblank,
@@ -883,6 +882,8 @@ static int fimd_activate(struct exynos_drm_manager *mgr, 
bool enable)
fimd_enable_vblank(mgr);

fimd_window_resume(dev);
+
+   fimd_apply(mgr);
} else {
fimd_window_suspend(dev);

@@ -1037,23 +1038,10 @@ static int fimd_resume(struct device *dev)
 * of pm runtime would still be 1 so in this case, fimd driver
 * should be on directly not drawing on pm runtime interface.
 */
-   if (!pm_runtime_suspended(dev)) {
-   int ret;
+   if (pm_runtime_suspended(dev))
+   return 0;

-   ret = fimd_activate(mgr, true);
-   if (ret < 0)
-   return ret;
-
-   /*
-* in case of dpms on(standby), fimd_apply function will
-* be called by encoder's dpms callback to update fimd's
-* registers but in case of sleep wakeup, it's not.
-* so fimd_apply function should be called at here.
-*/
-   fimd_apply(mgr);
-   }
-
-   return 0;
+   return fimd_activate(mgr, true);
 }
 #endif

diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c 

[PATCH v4 07/34] drm/exynos: Pass exynos_drm_manager in manager ops instead of dev

2014-01-30 Thread Sean Paul
This patch changes the manager ops callbacks from accepting the subdrv
device pointer to taking a pointer to the manager. This will allow us
to move closer to decoupling manager/display from subdrv, and subsequently
decoupling the crtc/plane from the encoder.

Signed-off-by: Sean Paul 
---

Changes in v2:
 - Instead of passing context, pass manager
 - Properly assign ctx->dev in fimd driver
Changes in v3:
 - Added vidi implementation
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_connector.c |   2 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |  35 
 drivers/gpu/drm/exynos/exynos_drm_encoder.c   |  27 +++---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 114 ++
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c  |  72 
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  |  83 ++-
 6 files changed, 180 insertions(+), 153 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c 
b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index e082efb..23b69d8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -198,7 +198,7 @@ static int exynos_drm_connector_fill_modes(struct 
drm_connector *connector,
 * resolution then get max width and height from that driver.
 */
if (ops && ops->get_max_resol)
-   ops->get_max_resol(manager->dev, , );
+   ops->get_max_resol(manager, , );

return drm_helper_probe_single_connector_modes(connector, width,
height);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 2811486..5e82dc9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -161,27 +161,28 @@ struct exynos_drm_display_ops {
  * @win_enable: enable hardware specific overlay.
  * @win_disable: disable hardware specific overlay.
  */
+struct exynos_drm_manager;
 struct exynos_drm_manager_ops {
-   int (*initialize)(struct device *subdrv_dev,
-   struct drm_device *drm_dev);
-   void (*dpms)(struct device *subdrv_dev, int mode);
-   void (*apply)(struct device *subdrv_dev);
-   void (*mode_fixup)(struct device *subdrv_dev,
+   int (*initialize)(struct exynos_drm_manager *mgr,
+   struct drm_device *drm_dev);
+   void (*dpms)(struct exynos_drm_manager *mgr, int mode);
+   void (*apply)(struct exynos_drm_manager *mgr);
+   void (*mode_fixup)(struct exynos_drm_manager *mgr,
struct drm_connector *connector,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode);
-   void (*mode_set)(struct device *subdrv_dev, void *mode);
-   void (*get_max_resol)(struct device *subdrv_dev, unsigned int *width,
-   unsigned int *height);
-   void (*commit)(struct device *subdrv_dev);
-   int (*enable_vblank)(struct device *subdrv_dev);
-   void (*disable_vblank)(struct device *subdrv_dev);
-   void (*wait_for_vblank)(struct device *subdrv_dev);
-   void (*win_mode_set)(struct device *subdrv_dev,
+   void (*mode_set)(struct exynos_drm_manager *mgr, void *mode);
+   void (*get_max_resol)(struct exynos_drm_manager *mgr,
+   unsigned int *width, unsigned int *height);
+   void (*commit)(struct exynos_drm_manager *mgr);
+   int (*enable_vblank)(struct exynos_drm_manager *mgr);
+   void (*disable_vblank)(struct exynos_drm_manager *mgr);
+   void (*wait_for_vblank)(struct exynos_drm_manager *mgr);
+   void (*win_mode_set)(struct exynos_drm_manager *mgr,
struct exynos_drm_overlay *overlay);
-   void (*win_commit)(struct device *subdrv_dev, int zpos);
-   void (*win_enable)(struct device *subdrv_dev, int zpos);
-   void (*win_disable)(struct device *subdrv_dev, int zpos);
+   void (*win_commit)(struct exynos_drm_manager *mgr, int zpos);
+   void (*win_enable)(struct exynos_drm_manager *mgr, int zpos);
+   void (*win_disable)(struct exynos_drm_manager *mgr, int zpos);
 };

 /*
@@ -197,12 +198,14 @@ struct exynos_drm_manager_ops {
  * these callbacks should be set by specific drivers such fimd
  * or hdmi driver and are used to control display devices such as
  * analog tv, digital tv and lcd panel and also get timing data for them.
+ * @ctx: A pointer to the manager's implementation specific context
  */
 struct exynos_drm_manager {
struct device *dev;
int pipe;
struct exynos_drm_manager_ops *ops;
struct exynos_drm_display_ops *display_ops;
+   void *ctx;
 };

 struct exynos_drm_g2d_private {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index 

[PATCH v4 06/34] drm/exynos: hdmi: Implement initialize op for hdmi

2014-01-30 Thread Sean Paul
This patch implements the initialize callback in the hdmi and mixer
manager. This allows us to get rid of drm_dev in the drm_hdmi level and
track it in the mixer and hdmi drivers. This is one of the things
holding back the complete removal of the drm_hdmi layer.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4:
 - Moved hardware initialization after we have a valid drm_device

 drivers/gpu/drm/exynos/exynos_drm_hdmi.c |  35 ++-
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h |   3 +-
 drivers/gpu/drm/exynos/exynos_hdmi.c |  18 +-
 drivers/gpu/drm/exynos/exynos_mixer.c| 351 +++
 4 files changed, 219 insertions(+), 188 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index a1ef3c9..aebcc0e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -97,6 +97,18 @@ void exynos_mixer_ops_register(struct exynos_mixer_ops *ops)
mixer_ops = ops;
 }

+static int drm_hdmi_display_initialize(struct device *dev,
+   struct drm_device *drm_dev)
+{
+   struct drm_hdmi_context *ctx = to_context(dev);
+
+   if (hdmi_ops && hdmi_ops->initialize)
+   return hdmi_ops->initialize(ctx->hdmi_ctx->ctx, drm_dev);
+
+   return 0;
+}
+
+
 static bool drm_hdmi_is_connected(struct device *dev)
 {
struct drm_hdmi_context *ctx = to_context(dev);
@@ -153,6 +165,7 @@ static int drm_hdmi_power_on(struct device *dev, int mode)

 static struct exynos_drm_display_ops drm_hdmi_display_ops = {
.type = EXYNOS_DISPLAY_TYPE_HDMI,
+   .initialize = drm_hdmi_display_initialize,
.is_connected = drm_hdmi_is_connected,
.get_edid = drm_hdmi_get_edid,
.check_mode = drm_hdmi_check_mode,
@@ -257,6 +270,21 @@ static void drm_hdmi_commit(struct device *subdrv_dev)
hdmi_ops->commit(ctx->hdmi_ctx->ctx);
 }

+static int drm_hdmi_mgr_initialize(struct device *subdrv_dev,
+   struct drm_device *drm_dev)
+{
+   struct drm_hdmi_context *ctx = to_context(subdrv_dev);
+   int ret = 0;
+
+   if (mixer_ops && mixer_ops->initialize)
+   ret = mixer_ops->initialize(ctx->mixer_ctx->ctx, drm_dev);
+
+   if (mixer_ops->iommu_on)
+   mixer_ops->iommu_on(ctx->mixer_ctx->ctx, true);
+
+   return ret;
+}
+
 static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)
 {
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
@@ -326,6 +354,7 @@ static void drm_mixer_win_disable(struct device 
*subdrv_dev, int zpos)
 }

 static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {
+   .initialize = drm_hdmi_mgr_initialize,
.dpms = drm_hdmi_dpms,
.apply = drm_hdmi_apply,
.enable_vblank = drm_hdmi_enable_vblank,
@@ -372,12 +401,6 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
ctx->hdmi_ctx = hdmi_ctx;
ctx->mixer_ctx = mixer_ctx;

-   ctx->hdmi_ctx->drm_dev = drm_dev;
-   ctx->mixer_ctx->drm_dev = drm_dev;
-
-   if (mixer_ops->iommu_on)
-   mixer_ops->iommu_on(ctx->mixer_ctx->ctx, true);
-
return 0;
 }

diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h 
b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
index 724cab1..cf7b1da 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
@@ -23,12 +23,12 @@
  * this context should be hdmi_context or mixer_context.
  */
 struct exynos_drm_hdmi_context {
-   struct drm_device   *drm_dev;
void*ctx;
 };

 struct exynos_hdmi_ops {
/* display */
+   int (*initialize)(void *ctx, struct drm_device *drm_dev);
bool (*is_connected)(void *ctx);
struct edid *(*get_edid)(void *ctx,
struct drm_connector *connector);
@@ -45,6 +45,7 @@ struct exynos_hdmi_ops {

 struct exynos_mixer_ops {
/* manager */
+   int (*initialize)(void *ctx, struct drm_device *drm_dev);
int (*iommu_on)(void *ctx, bool enable);
int (*enable_vblank)(void *ctx, int pipe);
void (*disable_vblank)(void *ctx);
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_hdmi.c
index e1c1bfc..9837926 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -742,6 +742,15 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata,
}
 }

+static int hdmi_initialize(void *ctx, struct drm_device *drm_dev)
+{
+   struct hdmi_context *hdata = ctx;
+
+   hdata->drm_dev = drm_dev;
+
+   return 0;
+}
+
 static bool hdmi_is_connected(void *ctx)
 {
struct hdmi_context *hdata = ctx;
@@ -1747,6 +1756,7 @@ static void hdmi_dpms(void *ctx, int mode)

 static struct exynos_hdmi_ops hdmi_ops = {
/* display */
+   .initialize = hdmi_initialize,
.is_connected   = hdmi_is_connected,

[PATCH v4 05/34] drm/exynos: Use manager_op initialize in fimd

2014-01-30 Thread Sean Paul
This patch implements the intitialize manager op in fimd. This will
allow us to keep track of drm_dev in context instead of using subdev,
which in turn makes it easier to remove subdev from fimd.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4:
 - Expanded commit message to be more detailed

 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index bc4001e..f06a0a9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -106,6 +106,7 @@ struct fimd_win_data {

 struct fimd_context {
struct exynos_drm_subdrvsubdrv;
+   struct drm_device   *drm_dev;
int irq;
struct drm_crtc *crtc;
struct clk  *bus_clk;
@@ -181,6 +182,16 @@ static struct exynos_drm_display_ops fimd_display_ops = {
.power_on = fimd_display_power_on,
 };

+static int fimd_mgr_initialize(struct device *subdrv_dev,
+   struct drm_device *drm_dev)
+{
+   struct fimd_context *ctx = get_fimd_context(subdrv_dev);
+
+   ctx->drm_dev = drm_dev;
+
+   return 0;
+}
+
 static void fimd_dpms(struct device *subdrv_dev, int mode)
 {
struct fimd_context *ctx = get_fimd_context(subdrv_dev);
@@ -660,6 +671,7 @@ static void fimd_win_disable(struct device *dev, int zpos)
 }

 static struct exynos_drm_manager_ops fimd_manager_ops = {
+   .initialize = fimd_mgr_initialize,
.dpms = fimd_dpms,
.apply = fimd_apply,
.commit = fimd_commit,
@@ -681,7 +693,6 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
 {
struct fimd_context *ctx = (struct fimd_context *)dev_id;
struct exynos_drm_subdrv *subdrv = >subdrv;
-   struct drm_device *drm_dev = subdrv->drm_dev;
struct exynos_drm_manager *manager = subdrv->manager;
u32 val;

@@ -692,11 +703,11 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
writel(VIDINTCON1_INT_FRAME, ctx->regs + VIDINTCON1);

/* check the crtc is detached already from encoder */
-   if (manager->pipe < 0)
+   if (manager->pipe < 0 || !ctx->drm_dev)
goto out;

-   drm_handle_vblank(drm_dev, manager->pipe);
-   exynos_drm_crtc_finish_pageflip(drm_dev, manager->pipe);
+   drm_handle_vblank(ctx->drm_dev, manager->pipe);
+   exynos_drm_crtc_finish_pageflip(ctx->drm_dev, manager->pipe);

/* set wait vsync event to zero and wake up queue. */
if (atomic_read(>wait_vsync_event)) {
-- 
1.8.5.1



[PATCH v4 04/34] drm/exynos: Add an initialize function to manager and display

2014-01-30 Thread Sean Paul
This patch adds an initialize function to the manager and display
operations. This allows them to keep track of drm_device in their
local context, as well as adds an initialization hook right after
the encoder is created.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_drv.h |  5 +
 drivers/gpu/drm/exynos/exynos_drm_encoder.c | 21 +
 2 files changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 4288d0a..2811486 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -123,6 +123,7 @@ struct exynos_drm_overlay {
  * - this structure is common to analog tv, digital tv and lcd panel.
  *
  * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI.
+ * @initialize: initializes the display with drm_dev
  * @is_connected: check for that display is connected or not.
  * @get_edid: get edid modes from display driver.
  * @get_panel: get panel object from display driver.
@@ -131,6 +132,7 @@ struct exynos_drm_overlay {
  */
 struct exynos_drm_display_ops {
enum exynos_drm_output_type type;
+   int (*initialize)(struct device *dev, struct drm_device *drm_dev);
bool (*is_connected)(struct device *dev);
struct edid *(*get_edid)(struct device *dev,
struct drm_connector *connector);
@@ -142,6 +144,7 @@ struct exynos_drm_display_ops {
 /*
  * Exynos drm manager ops
  *
+ * @initialize: initializes the manager with drm_dev
  * @dpms: control device power.
  * @apply: set timing, vblank and overlay data to registers.
  * @mode_fixup: fix mode data comparing to hw specific display mode.
@@ -159,6 +162,8 @@ struct exynos_drm_display_ops {
  * @win_disable: disable hardware specific overlay.
  */
 struct exynos_drm_manager_ops {
+   int (*initialize)(struct device *subdrv_dev,
+   struct drm_device *drm_dev);
void (*dpms)(struct device *subdrv_dev, int mode);
void (*apply)(struct device *subdrv_dev);
void (*mode_fixup)(struct device *subdrv_dev,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index c255341..a9eb2b0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -316,6 +316,7 @@ exynos_drm_encoder_create(struct drm_device *dev,
 {
struct drm_encoder *encoder;
struct exynos_drm_encoder *exynos_encoder;
+   int ret;

if (!manager || !possible_crtcs)
return NULL;
@@ -339,9 +340,29 @@ exynos_drm_encoder_create(struct drm_device *dev,

drm_encoder_helper_add(encoder, _encoder_helper_funcs);

+   if (manager->ops && manager->ops->initialize) {
+   ret = manager->ops->initialize(manager->dev, dev);
+   if (ret) {
+   DRM_ERROR("Manager initialize failed %d\n", ret);
+   goto error;
+   }
+   }
+
+   if (manager->display_ops && manager->display_ops->initialize) {
+   ret = manager->display_ops->initialize(manager->dev, dev);
+   if (ret) {
+   DRM_ERROR("Display initialize failed %d\n", ret);
+   goto error;
+   }
+   }
+
DRM_DEBUG_KMS("encoder has been created\n");

return encoder;
+
+error:
+   exynos_drm_encoder_destroy(_encoder->drm_encoder);
+   return NULL;
 }

 struct exynos_drm_manager *exynos_drm_get_manager(struct drm_encoder *encoder)
-- 
1.8.5.1



[PATCH v4 03/34] drm/exynos: Merge overlay_ops into manager_ops

2014-01-30 Thread Sean Paul
This patch merges overlay_ops into manager_ops. In all cases,
overlay_ops is implemented in the same place as manager ops, it doesn't
serve a functional purpose, and doesn't make things more clear.

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4:
 - Just moved fimd manager struct instead of manager functions (reduced diff)

 drivers/gpu/drm/exynos/exynos_drm_drv.h | 29 ---
 drivers/gpu/drm/exynos/exynos_drm_encoder.c | 26 ++---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c| 29 ++-
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c| 36 +
 drivers/gpu/drm/exynos/exynos_drm_vidi.c| 29 ++-
 drivers/gpu/drm/exynos/exynos_mixer.c   |  2 --
 6 files changed, 62 insertions(+), 89 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 0eaf5a2..4288d0a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -54,22 +54,6 @@ enum exynos_drm_output_type {
 };

 /*
- * Exynos drm overlay ops structure.
- *
- * @mode_set: copy drm overlay info to hw specific overlay info.
- * @commit: apply hardware specific overlay data to registers.
- * @enable: enable hardware specific overlay.
- * @disable: disable hardware specific overlay.
- */
-struct exynos_drm_overlay_ops {
-   void (*mode_set)(struct device *subdrv_dev,
-struct exynos_drm_overlay *overlay);
-   void (*commit)(struct device *subdrv_dev, int zpos);
-   void (*enable)(struct device *subdrv_dev, int zpos);
-   void (*disable)(struct device *subdrv_dev, int zpos);
-};
-
-/*
  * Exynos drm common overlay structure.
  *
  * @fb_x: offset x on a framebuffer to be displayed.
@@ -169,6 +153,10 @@ struct exynos_drm_display_ops {
  * @disable_vblank: specific driver callback for disabling vblank interrupt.
  * @wait_for_vblank: wait for vblank interrupt to make sure that
  * hardware overlay is updated.
+ * @win_mode_set: copy drm overlay info to hw specific overlay info.
+ * @win_commit: apply hardware specific overlay data to registers.
+ * @win_enable: enable hardware specific overlay.
+ * @win_disable: disable hardware specific overlay.
  */
 struct exynos_drm_manager_ops {
void (*dpms)(struct device *subdrv_dev, int mode);
@@ -184,6 +172,11 @@ struct exynos_drm_manager_ops {
int (*enable_vblank)(struct device *subdrv_dev);
void (*disable_vblank)(struct device *subdrv_dev);
void (*wait_for_vblank)(struct device *subdrv_dev);
+   void (*win_mode_set)(struct device *subdrv_dev,
+   struct exynos_drm_overlay *overlay);
+   void (*win_commit)(struct device *subdrv_dev, int zpos);
+   void (*win_enable)(struct device *subdrv_dev, int zpos);
+   void (*win_disable)(struct device *subdrv_dev, int zpos);
 };

 /*
@@ -195,9 +188,6 @@ struct exynos_drm_manager_ops {
  * @ops: pointer to callbacks for exynos drm specific framebuffer.
  * these callbacks should be set by specific drivers such fimd
  * or hdmi driver and are used to control hardware global registers.
- * @overlay_ops: pointer to callbacks for exynos drm specific framebuffer.
- * these callbacks should be set by specific drivers such fimd
- * or hdmi driver and are used to control hardware overlay reigsters.
  * @display: pointer to callbacks for exynos drm specific framebuffer.
  * these callbacks should be set by specific drivers such fimd
  * or hdmi driver and are used to control display devices such as
@@ -207,7 +197,6 @@ struct exynos_drm_manager {
struct device *dev;
int pipe;
struct exynos_drm_manager_ops *ops;
-   struct exynos_drm_overlay_ops *overlay_ops;
struct exynos_drm_display_ops *display_ops;
 };

diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index 06f1b2a..c255341 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -133,7 +133,7 @@ static void disable_plane_to_crtc(struct drm_device *dev,
 *
 * plane->funcs->disable_plane call checks
 * if encoder->crtc is same as plane->crtc and if same
-* then overlay_ops->disable callback will be called
+* then manager_ops->win_disable callback will be called
 * to diasble current hw overlay so plane->crtc should
 * have new_crtc because new_crtc was set to
 * encoder->crtc in advance.
@@ -442,51 +442,51 @@ void exynos_drm_encoder_plane_mode_set(struct drm_encoder 
*encoder, void *data)
 {
struct exynos_drm_manager *manager =
to_exynos_encoder(encoder)->manager;
-   struct exynos_drm_overlay_ops 

[PATCH v4 02/34] drm/exynos: Remove useless slab.h include

2014-01-30 Thread Sean Paul
From: St?phane Marchesin 

Signed-off-by: St?phane Marchesin 
Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None
Changes in v4: None

 drivers/video/exynos/exynos_dp_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/exynos/exynos_dp_core.c 
b/drivers/video/exynos/exynos_dp_core.c
index 5e1a715..b3af496 100644
--- a/drivers/video/exynos/exynos_dp_core.c
+++ b/drivers/video/exynos/exynos_dp_core.c
@@ -12,7 +12,6 @@

 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
1.8.5.1



[PATCH v4 01/34] drm/exynos: Rename hdmi_infoframe to avoid collision

2014-01-30 Thread Sean Paul
Rename hdmi_infoframe to exynos_hdmi_infoframe to avoid nameing
collision.

Signed-off-by: Sean Paul 
---

Changes in v4:
 - Added

 drivers/gpu/drm/exynos/exynos_hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_hdmi.c
index a0e10ae..e1c1bfc 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -379,7 +379,7 @@ static const struct hdmiphy_config hdmiphy_v14_configs[] = {
},
 };

-struct hdmi_infoframe {
+struct exynos_hdmi_infoframe {
enum HDMI_PACKET_TYPE type;
u8 ver;
u8 len;
@@ -682,7 +682,7 @@ static u8 hdmi_chksum(struct hdmi_context *hdata,
 }

 static void hdmi_reg_infoframe(struct hdmi_context *hdata,
-   struct hdmi_infoframe *infoframe)
+   struct exynos_hdmi_infoframe *infoframe)
 {
u32 hdr_sum;
u8 chksum;
@@ -985,7 +985,7 @@ static void hdmi_conf_reset(struct hdmi_context *hdata)

 static void hdmi_conf_init(struct hdmi_context *hdata)
 {
-   struct hdmi_infoframe infoframe;
+   struct exynos_hdmi_infoframe infoframe;

/* disable HPD interrupts from HDMI IP block, use GPIO instead */
hdmi_reg_writemask(hdata, HDMI_INTC_CON, 0, HDMI_INTC_EN_GLOBAL |
-- 
1.8.5.1



[PATCH v4 00/34] drm/exynos: Refactor parts of the exynos driver

2014-01-30 Thread Sean Paul
This patchset refactors parts of the exynos driver to move it closer to a proper
drm driver (rather than just implementing a drm layer on top of the hardware
drivers). The hope is to get to a point where the dp/hdmi drivers can implement
drm_connector/drm_encoder directly, and fimd/mixer can directly implement
drm_crtc.

The notable changes in this set:
- drm_encoder funcs no longer route through the crtc
- DP driver has been moved from video into the drm driver
- fimd no longer implements encoder callbacks
- exynos_drm_hdmi is removed in favor of generic manager/display
  handling

At a glance, differences between v1 and v2:
- Passing manager/display in callbacks instead of ctx
- Tacked on some dpms patches on the end to handle suspend/resume
  through the dpms path

At a glance, differences between v2 and v3:
- Fixed vidi issues
- Moved exynos_drm_hdmi.c removal to the right place
- Added the exynos_drm_connector removal patches on the end

At a glance, differences between v3 and v4:
- Rebased on top of exynos-drm-next
- Addressed review comments, no major functional changes

Sean



Daniel Kurtz (1):
  drm/exynos: hdmi: remove the i2c drivers and use devtree

Sean Paul (32):
  drm/exynos: Rename hdmi_infoframe to avoid collision
  drm/exynos: Merge overlay_ops into manager_ops
  drm/exynos: Add an initialize function to manager and display
  drm/exynos: Use manager_op initialize in fimd
  drm/exynos: hdmi: Implement initialize op for hdmi
  drm/exynos: Pass exynos_drm_manager in manager ops instead of dev
  drm/exynos: Remove apply manager callback
  drm/exynos: Remove dpms link between encoder/connector
  drm/exynos: Rename display_op power_on to dpms
  drm/exynos: Don't keep dpms state in encoder
  drm/exynos: Use unsigned long for possible_crtcs
  drm/exynos: Split manager/display/subdrv
  ARM: dts: exynos: Add i2c phandles to hdmi node
  drm/exynos: Remove exynos_drm_hdmi shim
  drm/exynos: Use drm_mode_copy to copy modes
  drm/exynos: Disable unused crtc planes from crtc
  drm/exynos: Add mode_set manager operation
  drm/exynos: Implement mode_fixup manager operation
  drm/exynos: Use mode_set to configure fimd
  drm/exynos: Remove unused/useless fimd_context members
  drm/exynos: Move dp driver from video/ to drm/
  drm/exynos: Move display implementation into dp
  ARM: dts: Move display-timings node from fimd to dp
  drm/exynos: Implement dpms display callback in DP
  drm/exynos: Clean up FIMD power on/off routines
  drm/exynos: Consolidate suspend/resume in drm_drv
  drm/exynos: Add create_connector callback
  drm/exynos: Implement drm_connector in hdmi directly
  drm/exynos: Implement drm_connector directly in dp driver
  drm/exynos: Implement drm_connector directly in vidi driver
  drm/exynos: Move lvds bridge discovery into DP driver
  drm/exynos: Remove the exynos_drm_connector shim

St?phane Marchesin (1):
  drm/exynos: Remove useless slab.h include

 .../devicetree/bindings/video/exynos_dp.txt|   17 +
 .../devicetree/bindings/video/exynos_hdmi.txt  |5 +
 .../devicetree/bindings/video/samsung-fimd.txt |2 +
 MAINTAINERS|7 -
 arch/arm/boot/dts/cros5250-common.dtsi |6 +-
 arch/arm/boot/dts/exynos5250-arndale.dts   |7 +-
 arch/arm/boot/dts/exynos5250-smdk5250.dts  |   13 +-
 arch/arm/boot/dts/exynos5250-snow.dts  |7 +-
 arch/arm/boot/dts/exynos5420-smdk5420.dts  |7 +-
 drivers/gpu/drm/exynos/Kconfig |7 +
 drivers/gpu/drm/exynos/Makefile|7 +-
 drivers/gpu/drm/exynos/exynos_ddc.c|   63 -
 drivers/gpu/drm/exynos/exynos_dp_core.c| 1357 
 drivers/gpu/drm/exynos/exynos_dp_core.h|  329 +
 drivers/gpu/drm/exynos/exynos_dp_reg.c | 1243 ++
 drivers/gpu/drm/exynos/exynos_dp_reg.h |  366 ++
 drivers/gpu/drm/exynos/exynos_drm_connector.c  |  304 -
 drivers/gpu/drm/exynos/exynos_drm_connector.h  |   24 -
 drivers/gpu/drm/exynos/exynos_drm_core.c   |  233 ++--
 drivers/gpu/drm/exynos/exynos_drm_crtc.c   |  139 +-
 drivers/gpu/drm/exynos/exynos_drm_crtc.h   |   20 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c|  155 ++-
 drivers/gpu/drm/exynos/exynos_drm_drv.h|  154 ++-
 drivers/gpu/drm/exynos/exynos_drm_encoder.c|  357 +
 drivers/gpu/drm/exynos/exynos_drm_encoder.h|   18 +-
 drivers/gpu/drm/exynos/exynos_drm_fb.c |4 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c   |  682 --
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c   |  439 ---
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h   |   67 -
 drivers/gpu/drm/exynos/exynos_drm_plane.c  |   17 +-
 drivers/gpu/drm/exynos/exynos_drm_plane.h  |2 

[Bug 73420] [HAWAII] atombios stuck executing errors

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=73420

--- Comment #19 from Alex Deucher  ---
(In reply to comment #18)
> Ah ok, I didn't know that. Thanks for the info - I'll try the option and see
> how it goes ;-)
> 
> Unrealted to the acceleration I discovered another error message in my dmesg:
> [drm:ci_dpm_set_power_state] *ERROR* ci_upload_dpm_level_enable_mask failed
> Should I report that in a new bug ? (I should really stop hijacking this
> bug, sorry)

Yes, open a new bug for the dpm stuff.  In the new bug please note whether this
is new after applying attachment 93015 or if this was always there.

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


[PATCH] fix compilation of imx-hdmi

2014-01-30 Thread Russell King - ARM Linux
imx-hdmi creates a hdmi_colorimetry enum.  This is also defined by
include/linux/hdmi.h, which gets included now via DRM headers since
985e5dc207e133 (drm/edid: Populate picture aspect ratio for CEA modes).
This leads to the compiler complaining:

drivers/staging/imx-drm/imx-hdmi.c:58:6: error: nested redefinition of 'enum 
hdmi_colorimetry'
drivers/staging/imx-drm/imx-hdmi.c:58:6: error: redeclaration of 'enum 
hdmi_colorimetry'
include/linux/hdmi.h:48:6: note: originally defined here

Fix it by using the one in linux/hdmi.h

Signed-off-by: Russell King 
---
 drivers/staging/imx-drm/imx-hdmi.c | 17 ++---
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-hdmi.c 
b/drivers/staging/imx-drm/imx-hdmi.c
index d358d89e11c4..74d635fcb3d5 100644
--- a/drivers/staging/imx-drm/imx-hdmi.c
+++ b/drivers/staging/imx-drm/imx-hdmi.c
@@ -55,11 +55,6 @@ enum hdmi_datamap {
YCbCr422_12B = 0x12,
 };

-enum hdmi_colorimetry {
-   ITU601,
-   ITU709,
-};
-
 enum imx_hdmi_devtype {
IMX6Q_HDMI,
IMX6DL_HDMI,
@@ -475,12 +470,12 @@ static void imx_hdmi_update_csc_coeffs(struct imx_hdmi 
*hdmi)

if (is_color_space_conversion(hdmi)) {
if (hdmi->hdmi_data.enc_out_format == RGB) {
-   if (hdmi->hdmi_data.colorimetry == ITU601)
+   if (hdmi->hdmi_data.colorimetry == 
HDMI_COLORIMETRY_ITU_601)
csc_coeff = _coeff_rgb_out_eitu601;
else
csc_coeff = _coeff_rgb_out_eitu709;
} else if (hdmi->hdmi_data.enc_in_format == RGB) {
-   if (hdmi->hdmi_data.colorimetry == ITU601)
+   if (hdmi->hdmi_data.colorimetry == 
HDMI_COLORIMETRY_ITU_601)
csc_coeff = _coeff_rgb_in_eitu601;
else
csc_coeff = _coeff_rgb_in_eitu709;
@@ -1009,14 +1004,14 @@ static void hdmi_config_AVI(struct imx_hdmi *hdmi)
/* Set up colorimetry */
if (hdmi->hdmi_data.enc_out_format == XVYCC444) {
colorimetry = HDMI_FC_AVICONF1_COLORIMETRY_EXTENDED_INFO;
-   if (hdmi->hdmi_data.colorimetry == ITU601)
+   if (hdmi->hdmi_data.colorimetry == HDMI_COLORIMETRY_ITU_601)
ext_colorimetry =
HDMI_FC_AVICONF2_EXT_COLORIMETRY_XVYCC601;
else /* hdmi->hdmi_data.colorimetry == ITU709 */
ext_colorimetry =
HDMI_FC_AVICONF2_EXT_COLORIMETRY_XVYCC709;
} else if (hdmi->hdmi_data.enc_out_format != RGB) {
-   if (hdmi->hdmi_data.colorimetry == ITU601)
+   if (hdmi->hdmi_data.colorimetry == HDMI_COLORIMETRY_ITU_601)
colorimetry = HDMI_FC_AVICONF1_COLORIMETRY_SMPTE;
else /* hdmi->hdmi_data.colorimetry == ITU709 */
colorimetry = HDMI_FC_AVICONF1_COLORIMETRY_ITUR;
@@ -1247,9 +1242,9 @@ static int imx_hdmi_setup(struct imx_hdmi *hdmi, struct 
drm_display_mode *mode)
(hdmi->vic == 21) || (hdmi->vic == 22) ||
(hdmi->vic == 2) || (hdmi->vic == 3) ||
(hdmi->vic == 17) || (hdmi->vic == 18))
-   hdmi->hdmi_data.colorimetry = ITU601;
+   hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601;
else
-   hdmi->hdmi_data.colorimetry = ITU709;
+   hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709;

if ((hdmi->vic == 10) || (hdmi->vic == 11) ||
(hdmi->vic == 12) || (hdmi->vic == 13) ||

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".


kernfs oops with i915+i2c_core in 3.14 merge window

2014-01-30 Thread Josh Boyer
On Thu, Jan 30, 2014 at 2:20 PM, Josh Boyer  
wrote:
> On Thu, Jan 30, 2014 at 2:05 PM, Tejun Heo  wrote:
>> On Thu, Jan 30, 2014 at 02:03:18PM -0500, Josh Boyer wrote:
>>> Hi All,
>>>
>>> I'm seeing the oops below on my MacBookPro 10,2 machine using i915
>>> graphics.  It's after the DRM merge for 3.14 ( v3.13-10094-g9b0cd30) ,
>>> but we seem to have one report[1] of this happening well before that,
>>> in v3.13-3260-g03d11a0 as well.  Does anyone have a clue what is going
>>> on here?
>>>
>>> https://bugzilla.redhat.com/show_bug.cgi?id=1055105
>>
>> Should be fixed by the following patch which is already queued.
>>
>>  http://lkml.kernel.org/g/20140129170403.GJ30842 at htj.dyndns.org
>
> Oh, excellent!  I'll throw that into a build and test it here.  Thanks
> for the quick reply, Tejun.

FWIW, my test build with that patch does seem to solve the problem.
Thanks again.

josh


[Bug 73420] [HAWAII] atombios stuck executing errors

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=73420

--- Comment #18 from Luzipher  ---
Ah ok, I didn't know that. Thanks for the info - I'll try the option and see
how it goes ;-)

Unrealted to the acceleration I discovered another error message in my dmesg:
[drm:ci_dpm_set_power_state] *ERROR* ci_upload_dpm_level_enable_mask failed
Should I report that in a new bug ? (I should really stop hijacking this bug,
sorry)

-- 
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/20140130/05c7f35d/attachment.html>


[PATCH] gpu: host1x: do not check previously handled gathers

2014-01-30 Thread Terje Bergström
On 07.01.2014 22:03, Erik Faye-Lund wrote:
> When patching gathers, we don't need to check against
> gathers with lower indices than the current one, as
> they are guaranteed to already have been handled.
> 
> Signed-off-by: Erik Faye-Lund 
> ---
> 
> Here's a trivial optimization I have been running with for a while.
> 
>  drivers/gpu/host1x/job.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
> index de5ec33..e965805 100644
> --- a/drivers/gpu/host1x/job.c
> +++ b/drivers/gpu/host1x/job.c
> @@ -534,7 +534,7 @@ int host1x_job_pin(struct host1x_job *job, struct device 
> *dev)
>  
>   g->base = job->gather_addr_phys[i];
>  
> - for (j = 0; j < job->num_gathers; j++)
> + for (j = i + 1; j < job->num_gathers; j++)
>   if (job->gathers[j].bo == g->bo)
>   job->gathers[j].handled = true;
>  

Hi,

Thanks. This looks good logically, and I ran some tests that agree.

Acked-By: Terje Bergstrom 

Terje


[PATCH] drm/radeon: allow geom rings to be setup on r600/r700

2014-01-30 Thread Alex Deucher
I made some minor cleanups and also added a missing 7xx reg to the
safe regs list.

Alex

On Wed, Jan 29, 2014 at 11:11 PM, Dave Airlie  wrote:
> From: Dave Airlie 
>
> the evergreen CS parser has allowed this for a while, just port
> the code to the r600 one.
>
> This is required before geom shaders can be made work.
>
> Signed-off-by: Dave Airlie 
> ---
>  drivers/gpu/drm/radeon/r600_cs.c| 18 --
>  drivers/gpu/drm/radeon/radeon_drv.c |  3 ++-
>  2 files changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600_cs.c 
> b/drivers/gpu/drm/radeon/r600_cs.c
> index 7b399dc..98e1f6b 100644
> --- a/drivers/gpu/drm/radeon/r600_cs.c
> +++ b/drivers/gpu/drm/radeon/r600_cs.c
> @@ -1007,8 +1007,22 @@ static int r600_cs_check_reg(struct radeon_cs_parser 
> *p, u32 reg, u32 idx)
> case R_008C64_SQ_VSTMP_RING_SIZE:
> case R_0288C8_SQ_GS_VERT_ITEMSIZE:
> /* get value to populate the IB don't remove */
> -   tmp =radeon_get_ib_value(p, idx);
> -   ib[idx] = 0;
> + //tmp =radeon_get_ib_value(p, idx);
> + //ib[idx] = 0;
> +   break;
> +   case SQ_ESGS_RING_BASE:
> +   case SQ_GSVS_RING_BASE:
> +   case SQ_ESTMP_RING_BASE:
> +   case SQ_GSTMP_RING_BASE:
> +   case SQ_PSTMP_RING_BASE:
> +   case SQ_VSTMP_RING_BASE:
> +   r = radeon_cs_packet_next_reloc(p, , 0);
> +   if (r) {
> +   dev_warn(p->dev, "bad SET_CONTEXT_REG "
> +   "0x%04X\n", reg);
> +   return -EINVAL;
> +   }
> +   ib[idx] += (u32)((reloc->lobj.gpu_offset >> 8) & 0x);
> break;
> case SQ_CONFIG:
> track->sq_config = radeon_get_ib_value(p, idx);
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index ec8c388..357cffb 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -78,9 +78,10 @@
>   *   2.34.0 - Add CIK tiling mode array query
>   *   2.35.0 - Add CIK macrotile mode array query
>   *   2.36.0 - Fix CIK DCE tiling setup
> + *   2.37.0 - allow ring setup on r6xx/r7xx
>   */
>  #define KMS_DRIVER_MAJOR   2
> -#define KMS_DRIVER_MINOR   36
> +#define KMS_DRIVER_MINOR   37
>  #define KMS_DRIVER_PATCHLEVEL  0
>  int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
>  int radeon_driver_unload_kms(struct drm_device *dev);
> --
> 1.8.3.1
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
-- next part ------
A non-text attachment was scrubbed...
Name: 0001-drm-radeon-allow-geom-rings-to-be-setup-on-r600-r700.patch
Type: text/x-patch
Size: 2851 bytes
Desc: not available
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20140130/78f39f83/attachment.bin>


[Bug 73420] [HAWAII] atombios stuck executing errors

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=73420

--- Comment #17 from Alex Deucher  ---
(In reply to comment #16)
> Yes, that patch worked, no more messages.
> I still get no accel though ("RADEON(0): GPU accel disabled or not working,
> using shadowfb for KMS"), but I guess I need to investigate that further
> first - unless you have a quick idea ?

Acceleration is currently disabled by default on hawaii as it's unstable for a
lot of apps.  You can force it on with
Option "NoAccel" "false"
in the device section of your xorg conf, but you'll see gpu hangs.

-- 
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/20140130/1f0a18b3/attachment.html>


[Bug 73530] Asus U38N: Black screen with Radeon driver in Linux 3.10, 3.11, 3.12, 3.13

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

--- Comment #54 from Alex Deucher  ---
I think you need to be a vesa member to download the DP specs.  There may be
some older copies floating around on the internet.  They are also available to
Xorg members if you wanted to become an Xorg member.

As to the problem, the link training sequence has defined delays for various
parts of the training sequence.  I would suggest tweaking the existing delays
rather than adding new ones.  E.g., the udelay(400); in
radeon_dp_link_train_cr() and radeon_dp_link_train_finish() and the delays in
drm_dp_link_train_clock_recovery_delay() and
drm_dp_link_train_channel_eq_delay().  Or possibly passing different delays to
radeon_dp_aux_native_read() or radeon_dp_aux_native_write().

-- 
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/20140130/71e0b610/attachment-0001.html>


[PATCH] drm/radeon: remove useless return

2014-01-30 Thread Alex Deucher
Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/uvd_v2_2.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/uvd_v2_2.c 
b/drivers/gpu/drm/radeon/uvd_v2_2.c
index 824550d..d177100 100644
--- a/drivers/gpu/drm/radeon/uvd_v2_2.c
+++ b/drivers/gpu/drm/radeon/uvd_v2_2.c
@@ -57,7 +57,6 @@ void uvd_v2_2_fence_emit(struct radeon_device *rdev,
radeon_ring_write(ring, 0);
radeon_ring_write(ring, PACKET0(UVD_GPCOM_VCPU_CMD, 0));
radeon_ring_write(ring, 2);
-   return;
 }

 /**
-- 
1.8.3.1



[PATCH] drm/radeon/dpm: use stored max_vddc rather than looking it up

2014-01-30 Thread Alex Deucher
When we parse the power tables use the stored mac_vddc value
rather than lookig it up manually each time.

Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/ni_dpm.c| 5 ++---
 drivers/gpu/drm/radeon/rv770_dpm.c | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
index 22c3391..1217fbc 100644
--- a/drivers/gpu/drm/radeon/ni_dpm.c
+++ b/drivers/gpu/drm/radeon/ni_dpm.c
@@ -3945,7 +3945,6 @@ static void ni_parse_pplib_clock_info(struct 
radeon_device *rdev,
struct rv7xx_power_info *pi = rv770_get_pi(rdev);
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
struct ni_ps *ps = ni_get_ps(rps);
-   u16 vddc;
struct rv7xx_pl *pl = >performance_levels[index];

ps->performance_level_count = index + 1;
@@ -3961,8 +3960,8 @@ static void ni_parse_pplib_clock_info(struct 
radeon_device *rdev,

/* patch up vddc if necessary */
if (pl->vddc == 0xff01) {
-   if (radeon_atom_get_max_vddc(rdev, 0, 0, ) == 0)
-   pl->vddc = vddc;
+   if (pi->max_vddc)
+   pl->vddc = pi->max_vddc;
}

if (rps->class & ATOM_PPLIB_CLASSIFICATION_ACPI) {
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c 
b/drivers/gpu/drm/radeon/rv770_dpm.c
index 80c595a..5b2ea8a 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.c
+++ b/drivers/gpu/drm/radeon/rv770_dpm.c
@@ -2174,7 +2174,6 @@ static void rv7xx_parse_pplib_clock_info(struct 
radeon_device *rdev,
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
struct rv7xx_ps *ps = rv770_get_ps(rps);
u32 sclk, mclk;
-   u16 vddc;
struct rv7xx_pl *pl;

switch (index) {
@@ -2214,8 +2213,8 @@ static void rv7xx_parse_pplib_clock_info(struct 
radeon_device *rdev,

/* patch up vddc if necessary */
if (pl->vddc == 0xff01) {
-   if (radeon_atom_get_max_vddc(rdev, 0, 0, ) == 0)
-   pl->vddc = vddc;
+   if (pi->max_vddc)
+   pl->vddc = pi->max_vddc;
}

if (rps->class & ATOM_PPLIB_CLASSIFICATION_ACPI) {
-- 
1.8.3.1



[PATCH] drm/radeon/dpm: use the driver state for dpm debugfs

2014-01-30 Thread Alex Deucher
For btc and newer, we may modify the power state depending
on the circumstances.  Use the modified state rather than
the base state.

Signed-off-by: Alex Deucher 
---
 drivers/gpu/drm/radeon/btc_dpm.c | 31 +++
 drivers/gpu/drm/radeon/btcd.h|  4 
 drivers/gpu/drm/radeon/ni_dpm.c  |  3 ++-
 drivers/gpu/drm/radeon/radeon_asic.c |  2 +-
 drivers/gpu/drm/radeon/radeon_asic.h |  2 ++
 drivers/gpu/drm/radeon/si_dpm.c  |  3 ++-
 drivers/gpu/drm/radeon/sumo_dpm.c|  2 +-
 drivers/gpu/drm/radeon/trinity_dpm.c |  3 ++-
 8 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c
index 0fbd36f..05ad469 100644
--- a/drivers/gpu/drm/radeon/btc_dpm.c
+++ b/drivers/gpu/drm/radeon/btc_dpm.c
@@ -2756,6 +2756,37 @@ void btc_dpm_fini(struct radeon_device *rdev)
r600_free_extended_power_table(rdev);
 }

+void btc_dpm_debugfs_print_current_performance_level(struct radeon_device 
*rdev,
+struct seq_file *m)
+{
+   struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
+   struct radeon_ps *rps = _pi->current_rps;
+   struct rv7xx_ps *ps = rv770_get_ps(rps);
+   struct rv7xx_pl *pl;
+   u32 current_index =
+   (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & 
CURRENT_PROFILE_INDEX_MASK) >>
+   CURRENT_PROFILE_INDEX_SHIFT;
+
+   if (current_index > 2) {
+   seq_printf(m, "invalid dpm profile %d\n", current_index);
+   } else {
+   if (current_index == 0)
+   pl = >low;
+   else if (current_index == 1)
+   pl = >medium;
+   else /* current_index == 2 */
+   pl = >high;
+   seq_printf(m, "uvdvclk: %d dclk: %d\n", rps->vclk, 
rps->dclk);
+   if (rdev->family >= CHIP_CEDAR) {
+   seq_printf(m, "power level %dsclk: %u mclk: %u 
vddc: %u vddci: %u\n",
+  current_index, pl->sclk, pl->mclk, pl->vddc, 
pl->vddci);
+   } else {
+   seq_printf(m, "power level %dsclk: %u mclk: %u 
vddc: %u\n",
+  current_index, pl->sclk, pl->mclk, pl->vddc);
+   }
+   }
+}
+
 u32 btc_dpm_get_sclk(struct radeon_device *rdev, bool low)
 {
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
diff --git a/drivers/gpu/drm/radeon/btcd.h b/drivers/gpu/drm/radeon/btcd.h
index 29e32de..9c65be2 100644
--- a/drivers/gpu/drm/radeon/btcd.h
+++ b/drivers/gpu/drm/radeon/btcd.h
@@ -44,6 +44,10 @@
 #   define DYN_SPREAD_SPECTRUM_EN   (1 << 23)
 #   define AC_DC_SW (1 << 24)

+#define TARGET_AND_CURRENT_PROFILE_INDEX  0x66c
+#   define CURRENT_PROFILE_INDEX_MASK (0xf << 4)
+#   define CURRENT_PROFILE_INDEX_SHIFT4
+
 #defineCG_BIF_REQ_AND_RSP  0x7f4
 #defineCG_CLIENT_REQ(x)((x) << 0)
 #defineCG_CLIENT_REQ_MASK  (0xff << 0)
diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
index c351226..22c3391 100644
--- a/drivers/gpu/drm/radeon/ni_dpm.c
+++ b/drivers/gpu/drm/radeon/ni_dpm.c
@@ -4322,7 +4322,8 @@ void ni_dpm_print_power_state(struct radeon_device *rdev,
 void ni_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
struct seq_file *m)
 {
-   struct radeon_ps *rps = rdev->pm.dpm.current_ps;
+   struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
+   struct radeon_ps *rps = _pi->current_rps;
struct ni_ps *ps = ni_get_ps(rps);
struct rv7xx_pl *pl;
u32 current_index =
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c 
b/drivers/gpu/drm/radeon/radeon_asic.c
index f74db43..dda02bf 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -1555,7 +1555,7 @@ static struct radeon_asic btc_asic = {
.get_sclk = _dpm_get_sclk,
.get_mclk = _dpm_get_mclk,
.print_power_state = _dpm_print_power_state,
-   .debugfs_print_current_performance_level = 
_dpm_debugfs_print_current_performance_level,
+   .debugfs_print_current_performance_level = 
_dpm_debugfs_print_current_performance_level,
.force_performance_level = _dpm_force_performance_level,
.vblank_too_short = _dpm_vblank_too_short,
},
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h 
b/drivers/gpu/drm/radeon/radeon_asic.h
index b3bc433..ae637cf 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -551,6 +551,8 @@ void btc_dpm_fini(struct radeon_device *rdev);
 u32 

[PATCH] drm/radeon: fix UVD IRQ support on SI

2014-01-30 Thread Alex Deucher
On Thu, Jan 30, 2014 at 1:01 PM, Christian K?nig
 wrote:
> From: Christian K?nig 
>
> Otherwise decoding isn't really useable.
>
> Signed-off-by: Christian K?nig 
> Cc: stable at vger.kernel.org

Applied.  thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/si.c | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
> index 07ce587..a22df95 100644
> --- a/drivers/gpu/drm/radeon/si.c
> +++ b/drivers/gpu/drm/radeon/si.c
> @@ -6334,6 +6334,10 @@ restart_ih:
> break;
> }
> break;
> +   case 124: /* UVD */
> +   DRM_DEBUG("IH: UVD int: 0x%08x\n", src_data);
> +   radeon_fence_process(rdev, R600_RING_TYPE_UVD_INDEX);
> +   break;
> case 146:
> case 147:
> addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR);
> --
> 1.8.1.2
>


[PATCH] drm/radeon: fix UVD IRQ support on 7xx

2014-01-30 Thread Alex Deucher
Otherwise decoding isn't really useable.

Signed-off-by: Alex Deucher 
Cc: stable at vger.kernel.org
---
 drivers/gpu/drm/radeon/r600.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 56140b4..cdbc417 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -3991,6 +3991,10 @@ restart_ih:
break;
}
break;
+   case 124: /* UVD */
+   DRM_DEBUG("IH: UVD int: 0x%08x\n", src_data);
+   radeon_fence_process(rdev, R600_RING_TYPE_UVD_INDEX);
+   break;
case 176: /* CP_INT in ring buffer */
case 177: /* CP_INT in IB1 */
case 178: /* CP_INT in IB2 */
-- 
1.8.3.1



[PATCH] fix compilation of imx-hdmi

2014-01-30 Thread Fabio Estevam
On 01/30/2014 02:13 PM, Russell King - ARM Linux wrote:
> imx-hdmi creates a hdmi_colorimetry enum.  This is also defined by
> include/linux/hdmi.h, which gets included now via DRM headers since
> 985e5dc207e133 (drm/edid: Populate picture aspect ratio for CEA modes).
> This leads to the compiler complaining:
>
> drivers/staging/imx-drm/imx-hdmi.c:58:6: error: nested redefinition of 'enum 
> hdmi_colorimetry'
> drivers/staging/imx-drm/imx-hdmi.c:58:6: error: redeclaration of 'enum 
> hdmi_colorimetry'
> include/linux/hdmi.h:48:6: note: originally defined here
>
> Fix it by using the one in linux/hdmi.h
>
> Signed-off-by: Russell King 

Sachin has also sent the same fix:

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2014-January/045167.html

Regards,

Fabio Estevam




kernfs oops with i915+i2c_core in 3.14 merge window

2014-01-30 Thread Josh Boyer
On Thu, Jan 30, 2014 at 2:05 PM, Tejun Heo  wrote:
> On Thu, Jan 30, 2014 at 02:03:18PM -0500, Josh Boyer wrote:
>> Hi All,
>>
>> I'm seeing the oops below on my MacBookPro 10,2 machine using i915
>> graphics.  It's after the DRM merge for 3.14 ( v3.13-10094-g9b0cd30) ,
>> but we seem to have one report[1] of this happening well before that,
>> in v3.13-3260-g03d11a0 as well.  Does anyone have a clue what is going
>> on here?
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=1055105
>
> Should be fixed by the following patch which is already queued.
>
>  http://lkml.kernel.org/g/20140129170403.GJ30842 at htj.dyndns.org

Oh, excellent!  I'll throw that into a build and test it here.  Thanks
for the quick reply, Tejun.

josh


kernfs oops with i915+i2c_core in 3.14 merge window

2014-01-30 Thread Tejun Heo
On Thu, Jan 30, 2014 at 02:03:18PM -0500, Josh Boyer wrote:
> Hi All,
> 
> I'm seeing the oops below on my MacBookPro 10,2 machine using i915
> graphics.  It's after the DRM merge for 3.14 ( v3.13-10094-g9b0cd30) ,
> but we seem to have one report[1] of this happening well before that,
> in v3.13-3260-g03d11a0 as well.  Does anyone have a clue what is going
> on here?
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1055105

Should be fixed by the following patch which is already queued.

 http://lkml.kernel.org/g/20140129170403.GJ30842 at htj.dyndns.org

Thanks.

-- 
tejun


kernfs oops with i915+i2c_core in 3.14 merge window

2014-01-30 Thread Josh Boyer
Hi All,

I'm seeing the oops below on my MacBookPro 10,2 machine using i915
graphics.  It's after the DRM merge for 3.14 ( v3.13-10094-g9b0cd30) ,
but we seem to have one report[1] of this happening well before that,
in v3.13-3260-g03d11a0 as well.  Does anyone have a clue what is going
on here?

https://bugzilla.redhat.com/show_bug.cgi?id=1055105

josh

[6.058198] INFO: trying to register non-static key.
[6.058203] the code is fine but needs lockdep annotation.
[6.058206] turning off the locking correctness validator.
[6.058210] CPU: 2 PID: 225 Comm: systemd-udevd Not tainted
3.14.0-0.rc0.git17.1.fc21.x86_64 #1
[6.058214] Hardware name: Apple Inc.
MacBookPro10,2/Mac-AFD8A9D944EA4843, BIOS
MBP102.88Z.0106.B03.1211161133 11/16/2012
[6.058219]   8b5190d0 88025cc67460
817cdb1f
[6.058225]  0002 88025cc67470 817c8aa9
88025cc67550
[6.058230]  810fa886 0002 88025cc66000
88025cc67500
[6.058236] Call Trace:
[6.058242]  [] dump_stack+0x4d/0x66
[6.058247]  [] register_lock_class.part.26+0x38/0x3c
[6.058253]  [] __lock_acquire+0x1776/0x1c40
[6.058258]  [] ? mark_held_locks+0xb9/0x140
[6.058262]  [] ? __raw_spin_lock_init+0x21/0x60
[6.058267]  [] ? lockdep_init_map+0xac/0x4a0
[6.058271]  [] lock_acquire+0xa2/0x1d0
[6.058275]  [] ? kernfs_addrm_finish+0x38/0x60
[6.058279]  [] kernfs_deactivate+0x13e/0x1a0
[6.058283]  [] ? kernfs_addrm_finish+0x38/0x60
[6.058287]  [] ? mark_held_locks+0xb9/0x140
[6.058291]  [] ? mark_held_locks+0xb9/0x140
[6.058295]  [] kernfs_addrm_finish+0x38/0x60
[6.058299]  [] kernfs_remove_by_name_ns+0x60/0xc0
[6.058304]  [] remove_files.isra.1+0x41/0x80
[6.058308]  [] sysfs_remove_group+0x47/0xa0
[6.058312]  [] sysfs_remove_groups+0x33/0x50
[6.058318]  [] device_remove_attrs+0x5e/0x80
[6.058322]  [] device_del+0x12e/0x1d0
[6.058325]  [] device_unregister+0x1e/0x60
[6.058331]  [] i2c_del_adapter+0x267/0x3b0 [i2c_core]
[6.058354]  [] intel_sdvo_init+0x20e/0x8c0 [i915]
[6.058359]  [] ? trace_hardirqs_on_caller+0x105/0x1d0
[6.058363]  [] ? trace_hardirqs_on+0xd/0x10
[6.058381]  [] ? gen6_read32+0x52/0x1c0 [i915]
[6.058398]  [] intel_modeset_init+0xb62/0xff0 [i915]
[6.058414]  [] ?
intel_power_domains_init_hw+0xa8/0x110 [i915]
[6.058429]  [] i915_driver_load+0xccc/0xec0 [i915]
[6.058440]  [] ? drm_get_minor+0x1ad/0x200 [drm]
[6.058447]  [] drm_dev_register+0x7d/0x180 [drm]
[6.058455]  [] drm_get_pci_dev+0xa0/0x220 [drm]
[6.058468]  [] i915_pci_probe+0x3b/0x60 [i915]
[6.058473]  [] local_pci_probe+0x45/0xa0
[6.058477]  [] ? pci_match_device+0xc5/0xd0
[6.058481]  [] pci_device_probe+0xf9/0x150
[6.058486]  [] driver_probe_device+0x125/0x3a0
[6.058490]  [] __driver_attach+0x93/0xa0
[6.058494]  [] ? __device_attach+0x40/0x40
[6.058498]  [] bus_for_each_dev+0x73/0xc0
[6.058502]  [] driver_attach+0x1e/0x20
[6.058505]  [] bus_add_driver+0x188/0x260
[6.058509]  [] ? 0xa0153fff
[6.058513]  [] driver_register+0x64/0xf0
[6.058516]  [] ? 0xa0153fff
[6.058520]  [] __pci_register_driver+0x60/0x70
[6.058527]  [] drm_pci_init+0x11a/0x130 [drm]
[6.058531]  [] ? 0xa0153fff
[6.058543]  [] i915_init+0x6a/0x6c [i915]
[6.058548]  [] do_one_initcall+0xfa/0x1b0
[6.058552]  [] ? set_memory_nx+0x43/0x50
[6.058557]  [] load_module+0x1eb3/0x26e0
[6.058560]  [] ? store_uevent+0x70/0x70
[6.058565]  [] ? kernel_read+0x50/0x80
[6.058569]  [] SyS_finit_module+0xa6/0xd0
[6.058574]  [] system_call_fastpath+0x16/0x1b


[Bug 69301] no screen on update from 3.12.0

2014-01-30 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=69301

--- Comment #9 from Jan Outhuis  ---
Moved on to 3.13.1. This time radeon.dpm=0 solves the problem, i.e. I'm
getting full functionality on all screens, textconsole as well as
graphic console.
Without radeon.dpm=0 on the grub commandline: still same behaviour on
boot, i.e. black screen, hardware reboot required.

On Thu, 2014-01-23 at 14:44 +, bugzilla-daemon at bugzilla.kernel.org
wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=69301
> 
> Bug ID: 69301
>Summary: no screen on update from 3.12.0
>Product: Drivers
>Version: 2.5
> Kernel Version: 3.13.0
>   Hardware: x86-64
> OS: Linux
>   Tree: Mainline
> Status: NEW
>   Severity: normal
>   Priority: P1
>  Component: Video(DRI - non Intel)
>   Assignee: drivers_video-dri at kernel-bugs.osdl.org
>   Reporter: jouthuis at dds.nl
> Regression: No
> 
> 3.13.0 hangs on video initialisation for my Radeon HD7750 card. It worked on
> 3.12.0 and previous on 3.11.4.
> 
> After upgrading to 3.13.0, the bootprocess doesn't get past the
> video-initialisation and leaves me with a black screen and dead keyboard.
> 
> I'm running Debian testing on 64bit architecture.
>

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


[git pull] drm next tree

2014-01-30 Thread Paul Bolle
Dave Airlie schreef op do 30-01-2014 om 02:49 [+]:
> Christian K?nig (10):
>   [...]
>   drm/radeon: add GART debugfs access v3
>   [...]

That one generates a bit of (warning) noise when building on 32 bits
x86:

In file included from include/asm-generic/bug.h:13:0,
 from [...]/linux/arch/x86/include/asm/bug.h:38,
 from include/linux/bug.h:4,
 from include/drm/drm_mm.h:39,
 from include/drm/drm_vma_manager.h:26,
 from include/drm/ttm/ttm_bo_api.h:35,
 from drivers/gpu/drm/radeon/radeon_ttm.c:32:
drivers/gpu/drm/radeon/radeon_ttm.c: In function 'radeon_ttm_gtt_read':
include/linux/kernel.h:712:17: warning: comparison of distinct pointer types 
lacks a cast [enabled by default]
  (void) (&_min1 == &_min2);  \
 ^
drivers/gpu/drm/radeon/radeon_ttm.c:938:22: note: in expansion of macro 'min'
   ssize_t cur_size = min(size, PAGE_SIZE - off);
  ^

I suppose the last line should read
   ssize_t cur_size = min(size, (size_t) PAGE_SIZE - off);

to silence this. But I haven't tested yet.


Paul Bolle



[PATCH v2 0/5] add a TDA998x CODEC

2014-01-30 Thread Jean-Francois Moine
The TDA998x HDMI transmitter accepts audio input from either I2S or
S/PDIF.
Theses inputs have different intrinsic constraints and these constraints
may be modified by the audio parameters of the connected video device.

The choice of I2S or S/PDIF may be the done by the user or by automatic
processing (DPCM?) at each audio starting time. This asks for a dynamic
audio input switch in the HDMI driver.

This patch series implements the TDA998x specific CODEC.

A simple function call mechanism is used for exchanges between the
CODEC and the HDMI driver.

Note: the changes in the TDA998x I2C driver are based on my previous
patch series:
http://lists.freedesktop.org/archives/dri-devel/2014-January/052837.html

- v2
- add ACLK setting and code optimization in patch 1
- from Mark Brown's remarks in patch 2:
- don't compile the codec when CONFIG_ALL_CODECS
- simplify the code about start/stop audio
- fix coding style errors
- add audio-port-names associated to audio-ports
- add audio-port-names in patch 4
- add patch 5 'adjust the audio CTS_N pre-divider from audio format'
for the Beaglebone-Black board (Jyri Sarha)

Jean-Francois Moine (5):
  drm/i2c: tda998x: add a function for dynamic audio input switch
  ASoC: tda998x: add a codec driver for TDA998x
  ASoC: tda998x: add DT documentation
  ASoC: tda998x: adjust the audio hw parameters from EDID
  ASoC: tda998x: adjust the audio CTS_N pre-divider from audio format

 .../devicetree/bindings/sound/tda998x.txt  |  16 +
 drivers/gpu/drm/i2c/tda998x_drv.c  |  82 +-
 include/drm/i2c/tda998x.h  |  11 +-
 sound/soc/codecs/Kconfig   |   6 +
 sound/soc/codecs/Makefile  |   2 +
 sound/soc/codecs/tda998x.c | 325 +
 6 files changed, 436 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/tda998x.txt
 create mode 100644 sound/soc/codecs/tda998x.c

-- 
1.9.rc1



nouveau: treat nv04_devinit_priv.owner as signed.

2014-01-30 Thread Dave Jones
This is set and compared to -1 in the code, which evaluates to always false.
If we want to treat it as a signed var, we should declare it as one.

Signed-off-by: Dave Jones 

diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/nv04.h 
b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv04.h
index 23470a57510c..9d54c106dddf 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/devinit/nv04.h
+++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv04.h
@@ -5,7 +5,7 @@

 struct nv04_devinit_priv {
struct nouveau_devinit base;
-   u8 owner;
+   s8 owner;
 };

 int  nv04_devinit_ctor(struct nouveau_object *, struct nouveau_object *,


[PATCH] drm: Fix use-after-free in the shadow-attache exit code

2014-01-30 Thread Dave Jones
On Thu, Jan 30, 2014 at 05:58:38PM +0100, Daniel Vetter wrote:
 > This regression has been introduced in
 > 
 > commit b3f2333de8e81b089262b26d52272911523e605f
 > Author: Daniel Vetter 
 > Date:   Wed Dec 11 11:34:31 2013 +0100
 > 
 > drm: restrict the device list for shadow attached drivers
 > 

btw, I noticed this because it got flagged in the nightly coverity runs.
Of the 18 new issues added yesterday 14 were from drivers/gpu/

If drm developers want to sign up at http://scan.coverity.com
to help out looking over those (and the backlog: stats below)
I can get those accounts approved quickly.

I've been going through trying to clear out as much of the 'noise'
as possible, but it's a huge job.  There's a bunch of cases where
the checker can't figure out if it's a real bug or not because
it doesn't know things like "the hardware will only ever return
these values", but the majority look like actual coding flaws.

Dave

Currently outstanding issues:

Radeon: 64 
Nouveau: 36
i915: 32
misc drm: 24
gma500: 11
qxl: 7



[PATCH] drm/nouveau: set irq_enabled manually

2014-01-30 Thread Ilia Mirkin
On Thu, Jan 30, 2014 at 3:33 AM, Daniel Vetter  wrote:
> On Thu, Jan 30, 2014 at 1:53 AM, Ilia Mirkin  wrote:
>> Since commit 0fa9061ae8c ("drm/nouveau/mc: handle irq-related setup
>> ourselves"), drm_device->irq_enabled remained unset. This is needed in
>> order to properly wait for a vblank event in the generic drm code.
>>
>> See https://bugs.freedesktop.org/show_bug.cgi?id=74195
>>
>> Reported-by: Jan Janecek 
>> Signed-off-by: Ilia Mirkin 
>> Cc: stable at vger.kernel.org # 3.10+
>> ---
>>
>> TBH, not sure why this fixes things, as irq_enabled == false should have
>> caused the vblank wait to not wait, since the condition would be
>> immediately true.
>>
>> Jan, mind double-checking that this version of the patch fixes things
>> for you? Not 100% sure where you stuck the irq_enabled=true line when you
>> tried it out.
>
> The core drm vblank code bails out if dev->irq_enabled isn't set. So

Right. And what I'm unclear on is how does bailing out on vblank wait
cause the originally reported issue -- sluggishness. That seems to
imply that one is waiting too long rather than not waiting enough.

> if you opt to not use the drm irq helpers and instead roll your own
> you still need to set this to allow vblank wait ioctls and related
> stuff. It's even documented in the drm DocBook ;-) So
>
> Reviewed-by: Daniel Vetter 
>
> if you will.
>
> Cheers, Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch


[PATCH v2 5/5] ASoC: tda998x: adjust the audio CTS_N pre-divider from audio format

2014-01-30 Thread Jean-Francois Moine
In some boards, with I2S input, the NXP TDA998x HDMI transmitter did
not play audio streams with a sample width lower than S16_32.

This patch adjusts the CTS_N predivider according to the used sample
width.

Signed-off-by: Jean-Francois Moine 
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 25 +
 include/drm/i2c/tda998x.h |  5 -
 sound/soc/codecs/tda998x.c| 19 +++
 3 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
b/drivers/gpu/drm/i2c/tda998x_drv.c
index 92cbc40..ee17d42 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -47,6 +48,8 @@ struct tda998x_priv {
volatile int wq_edid_wait;
struct drm_encoder *encoder;

+   int audio_sample_format;
+
u8 *eld;
 };

@@ -663,7 +666,18 @@ tda998x_configure_audio(struct tda998x_priv *priv,
reg_write(priv, REG_MUX_AP, MUX_AP_SELECT_I2S);
clksel_aip = AIP_CLKSEL_AIP_I2S;
clksel_fs = AIP_CLKSEL_FS_ACLK;
-   cts_n = CTS_N_M(3) | CTS_N_K(3);
+   switch (priv->audio_sample_format) {
+   case SNDRV_PCM_FORMAT_S16_LE:
+   cts_n = CTS_N_M(3) | CTS_N_K(1);
+   break;
+   case SNDRV_PCM_FORMAT_S24_LE:
+   cts_n = CTS_N_M(3) | CTS_N_K(2);
+   break;
+   default:
+   case SNDRV_PCM_FORMAT_S32_LE:
+   cts_n = CTS_N_M(3) | CTS_N_K(3);
+   break;
+   }
aclk = 1;   /* clock enable */
break;

@@ -744,13 +758,14 @@ EXPORT_SYMBOL_GPL(tda998x_audio_get_eld);

 void tda998x_audio_update(struct i2c_client *client,
int format,
-   int port)
+   int port,
+   struct snd_pcm_hw_params *params)
 {
struct tda998x_priv *priv = i2c_get_clientdata(client);
struct tda998x_encoder_params *p = >params;

/* if the audio output is active, it may be a second start or a stop */
-   if (format == 0 || priv->audio_active) {
+   if (format == 0 || !params || priv->audio_active) {
if (format == 0) {
priv->audio_active = 0;
reg_write(priv, REG_ENA_AP, 0);
@@ -762,11 +777,13 @@ void tda998x_audio_update(struct i2c_client *client,
p->audio_cfg = port;

/* don't restart audio if same input format */
-   if (format == p->audio_format) {
+   if (format == p->audio_format &&
+   params_format(params) == priv->audio_sample_format) {
reg_write(priv, REG_ENA_AP, p->audio_cfg);
return;
}
p->audio_format = format;
+   priv->audio_sample_format = params_format(params);

tda998x_configure_audio(priv, >encoder->crtc->hwmode, p);
 }
diff --git a/include/drm/i2c/tda998x.h b/include/drm/i2c/tda998x.h
index 99387ae..62b838f 100644
--- a/include/drm/i2c/tda998x.h
+++ b/include/drm/i2c/tda998x.h
@@ -27,8 +27,11 @@ struct tda998x_encoder_params {
unsigned audio_sample_rate;
 };

+struct snd_pcm_hw_params;
+
 u8 *tda998x_audio_get_eld(struct i2c_client *client);
 void tda998x_audio_update(struct i2c_client *client,
int format,
-   int port);
+   int port,
+   struct snd_pcm_hw_params *params);
 #endif
diff --git a/sound/soc/codecs/tda998x.c b/sound/soc/codecs/tda998x.c
index 7f21749..181388d 100644
--- a/sound/soc/codecs/tda998x.c
+++ b/sound/soc/codecs/tda998x.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -61,7 +62,8 @@ static void tda_get_encoder(struct tda_priv *priv)
priv->i2c_client = i2c_client;
 }

-static int tda_start_stop(struct tda_priv *priv)
+static int tda_start_stop(struct tda_priv *priv,
+   struct snd_pcm_hw_params *params)
 {
int port;

@@ -76,7 +78,7 @@ static int tda_start_stop(struct tda_priv *priv)
port = priv->ports[0];
else
port = priv->ports[1];
-   tda998x_audio_update(priv->i2c_client, priv->dai_id, port);
+   tda998x_audio_update(priv->i2c_client, priv->dai_id, port, params);
return 0;
 }

@@ -156,9 +158,17 @@ static int tda_startup(struct snd_pcm_substream *substream,
stream->channels_max = max_channels;
stream->formats = formats;
}
+   return 0;
+}
+
+static int tda_hw_params(struct snd_pcm_substream *substream,
+   struct snd_pcm_hw_params *params,
+   struct snd_soc_dai *dai)
+{
+   struct tda_priv *priv = snd_soc_codec_get_drvdata(dai->codec);

/* 

[PATCH v3 5/5] ASoC: tda998x: adjust the audio CTS_N pre-divider from audio format

2014-01-30 Thread Jean-Francois Moine
In some boards, with I2S input, the NXP TDA998x HDMI transmitter did
not play audio streams with a sample width lower than S16_32.

This patch adjusts the CTS_N predivider according to the used sample
width.

Signed-off-by: Jean-Francois Moine 
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 25 +
 include/drm/i2c/tda998x.h |  5 -
 sound/soc/codecs/tda998x.c| 18 ++
 3 files changed, 39 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
b/drivers/gpu/drm/i2c/tda998x_drv.c
index b833fa5..66013ba 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -48,6 +49,8 @@ struct tda998x_priv {
volatile int wq_edid_wait;
struct drm_encoder *encoder;

+   int audio_sample_format;
+
u8 *eld;
 };

@@ -664,7 +667,18 @@ tda998x_configure_audio(struct tda998x_priv *priv,
reg_write(priv, REG_MUX_AP, MUX_AP_SELECT_I2S);
clksel_aip = AIP_CLKSEL_AIP_I2S;
clksel_fs = AIP_CLKSEL_FS_ACLK;
-   cts_n = CTS_N_M(3) | CTS_N_K(3);
+   switch (priv->audio_sample_format) {
+   case SNDRV_PCM_FORMAT_S16_LE:
+   cts_n = CTS_N_M(3) | CTS_N_K(1);
+   break;
+   case SNDRV_PCM_FORMAT_S24_LE:
+   cts_n = CTS_N_M(3) | CTS_N_K(2);
+   break;
+   default:
+   case SNDRV_PCM_FORMAT_S32_LE:
+   cts_n = CTS_N_M(3) | CTS_N_K(3);
+   break;
+   }
aclk = 1;   /* clock enable */
break;

@@ -745,13 +759,14 @@ EXPORT_SYMBOL_GPL(tda998x_audio_get_eld);

 void tda998x_audio_update(struct i2c_client *client,
int format,
-   int port)
+   int port,
+   struct snd_pcm_hw_params *params)
 {
struct tda998x_priv *priv = i2c_get_clientdata(client);
struct tda998x_encoder_params *p = >params;

/* if the audio output is active, it may be a second start or a stop */
-   if (format == 0 || priv->audio_active) {
+   if (format == 0 || !params || priv->audio_active) {
if (format == 0) {
priv->audio_active = 0;
reg_write(priv, REG_ENA_AP, 0);
@@ -763,11 +778,13 @@ void tda998x_audio_update(struct i2c_client *client,
p->audio_cfg = port;

/* don't restart audio if same input format */
-   if (format == p->audio_format) {
+   if (format == p->audio_format &&
+   params_format(params) == priv->audio_sample_format) {
reg_write(priv, REG_ENA_AP, p->audio_cfg);
return;
}
p->audio_format = format;
+   priv->audio_sample_format = params_format(params);

tda998x_configure_audio(priv, >encoder->crtc->hwmode, p);
 }
diff --git a/include/drm/i2c/tda998x.h b/include/drm/i2c/tda998x.h
index 99387ae..62b838f 100644
--- a/include/drm/i2c/tda998x.h
+++ b/include/drm/i2c/tda998x.h
@@ -27,8 +27,11 @@ struct tda998x_encoder_params {
unsigned audio_sample_rate;
 };

+struct snd_pcm_hw_params;
+
 u8 *tda998x_audio_get_eld(struct i2c_client *client);
 void tda998x_audio_update(struct i2c_client *client,
int format,
-   int port);
+   int port,
+   struct snd_pcm_hw_params *params);
 #endif
diff --git a/sound/soc/codecs/tda998x.c b/sound/soc/codecs/tda998x.c
index 0493163..a1de35d 100644
--- a/sound/soc/codecs/tda998x.c
+++ b/sound/soc/codecs/tda998x.c
@@ -47,7 +47,8 @@ static int tda_get_encoder(struct tda_priv *priv)
return 0;
 }

-static int tda_start_stop(struct tda_priv *priv)
+static int tda_start_stop(struct tda_priv *priv,
+   struct snd_pcm_hw_params *params)
 {
int port;

@@ -56,7 +57,7 @@ static int tda_start_stop(struct tda_priv *priv)
port = priv->ports[0];
else
port = priv->ports[1];
-   tda998x_audio_update(priv->i2c_client, priv->dai_id, port);
+   tda998x_audio_update(priv->i2c_client, priv->dai_id, port, params);
return 0;
 }

@@ -136,9 +137,17 @@ static int tda_startup(struct snd_pcm_substream *substream,
stream->channels_max = max_channels;
stream->formats = formats;
}
+   return 0;
+}
+
+static int tda_hw_params(struct snd_pcm_substream *substream,
+   struct snd_pcm_hw_params *params,
+   struct snd_soc_dai *dai)
+{
+   struct tda_priv *priv = snd_soc_codec_get_drvdata(dai->codec);

/* start the TDA998x audio */
-   return tda_start_stop(priv);
+   return tda_start_stop(priv, params);
 }

 

[radeonsi] dpm: mc_reg_table slots

2014-01-30 Thread Alex Deucher
On Thu, Jan 23, 2014 at 8:57 AM, Sylvain BERTRAND  wrote:
> Hi,
>
> In si_populate_smc_acpi_state function, the acpi (emergency) state is a 
> patched
> version of the initial state. Then 'ACIndex = 0' for the acpi state (i.e.
> setting it to SISLANDS_MCREGISTERTABLE_INITIAL_SLOT) seems misleading, since
> ACIndex is already set to 0 (SISLANDS_MCREGISTERTABLE_INITIAL_SLOT) in
> si_populate_smc_initial_state. That should be removed to avoid confusion.
>
>
> Additionnally, that would mean the acpi state is not using its slot in
> the mc_reg_table, *BUT* it is used by the ulv state! Indeed ACIndex is set to 
> 1
> (SISLANDS_MCREGISTERTABLE_ACPI_SLOT) in si_populate_ulv_state function.
>
> We can see in si_populate_mc_reg_table that initial state, acpi state, ulv
> state and driver state have their respective mc_reg_table slot filled.
>
> Then, the previous code seems to make the ulv mc_reg_table slot unused and
> useless to fill.
>
> Moreover, is not following the SISLANDS_MCREGISTERTABLE_*_SLOT mc_reg_table
> allocation.
>
> Bug?

It looks like we only use slots 0 and 1 and the driver state slots.  I
confirmed catalyst does the same thing.  I suspect there was an
intention to use three states at some point, but it didn't end up
being useful.

Alex

>
> regards,
>
> --
> Sylvain
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 73530] Asus U38N: Black screen with Radeon driver in Linux 3.10, 3.11, 3.12, 3.13

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

--- Comment #53 from Paul Menzel  ---
So where can I get the specifications about DisplayPort link training? Is it in
[1]?

[1] http://www.vesa.org/vesa-standards/free-standards/

-- 
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/20140130/6fdd8c4d/attachment.html>


exynos_hdmi.c fails to build with v3.13-10094-g9b0cd30

2014-01-30 Thread Josh Boyer
Hi All,

After the DRM merge, the exynos_hdmi.c file fails to build with our
ARM config.  The error is:

drivers/gpu/drm/exynos/exynos_hdmi.c:382:8: error: 'hdmi_infoframe'
defined as wrong kind of tag
 struct hdmi_infoframe {
^
make[4]: *** [drivers/gpu/drm/exynos/exynos_hdmi.o] Error 1
make[3]: *** [drivers/gpu/drm/exynos] Error 2
make[2]: *** [drivers/gpu/drm] Error 2

which to me was a somewhat confusing error message.  After digging
further, I believe it means that there is a conflict with the
definition in exynos_hdmi.c and the one found in include/linux/hdmi.h
for what hdmi_infoframe is supposed to be.

exynos_hdmi.c:

struct hdmi_infoframe {
enum HDMI_PACKET_TYPE type;
u8 ver;
u8 len;
};


include/linux/hdmi.h:

union hdmi_infoframe {
struct hdmi_any_infoframe any;
struct hdmi_avi_infoframe avi;
struct hdmi_spd_infoframe spd;
union hdmi_vendor_any_infoframe vendor;
struct hdmi_audio_infoframe audio;
};


Could someone take a look at this?  I have no idea how this wasn't
caught before being merged.

josh


[Bug 73530] Asus U38N: Black screen with Radeon driver in Linux 3.10, 3.11, 3.12, 3.13

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

Paul Menzel  changed:

   What|Removed |Added

Summary|Asus U38N: Black screen |Asus U38N: Black screen
   |with Radeon driver in Linux |with Radeon driver in Linux
   |3.10, 3.11 and 3.12 |3.10, 3.11, 3.12, 3.13

-- 
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/20140130/0eb35128/attachment.html>


[PATCH 1/1] drm/mgag200: Fix hardware cursor colour inversion and inaccurate register index.

2014-01-30 Thread Julia Lemire
The hardware cursor colours are stored in the DAC indexed registers.
The algorithm for setting these colours via their corresponding index
was off by a value of 0x03.

It was also noted that the R and B bytes were being misread from the
cursor buffer.  Assuming the transparency is the MSB (bits 31-24),
then R should be bits 23-16, G should be bits 15-8 and B should be
the LSB or bits 7-0.

Signed-off-by: Julia Lemire 
---
 drivers/gpu/drm/mgag200/mgag200_cursor.c |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c 
b/drivers/gpu/drm/mgag200/mgag200_cursor.c
index 801731a..24463b8 100644
--- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
+++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
@@ -32,7 +32,7 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
uint32_t width,
uint32_t height)
 {
-   struct drm_device *dev = (struct drm_device *)file_priv->minor->dev;
+   struct drm_device *dev = crtc->dev;
struct mga_device *mdev = (struct mga_device *)dev->dev_private;
struct mgag200_bo *pixels_1 = mdev->cursor.pixels_1;
struct mgag200_bo *pixels_2 = mdev->cursor.pixels_2;
@@ -45,12 +45,12 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
uint32_t colour_set[16];
uint32_t *next_space = _set[0];
uint32_t *palette_iter;
-   uint32_t this_colour;
+   uint32_t this_colour; /* 32-bit colour encoded pixel */
bool found = false;
int colour_count = 0;
u64 gpu_addr;
u8 reg_index;
-   u8 this_row[48];
+   u8 this_row[48]; /* cursor bitmap row array */

if (!pixels_1 || !pixels_2) {
WREG8(MGA_CURPOSXL, 0);
@@ -171,14 +171,20 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
}

/* Program colours from cursor icon into palette */
+   /* Colour is received as RGB, where R are the MSB and B are the LSB. */
+   /* The first three colours are located between indexes 0x08-0x12. */
+   /* The remaining colours are located between indexes 0x60-0x86. */
for (i = 0; i < colour_count; i++) {
if (i <= 2)
reg_index = 0x8 + i*0x4;
else
-   reg_index = 0x60 + i*0x3;
-   WREG_DAC(reg_index, colour_set[i] & 0xff);
+   reg_index = 0x60 + (i-3)*0x3;
+   /* Write the Red bits. */
+   WREG_DAC(reg_index, colour_set[i]>>16 & 0xff);
+   /* Write the Green bits. */
WREG_DAC(reg_index+1, colour_set[i]>>8 & 0xff);
-   WREG_DAC(reg_index+2, colour_set[i]>>16 & 0xff);
+   /* Write the Blue bits. */
+   WREG_DAC(reg_index+2, colour_set[i] & 0xff);
BUG_ON((colour_set[i]>>24 & 0xff) != 0xff);
}

-- 
1.7.10.4



[PATCH v2 3/5] ASoC: tda998x: add DT documentation

2014-01-30 Thread Jean-Francois Moine
This patch adds the DT documentation of the NXP TDA998x CODEC.

Signed-off-by: Jean-Francois Moine 
---
 Documentation/devicetree/bindings/sound/tda998x.txt | 16 
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/tda998x.txt

diff --git a/Documentation/devicetree/bindings/sound/tda998x.txt 
b/Documentation/devicetree/bindings/sound/tda998x.txt
new file mode 100644
index 000..13b73ca
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/tda998x.txt
@@ -0,0 +1,16 @@
+Device-Tree bindings for the NXP TDA998x HDMI transmitter
+
+Required properties:
+   - compatible: must be "nxp,tda998x-codec".
+   - audio-ports: one or two values corresponding to entries in
+   the audio-port-names property.
+   - audio-port-names: must contain "i2s", "spdif" entries
+   matching entries in the audio-ports property.
+
+Example node:
+
+   hdmi_codec: hdmi-codec {
+   compatible = "nxp,tda998x-codec";
+   audio-ports = <0x03>, <0x04>;
+   audio-port-names = "i2s", "spdif";
+   };
-- 
1.9.rc1



[Bug 73852] Dota 2: texture corruption (r600 on HD 6550M)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=73852

--- Comment #1 from Matyas Csanyi  ---
I am happy to do additional digging if someone points me in some direction.

-- 
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/20140130/22e5cf52/attachment.html>


[PATCH] drm/nouveau: set irq_enabled manually

2014-01-30 Thread Daniel Vetter
On Thu, Jan 30, 2014 at 1:53 AM, Ilia Mirkin  wrote:
> Since commit 0fa9061ae8c ("drm/nouveau/mc: handle irq-related setup
> ourselves"), drm_device->irq_enabled remained unset. This is needed in
> order to properly wait for a vblank event in the generic drm code.
>
> See https://bugs.freedesktop.org/show_bug.cgi?id=74195
>
> Reported-by: Jan Janecek 
> Signed-off-by: Ilia Mirkin 
> Cc: stable at vger.kernel.org # 3.10+
> ---
>
> TBH, not sure why this fixes things, as irq_enabled == false should have
> caused the vblank wait to not wait, since the condition would be
> immediately true.
>
> Jan, mind double-checking that this version of the patch fixes things
> for you? Not 100% sure where you stuck the irq_enabled=true line when you
> tried it out.

The core drm vblank code bails out if dev->irq_enabled isn't set. So
if you opt to not use the drm irq helpers and instead roll your own
you still need to set this to allow vblank wait ioctls and related
stuff. It's even documented in the drm DocBook ;-) So

Reviewed-by: Daniel Vetter 

if you will.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


[Bug 73530] Asus U38N: Black screen with Radeon driver in Linux 3.10, 3.11 and 3.12

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

--- Comment #52 from Paul Menzel  ---
Created attachment 93042
  --> https://bugs.freedesktop.org/attachment.cgi?id=93042=edit
`/var/log/kern.log` from 3.13 with debug and delay patch

Here are the errors.

[  297.778990] [drm:radeon_dp_link_train], Before train_cr
[  297.794470] [drm:radeon_process_aux_ch], dp_aux_ch timeout
[  297.796597] [drm:radeon_dp_get_link_status], link status 00 00 80 00 00
00
[  297.796604] [drm:dp_get_adjust_train], requested signal parameters: lane
0 voltage 0.4V pre_emph 0dB
[  297.796609] [drm:dp_get_adjust_train], using signal parameters: voltage
0.4V pre_emph 0dB
[  297.798313] [drm:radeon_dp_get_link_status], link status 00 00 00 00 00
00
[  297.798318] [drm:dp_get_adjust_train], requested signal parameters: lane
0 voltage 0.4V pre_emph 0dB
[  297.798322] [drm:dp_get_adjust_train], using signal parameters: voltage
0.4V pre_emph 0dB
[  297.800044] [drm:radeon_dp_get_link_status], link status 00 00 00 00 00
00
[  297.800048] [drm:dp_get_adjust_train], requested signal parameters: lane
0 voltage 0.4V pre_emph 0dB
[  297.800052] [drm:dp_get_adjust_train], using signal parameters: voltage
0.4V pre_emph 0dB
[  297.801762] [drm:radeon_dp_get_link_status], link status 00 00 00 00 00
00
[  297.801766] [drm:dp_get_adjust_train], requested signal parameters: lane
0 voltage 0.4V pre_emph 0dB
[  297.801770] [drm:dp_get_adjust_train], using signal parameters: voltage
0.4V pre_emph 0dB
[  297.803490] [drm:radeon_dp_get_link_status], link status 00 00 00 00 00
00
[  297.803494] [drm:dp_get_adjust_train], requested signal parameters: lane
0 voltage 0.4V pre_emph 0dB
[  297.803496] [drm:dp_get_adjust_train], using signal parameters: voltage
0.4V pre_emph 0dB
[  297.805187] [drm:radeon_dp_get_link_status], link status 00 00 00 00 00
00
[  297.805190] [drm:radeon_dp_link_train_cr] *ERROR* clock recovery tried 5
times
[  297.805194] [drm:radeon_dp_link_train_cr] *ERROR* clock recovery failed

-- 
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/20140130/a9277d09/attachment-0001.html>


[Bug 68571] GPU lockup on AMD Radeon HD6850 with DPM=1

2014-01-30 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=68571

--- Comment #14 from kilobug at kilobug.org ---
Anything else I can do to help location/fixing the issue ?

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


[Bug 74211] New: Discrete videocard is missing linux 3.13

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=74211

  Priority: medium
Bug ID: 74211
  Assignee: dri-devel at lists.freedesktop.org
   Summary: Discrete videocard is missing linux 3.13
  Severity: normal
Classification: Unclassified
OS: All
  Reporter: anton.sudak at gmail.com
  Hardware: Other
Status: NEW
   Version: XOrg CVS
 Component: DRM/Radeon
   Product: DRI

Created attachment 93039
  --> https://bugs.freedesktop.org/attachment.cgi?id=93039=edit
dmesg

Discrete videocard is missing linux 3.13. There no
/sys/kernel/debug/vgaswitcheroo and xrandr --listproviders shows me only Intel
videocard. Videocard also missing in lspci output. I provide dmesg, there are
some traces which can be related to this bug. I already tried
The last working kernel version for me is 3.12.9.

My configuration:
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen
Core processor Graphics Controller (rev 09)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Turks
[Radeon HD 7650A/7670A]

-- 
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/20140130/1692c5eb/attachment.html>


[Bug 66963] Rv6xx dpm problems

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=66963

--- Comment #194 from Shawn Starr  ---
I wonder if something isn't being reset in VBIOS when it fails to boot after
POST, I see the BIOS boot up, grub display, but after kernel starts booting
(when radeon is loaded), we just die.

Alex, would it be possible for the radeon driver prior to loading DPM to dump
the register state of GPU and then dump it after DPM to console (so maybe
netconsole or serial cable can capture the output)?

So, 

1) prior to rebooting machine, use a tool to dump the current register states
of GPU/hw

2) upon loading radeon.ko but prior to DPM being switched on, dump the
registers of GPU/hw to screen and then switch DPM on, then do the dump again
(assuming this isn't going to lock up system).

maybe we can narrow down something not being cleared upon booting up sometimes?

Thanks,
Shawn

-- 
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/20140130/edeb4226/attachment.html>


[PATCH] drm/nouveau: set irq_enabled manually

2014-01-30 Thread Jan
I can confirm that this patch fixes the problem. (had to change spaces
to tabs, but that was probably just screwed up by mail)

2014-01-30, Ilia Mirkin :
> Since commit 0fa9061ae8c ("drm/nouveau/mc: handle irq-related setup
> ourselves"), drm_device->irq_enabled remained unset. This is needed in
> order to properly wait for a vblank event in the generic drm code.
>
> See https://bugs.freedesktop.org/show_bug.cgi?id=74195
>
> Reported-by: Jan Janecek 
> Signed-off-by: Ilia Mirkin 
> Cc: stable at vger.kernel.org # 3.10+
> ---
>
> TBH, not sure why this fixes things, as irq_enabled == false should have
> caused the vblank wait to not wait, since the condition would be
> immediately true.
>
> Jan, mind double-checking that this version of the patch fixes things
> for you? Not 100% sure where you stuck the irq_enabled=true line when you
> tried it out.
>
>  drivers/gpu/drm/nouveau/nouveau_drm.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c
> b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index bfd02410..3ba7b62 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -376,6 +376,8 @@ nouveau_drm_load(struct drm_device *dev, unsigned long
> flags)
>   if (ret)
>   goto fail_device;
>
> + dev->irq_enabled = true;
> +
>   /* workaround an odd issue on nvc1 by disabling the device's
>* nosnoop capability.  hopefully won't cause issues until a
>* better fix is found - assuming there is one...
> @@ -475,6 +477,7 @@ nouveau_drm_remove(struct pci_dev *pdev)
>   struct nouveau_drm *drm = nouveau_drm(dev);
>   struct nouveau_object *device;
>
> + dev->irq_enabled = false;
>   device = drm->client.base.device;
>   drm_put_dev(dev);
>
> --
> 1.8.3.2
>
>


[git pull] drm next tree

2014-01-30 Thread Dave Airlie

Hi Linus,

Been a bit busy, first week of kids school, and waiting on other trees to go in 
before I could send this, so its a bit later than I'd normally like.

For some reason the request-pull and the merge into your tree look different,
since some of the changes in this have already gone in via the arm-soc tree
and dma stuff, all for tegra. Hopefully nobody rebased when they shouldn't.

Highlights:
core: timestamp fixes, lots of misc cleanups
new drivers: bochs virtual vga
vmwgfx: major overhaul for their nextgen virt gpu.
i915: runtime D3 on HSW, watermark fixes, power well work, fbc fixes, bdw is no 
longer prelim.
nouveau: gk110/208 acceleration, more pm groundwork, old overlay support
radeon: dpm rework and clockgating for CIK, pci config reset, big endian fixes
tegra: panel support and DSI support, build as module, prime.
armada, omap, gma500, rcar, exynos, mgag200, cirrus, ast: fixes
msm: hdmi support for mdp5

Dave.

The following changes since commit d8ec26d7f8287f5788a494f56e8814210f0e64be:

  Linux 3.13 (2014-01-19 18:40:07 -0800)

are available in the git repository at:

  git://people.freedesktop.org/~airlied/linux drm-next

for you to fetch changes up to ef64cf9d06049e4e9df661f3be60b217e476bee1:

  Merge branch 'drm-nouveau-next' of 
git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next (2014-01-30 
10:46:06 +1000)



Akash Goel (1):
  drm/i915: Fix the offset issue for the stolen GEM objects

Alex Deucher (59):
  drm/radeon/dpm: remove unnecessary checks in dpm_init
  drm/radeon/si: drop cg_update from dpm code
  drm/radeon/cik: drop cg_update from dpm code
  drm/radeon: re-order firmware loading in preparation for dpm rework
  drm/radeon/dpm: add a late enable callback
  drm/radeon/dpm: add late_enable for rs780/rs880/rv6xx
  drm/radeon/dpm: add late_enable for rv7xx-NI
  drm/radeon/dpm: add late_enable for sumo
  drm/radeon/dpm: add late_enable for trinity
  drm/radeon/dpm: add late_enable for SI
  drm/radeon/dpm: add late_enable for CI
  drm/radeon/dpm: add late_enable for KB/KV
  drm/radeon/dpm: switch on new late_enable callback
  drm/radeon/pm: move pm handling into the asic specific code
  drm/radeon: enable gfx cgcg on CIK dGPUs
  drm/radeon: enable gfx cgcg on CIK APUs
  drm/radeon: enable dpm by default on CI dGPUs
  drm/radeon: enable dpm by default on CI APUs
  drm/radeon: remove generic rptr/wptr functions (v2)
  drm/radeon: fix pptable.h portability
  drm/radeon: warn users when hw_i2c is enabled (v2)
  drm/radeon/dpm: make some functions static for CI
  drm/radeon/dpm: make some functions static for sumo
  drm/radeon/dpm: make some functions static for TN
  drm/radeon: move com/atombios scratch reg functions to radeon_mode.h
  drm/radeon: add hard_reset module parameter
  drm/radeon: add pci config hard reset
  drm/radeon: implement pci config reset for r6xx/7xx (v3)
  drm/radeon: implement pci config reset for evergreen/cayman (v2)
  drm/radeon: implement pci config reset for SI (v2)
  drm/radeon: implement pci config reset for CIK (v3)
  Revert "drm/radeon: disable CIK CP semaphores for now"
  drm/radeon: consolidate cp hdp flushing code for CIK
  drm/radeon: consolidate sdma hdp flushing code for CIK
  drm/radeon/cik: use POLL_REG_MEM special op for sDMA HDP flush
  drm/radeon/cik: use WAIT_REG_MEM special op for CP HDP flush
  drm/radeon: disable dpm on BTC
  drm/radeon/cik: use hw defaults for TC_CFG registers
  drm/radeon: disable ss on DP for DCE3.x
  drm/radeon/dp: bump i2c-over-aux retries to 7
  drm/radeon/dp: use usleep_range rather than udelay
  drm/radeon/dp: sleep after powering up the display
  drm/radeon: add query to fetch the max engine clock (v2)
  drm/radeon: handle ss percentage divider properly
  drm/radeon: bail early from enable ss in certain cases
  drm/radeon: write gfx pg bases even when gfx pg is disabled
  drm/radeon: fix endian handling in radeon_atom_init_mc_reg_table
  drm/radeon/dpm: disable mclk switching on desktop RV770
  drm/radeon: fix surface sync in fence on cayman (v2)
  drm/radeon: set the full cache bit for fences on r7xx+
  drm/radeon: fix minor typos in si_dpm.c
  drm/radeon: add UVD support for OLAND
  drm/radeon/runpm: don't runtime suspend non-PX cards
  drm/radeon: skip async dma init on r6xx
  drm/radeon: clean up active vram sizing
  drm/radeon: fix DAC interrupt handling on DCE5+
  drm/radeon: set si_notify_smc_display_change properly
  drm/radeon/DCE4+: clear bios scratch dpms bit (v2)
  drm/radeon/dce8: workaround for atom BlankCrtc table

Andrzej Hajda (1):
  drm: Add MIPI DSI bus support

Archit Taneja (5):
  drm/omap: fix: Defer probe if an omapdss device requests for it at connect
  drm/omap: 

[Bug 74204] Steam crashes right after upgrading to mesa git driver(oibaf ppa, ubuntu 13.10 64 bit, 3.13 kernel, radeon hd4570)

2014-01-30 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=74204

Michel D?nzer  changed:

   What|Removed |Added

   Assignee|dri-devel at lists.freedesktop |mesa-dev at 
lists.freedesktop.
   |.org|org
  Component|Drivers/Gallium/r600|Mesa core

-- 
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/20140130/aabe3f74/attachment.html>


  1   2   >