[Bug 79011] GPU lockup, screen freeze with Radeon HD7770

2014-07-05 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=79011

Thue Kristensen  changed:

   What|Removed |Added

 CC||thuejk at gmail.com

--- Comment #11 from Thue Kristensen  ---
I am also crashing, and seeing the exact same crash backtrace in my xorg log.

My specs are practically identical to yours.
* Kernel 3.15.3-1-ARCH
* Intel iSomethingmeaningless
* Radeon 7750
* Dual screen

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


[Bug 79011] GPU lockup, screen freeze with Radeon HD7770

2014-07-05 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=79011

--- Comment #12 from Thue Kristensen  ---
Created attachment 142091
  --> https://bugzilla.kernel.org/attachment.cgi?id=142091&action=edit
Thue's Xorg.log crash

My crash looks identical to Fabian Pas' crash.

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


[Bug 79011] GPU lockup, screen freeze with Radeon HD7770

2014-07-05 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=79011

Paul Menzel  changed:

   What|Removed |Added

 CC||paulepanter at users.sourcefor
   ||ge.net

--- Comment #13 from Paul Menzel  ---
(In reply to Fabian Pas from comment #0)

> I am running 64 bit Arch Linux on kernel 3.15, the bug also occured with
> 3.14, with Intel i5 processor and a AMD Radeon HD7770 graphics card. After a
> while (randomly), both monitors go to sleep. Sometimes, they wake up after
> 10-20 seconds and I can continue using the computer, but more often they
> won't and it requires a hard reboot.

Can you get the monitors working again by plugging their power cable out and
back in?

[?]

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


Brightness too high on internal AMD/ATI graphics device, but fine with external AMD/ATI graphics card

2014-07-05 Thread Paul Menzel
Dear Linux folks,


connecting a VGA monitor to the internal graphics device of the ASRock
E350M1 [1], the brightness is much too high.

$ lspci -tvnn
[?]
+-01.0  Advanced Micro Devices [AMD] nee ATI Wrestler [Radeon HD 6310] 
[1002:9802]
+-01.1  Advanced Micro Devices [AMD] nee ATI Wrestler HDMI Audio 
[Radeon HD 6250/6310] [1002:1314]
[?]

Plugging in an external AMD/ATI graphics card and connecting the VGA
monitor there, the brightness is normal as expected.

$ lspci -nn
[?]
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. 
[AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series] [1002:68f9]
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] 
Cedar HDMI Audio [Radeon HD 5400/6300 Series] [1002:aa68]
[?]

The software stack is the same. Any idea how I can configure or debug
that? This has been verified with 3.2.x to 3.14.9.


Thanks,

Paul
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20140705/120eb5e9/attachment.sig>


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

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

--- Comment #65 from kilobug at kilobug.org ---
I did more tests, and it's much better, but still not perfect.

During GPU-intensive tasks (movie playing, Unigine benchmarks, a full Civ5
game) it works all well. But during non-GPU tasks (browsing the web, IRC,
editing text) I got a few freeze.

The freeze doesn't seem to be complete (all the GUI freezes, but the rest seems
to be still working at least for a while), I'll try to get logs/dmesg through
ssh, but my laptop died a few days ago so I can't right now... I'll send more
information as soon as I can get it.

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


[Bug 80419] XCOM: Enemy Unknown Causes lockup

2014-07-05 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=80419

--- Comment #36 from nicolas  ---
(In reply to comment #35)
> (In reply to comment #33)
> > hie, i' tried to make a trace too, but i've failed to build apitrace frome
> > git, and the version of ubuntu 14.04 which is 3.0 segfault with xcom :(
> > 
> > Does it help instead if i use R600_DUMP_SHADERS= 1 ?
> > 
> > If yes, someone can explain me how to redirect the output to a file because
> > >> doen't work.
> 
> Compile apitrace 5.0 from here:
> 
> https://github.com/apitrace/apitrace/releases

Tanks, it works !
I have put the file here http://dl.free.fr/htMkkwBOy

I use a radeon hd4870 with r600g on ubuntu 14.04, kernel 3.15 and oibaf ppa.
The symptoms are that the game crash and return to the desktop.

more details here :

https://bugs.freedesktop.org/show_bug.cgi?id=80618

-- 
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/20140705/9e0c1925/attachment.html>


[PATCH RFC 00/15] Armada DRM updates

2014-07-05 Thread Russell King - ARM Linux
This patch series updates the Armada DRM driver to be more DT friendly
by converting it to the component helper.  This is an incomplete
conversion as we also need to convert the TDA998x as well, hence it
currently retains the existing method of initialisation using the slave
encoder mechanism.  The old mechanism will be removed once the
conversion is complete.

This series includes the component updates (patches 1-3 which have been
recently merged into Greg's driver tree, patch 9 which is scheduled to
be merged) and the recently posted DRM OF helper for encoders (patch 8).
Hence patches 1-3 and 9 are only included for reference purposes.
Please direct comments for patch 8 to the previously posted RFC for
that single patch.

The general idea here is to permit each CRTC device to exist as a
separate device node in DT (as it should be) with all the appropriate
properties such as base address, interrupt and pixel clocks.

The encoders (which may be off-SoC) will be specified separately in DT,
and the connectivity specified via the DT's graph bindings.

The diffstat below is for the entire series, which includes the
component helpre updates and the DRM OF helper.

 .../bindings/drm/armada/marvell,dove-lcd.txt   |  30 +++
 arch/arm/boot/dts/dove.dtsi|  14 ++
 drivers/base/component.c   | 192 +
 drivers/gpu/drm/Makefile   |   1 +
 drivers/gpu/drm/armada/armada_510.c|  23 +-
 drivers/gpu/drm/armada/armada_crtc.c   | 188 +++--
 drivers/gpu/drm/armada/armada_crtc.h   |   9 +-
 drivers/gpu/drm/armada/armada_drm.h|  13 +-
 drivers/gpu/drm/armada/armada_drv.c| 233 ++---
 drivers/gpu/drm/drm_of.c   |  65 ++
 include/drm/drm_crtc.h |   2 +
 include/drm/drm_of.h   |  18 ++
 include/linux/component.h  |   7 +
 13 files changed, 642 insertions(+), 153 deletions(-)

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.


[PATCH RFC 03/15] component: add support for component match array

2014-07-05 Thread Russell King
Add support for generating a set of component matches at master probe
time, and submitting them to the component layer.  This allows the
component layer to perform the matches internally without needing to
call into the master driver, and allows for further restructuring of
the component helper.

Acked-by: Laurent Pinchart 
Signed-off-by: Russell King 
---
 drivers/base/component.c  | 120 --
 include/linux/component.h |   7 +++
 2 files changed, 124 insertions(+), 3 deletions(-)

diff --git a/drivers/base/component.c b/drivers/base/component.c
index 55813e91bf0d..b4236daed4fa 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -18,6 +18,15 @@
 #include 
 #include 

+struct component_match {
+   size_t alloc;
+   size_t num;
+   struct {
+   void *data;
+   int (*fn)(struct device *, void *);
+   } compare[0];
+};
+
 struct master {
struct list_head node;
struct list_head components;
@@ -25,6 +34,7 @@ struct master {

const struct component_master_ops *ops;
struct device *dev;
+   struct component_match *match;
 };

 struct component {
@@ -96,6 +106,34 @@ int component_master_add_child(struct master *master,
 }
 EXPORT_SYMBOL_GPL(component_master_add_child);

+static int find_components(struct master *master)
+{
+   struct component_match *match = master->match;
+   size_t i;
+   int ret = 0;
+
+   if (!match) {
+   /*
+* Search the list of components, looking for components that
+* belong to this master, and attach them to the master.
+*/
+   return master->ops->add_components(master->dev, master);
+   }
+
+   /*
+* Scan the array of match functions and attach
+* any components which are found to this master.
+*/
+   for (i = 0; i < match->num; i++) {
+   ret = component_master_add_child(master,
+match->compare[i].fn,
+match->compare[i].data);
+   if (ret)
+   break;
+   }
+   return ret;
+}
+
 /* Detach all attached components from this master */
 static void master_remove_components(struct master *master)
 {
@@ -128,7 +166,7 @@ static int try_to_bring_up_master(struct master *master,
 * Search the list of components, looking for components that
 * belong to this master, and attach them to the master.
 */
-   if (master->ops->add_components(master->dev, master)) {
+   if (find_components(master)) {
/* Failed to find all components */
ret = 0;
goto out;
@@ -186,18 +224,87 @@ static void take_down_master(struct master *master)
master_remove_components(master);
 }

-int component_master_add(struct device *dev,
-   const struct component_master_ops *ops)
+static size_t component_match_size(size_t num)
+{
+   return offsetof(struct component_match, compare[num]);
+}
+
+static struct component_match *component_match_realloc(struct device *dev,
+   struct component_match *match, size_t num)
+{
+   struct component_match *new;
+
+   if (match && match->alloc == num)
+   return match;
+
+   new = devm_kmalloc(dev, component_match_size(num), GFP_KERNEL);
+   if (!new)
+   return ERR_PTR(-ENOMEM);
+
+   if (match) {
+   memcpy(new, match, component_match_size(min(match->num, num)));
+   devm_kfree(dev, match);
+   } else {
+   new->num = 0;
+   }
+
+   new->alloc = num;
+
+   return new;
+}
+
+/*
+ * Add a component to be matched.
+ *
+ * The match array is first created or extended if necessary.
+ */
+void component_match_add(struct device *dev, struct component_match **matchptr,
+   int (*compare)(struct device *, void *), void *compare_data)
+{
+   struct component_match *match = *matchptr;
+
+   if (IS_ERR(match))
+   return;
+
+   if (!match || match->num == match->alloc) {
+   size_t new_size = match ? match->alloc + 16 : 15;
+
+   match = component_match_realloc(dev, match, new_size);
+
+   *matchptr = match;
+
+   if (IS_ERR(match))
+   return;
+   }
+
+   match->compare[match->num].fn = compare;
+   match->compare[match->num].data = compare_data;
+   match->num++;
+}
+EXPORT_SYMBOL(component_match_add);
+
+int component_master_add_with_match(struct device *dev,
+   const struct component_master_ops *ops,
+   struct component_match *match)
 {
struct master *master;
int ret;

+   if (ops->add_components && match)
+   return -EINVAL;
+
+   /* Reallocate the match array for its true size */
+   match = component_match_realloc(dev, match, match->num);
+  

[PATCH RFC 05/15] drm/armada: use number of CRTCs registered

2014-07-05 Thread Russell King
Use the number of CRTCs registered to size the vblank arrays rather than
our own count.  Number CRTCs using this as well.  This permits us to
register CRTCs as components in the near future rather than as part of a
single device.

Signed-off-by: Russell King 
---
 drivers/gpu/drm/armada/armada_crtc.c | 6 +++---
 drivers/gpu/drm/armada/armada_crtc.h | 3 +--
 drivers/gpu/drm/armada/armada_drv.c  | 4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_crtc.c 
b/drivers/gpu/drm/armada/armada_crtc.c
index 9341a94cc906..4336dfd3585d 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -1050,8 +1050,8 @@ static int armada_drm_crtc_create_properties(struct 
drm_device *dev)
return 0;
 }

-int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
-   struct resource *res, int irq)
+int armada_drm_crtc_create(struct drm_device *dev, struct resource *res,
+   int irq)
 {
struct armada_private *priv = dev->dev_private;
struct armada_crtc *dcrtc;
@@ -1075,7 +1075,7 @@ int armada_drm_crtc_create(struct drm_device *dev, 
unsigned num,
}

dcrtc->base = base;
-   dcrtc->num = num;
+   dcrtc->num = dev->mode_config.num_crtc;
dcrtc->clk = ERR_PTR(-EINVAL);
dcrtc->csc_yuv_mode = CSC_AUTO;
dcrtc->csc_rgb_mode = CSC_AUTO;
diff --git a/drivers/gpu/drm/armada/armada_crtc.h 
b/drivers/gpu/drm/armada/armada_crtc.h
index 0e952b271212..531a9b0bdcfb 100644
--- a/drivers/gpu/drm/armada/armada_crtc.h
+++ b/drivers/gpu/drm/armada/armada_crtc.h
@@ -72,8 +72,7 @@ struct armada_crtc {
 };
 #define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)

-int armada_drm_crtc_create(struct drm_device *, unsigned, struct resource *,
-   int);
+int armada_drm_crtc_create(struct drm_device *, struct resource *, int);
 void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int);
 void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int);
 void armada_drm_crtc_disable_irq(struct armada_crtc *, u32);
diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index 58884d807e6c..add8b101fa9e 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -164,7 +164,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned 
long flags)
if (irq < 0)
goto err_kms;

-   ret = armada_drm_crtc_create(dev, n, res[n], irq);
+   ret = armada_drm_crtc_create(dev, res[n], irq);
if (ret)
goto err_kms;
}
@@ -175,7 +175,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned 
long flags)
goto err_kms;
 #endif

-   ret = drm_vblank_init(dev, n);
+   ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
if (ret)
goto err_kms;

-- 
1.8.3.1



[PATCH RFC 07/15] drm/armada: make variant a CRTC thing

2014-07-05 Thread Russell King
Move the variant pointer into the armada_crtc structure, and update for
the resulting changes.

Signed-off-by: Russell King 
---
 drivers/gpu/drm/armada/armada_510.c  |  4 ++--
 drivers/gpu/drm/armada/armada_crtc.c | 27 ---
 drivers/gpu/drm/armada/armada_crtc.h |  5 -
 drivers/gpu/drm/armada/armada_drm.h  |  9 -
 drivers/gpu/drm/armada/armada_drv.c  |  5 +++--
 5 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_510.c 
b/drivers/gpu/drm/armada/armada_510.c
index a9dabcaef92e..1bcf1a8c1915 100644
--- a/drivers/gpu/drm/armada/armada_510.c
+++ b/drivers/gpu/drm/armada/armada_510.c
@@ -79,6 +79,6 @@ static int armada510_crtc_compute_clock(struct armada_crtc 
*dcrtc,
 const struct armada_variant armada510_ops = {
.has_spu_adv_reg = true,
.spu_adv_reg = ADV_HWC32ENABLE | ADV_HWC32ARGB | ADV_HWC32BLEND,
-   .crtc_init = armada510_crtc_init,
-   .crtc_compute_clock = armada510_crtc_compute_clock,
+   .init = armada510_crtc_init,
+   .compute_clock = armada510_crtc_compute_clock,
 };
diff --git a/drivers/gpu/drm/armada/armada_crtc.c 
b/drivers/gpu/drm/armada/armada_crtc.c
index 3adddabc3626..afa497489000 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -332,17 +332,16 @@ static void armada_drm_crtc_commit(struct drm_crtc *crtc)
 static bool armada_drm_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode, struct drm_display_mode *adj)
 {
-   struct armada_private *priv = crtc->dev->dev_private;
struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
int ret;

/* We can't do interlaced modes if we don't have the SPU_ADV_REG */
-   if (!priv->variant->has_spu_adv_reg &&
+   if (!dcrtc->variant->has_spu_adv_reg &&
adj->flags & DRM_MODE_FLAG_INTERLACE)
return false;

/* Check whether the display mode is possible */
-   ret = priv->variant->crtc_compute_clock(dcrtc, adj, NULL);
+   ret = dcrtc->variant->compute_clock(dcrtc, adj, NULL);
if (ret)
return false;

@@ -491,7 +490,6 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
struct drm_display_mode *mode, struct drm_display_mode *adj,
int x, int y, struct drm_framebuffer *old_fb)
 {
-   struct armada_private *priv = crtc->dev->dev_private;
struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
struct armada_regs regs[17];
uint32_t lm, rm, tm, bm, val, sclk;
@@ -536,7 +534,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
}

/* Now compute the divider for real */
-   priv->variant->crtc_compute_clock(dcrtc, adj, &sclk);
+   dcrtc->variant->compute_clock(dcrtc, adj, &sclk);

/* Ensure graphic fifo is enabled */
armada_reg_queue_mod(regs, i, 0, CFG_PDWN64x66, LCD_SPU_SRAM_PARA1);
@@ -558,7 +556,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
dcrtc->v[1].spu_v_porch = tm << 16 | bm;
val = adj->crtc_hsync_start;
dcrtc->v[1].spu_adv_reg = val << 20 | val | ADV_VSYNCOFFEN |
-   priv->variant->spu_adv_reg;
+   dcrtc->variant->spu_adv_reg;

if (interlaced) {
/* Odd interlaced frame */
@@ -567,7 +565,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
dcrtc->v[0].spu_v_porch = dcrtc->v[1].spu_v_porch + 1;
val = adj->crtc_hsync_start - adj->crtc_htotal / 2;
dcrtc->v[0].spu_adv_reg = val << 20 | val | ADV_VSYNCOFFEN |
-   priv->variant->spu_adv_reg;
+   dcrtc->variant->spu_adv_reg;
} else {
dcrtc->v[0] = dcrtc->v[1];
}
@@ -582,7 +580,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
armada_reg_queue_set(regs, i, dcrtc->v[0].spu_v_h_total,
   LCD_SPUT_V_H_TOTAL);

-   if (priv->variant->has_spu_adv_reg) {
+   if (dcrtc->variant->has_spu_adv_reg) {
armada_reg_queue_mod(regs, i, dcrtc->v[0].spu_adv_reg,
 ADV_VSYNC_L_OFF | ADV_VSYNC_H_OFF |
 ADV_VSYNCOFFEN, LCD_SPU_ADV_REG);
@@ -826,12 +824,11 @@ static int armada_drm_crtc_cursor_set(struct drm_crtc 
*crtc,
 {
struct drm_device *dev = crtc->dev;
struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
-   struct armada_private *priv = crtc->dev->dev_private;
struct armada_gem_object *obj = NULL;
int ret;

/* If no cursor support, replicate drm's return value */
-   if (!priv->variant->has_spu_adv_reg)
+   if (!dcrtc->variant->has_spu_adv_reg)
return -ENXIO;

if (handle && w > 0 && h > 0) {
@@ -879,11 +876,10 @@ static int armada_drm_crtc_cursor_move(struct drm_crtc 
*crtc, int x, int y)
 {
struct drm_device *de

[PATCH RFC 01/15] component: fix missed cleanup in case of devres failure

2014-07-05 Thread Russell King
In try_to_bring_up_master(), we tear down the master's component list
for each error case, except for devres group failure.  Fix this
oversight by making the code less prone to such mistakes.

Acked-by: Laurent Pinchart 
Signed-off-by: Russell King 
---
 drivers/base/component.c | 62 
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/base/component.c b/drivers/base/component.c
index c4778995cd72..d0ebd4431736 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -113,44 +113,44 @@ static void master_remove_components(struct master 
*master)
 static int try_to_bring_up_master(struct master *master,
struct component *component)
 {
-   int ret = 0;
+   int ret;

-   if (!master->bound) {
-   /*
-* Search the list of components, looking for components that
-* belong to this master, and attach them to the master.
-*/
-   if (master->ops->add_components(master->dev, master)) {
-   /* Failed to find all components */
-   master_remove_components(master);
-   ret = 0;
-   goto out;
-   }
+   if (master->bound)
+   return 0;

-   if (component && component->master != master) {
-   master_remove_components(master);
-   ret = 0;
-   goto out;
-   }
+   /*
+* Search the list of components, looking for components that
+* belong to this master, and attach them to the master.
+*/
+   if (master->ops->add_components(master->dev, master)) {
+   /* Failed to find all components */
+   ret = 0;
+   goto out;
+   }

-   if (!devres_open_group(master->dev, NULL, GFP_KERNEL)) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (component && component->master != master) {
+   ret = 0;
+   goto out;
+   }

-   /* Found all components */
-   ret = master->ops->bind(master->dev);
-   if (ret < 0) {
-   devres_release_group(master->dev, NULL);
-   dev_info(master->dev, "master bind failed: %d\n", ret);
-   master_remove_components(master);
-   goto out;
-   }
+   if (!devres_open_group(master->dev, NULL, GFP_KERNEL)) {
+   ret = -ENOMEM;
+   goto out;
+   }

-   master->bound = true;
-   ret = 1;
+   /* Found all components */
+   ret = master->ops->bind(master->dev);
+   if (ret < 0) {
+   devres_release_group(master->dev, NULL);
+   dev_info(master->dev, "master bind failed: %d\n", ret);
+   goto out;
}
+
+   master->bound = true;
+   return 1;
+
 out:
+   master_remove_components(master);

return ret;
 }
-- 
1.8.3.1



[PATCH RFC 08/15] drm: add of_graph endpoint helper to find possible CRTCs

2014-07-05 Thread Russell King
Add a helper to allow encoders to find their possible CRTCs from the
OF graph without having to re-implement this functionality.  We add a
device_node to drm_crtc which corresponds with the port node in the
DT description of the CRTC device.

We can then scan the DRM device list for CRTCs to find their index,
matching the appropriate CRTC using the port device_node, thus building
up the possible CRTC mask.

Signed-off-by: Russell King 
---
 drivers/gpu/drm/Makefile |  1 +
 drivers/gpu/drm/drm_of.c | 65 
 include/drm/drm_crtc.h   |  2 ++
 include/drm/drm_of.h | 18 ++
 4 files changed, 86 insertions(+)
 create mode 100644 drivers/gpu/drm/drm_of.c
 create mode 100644 include/drm/drm_of.h

diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index dd2ba4269740..533d011eab3e 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -20,6 +20,7 @@ drm-$(CONFIG_COMPAT) += drm_ioc32.o
 drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
 drm-$(CONFIG_PCI) += ati_pcigart.o
 drm-$(CONFIG_DRM_PANEL) += drm_panel.o
+drm-$(CONFIG_OF) += drm_of.o

 drm-usb-y   := drm_usb.o

diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
new file mode 100644
index ..46d967881689
--- /dev/null
+++ b/drivers/gpu/drm/drm_of.c
@@ -0,0 +1,65 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+ * drm_crtc_port_mask - find the mask of a registered CRTC by port OF node
+ * @dev: DRM device
+ * @port: port OF node
+ *
+ * Given a port OF node, return the possible mask of the corresponding
+ * CRTC within a device's list of CRTCs.  Returns zero if not found.
+ */
+static uint32_t drm_crtc_port_mask(struct drm_device *dev,
+  struct device_node *port)
+{
+   unsigned int index = 0;
+   struct drm_crtc *tmp;
+
+   list_for_each_entry(tmp, &dev->mode_config.crtc_list, head) {
+   if (tmp->port == port)
+   return 1 << index;
+
+   index++;
+   }
+
+   return 0;
+}
+
+/**
+ * drm_of_find_possible_crtcs - find the possible CRTCs for an encoder port
+ * @dev: DRM device
+ * @port: encoder port to scan for endpoints
+ *
+ * Scan all endpoints attached to a port, locate their attached CRTCs,
+ * and generate the DRM mask of CRTCs which may be attached to this
+ * encoder.
+ */
+uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
+   struct device_node *port)
+{
+   struct device_node *remote_port, *ep = NULL;
+   uint32_t possible_crtcs = 0;
+
+   do {
+   ep = of_graph_get_next_endpoint(port, ep);
+   if (!ep)
+   break;
+
+   remote_port = of_graph_get_remote_port(ep);
+   if (!remote_port) {
+   of_node_put(ep);
+   return 0;
+   }
+
+   possible_crtcs |= drm_crtc_port_mask(dev, remote_port);
+
+   of_node_put(remote_port);
+   } while (1);
+
+   return possible_crtcs;
+}
+EXPORT_SYMBOL(drm_of_find_possible_crtcs);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 251b75e6bf7a..6a94909f1ca9 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -41,6 +41,7 @@ struct drm_framebuffer;
 struct drm_object_properties;
 struct drm_file;
 struct drm_clip_rect;
+struct device_node;

 #define DRM_MODE_OBJECT_CRTC 0x
 #define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
@@ -314,6 +315,7 @@ struct drm_crtc_funcs {
  */
 struct drm_crtc {
struct drm_device *dev;
+   struct device_node *port;
struct list_head head;

/**
diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h
new file mode 100644
index ..2441f7112074
--- /dev/null
+++ b/include/drm/drm_of.h
@@ -0,0 +1,18 @@
+#ifndef __DRM_OF_H__
+#define __DRM_OF_H__
+
+struct drm_device;
+struct device_node;
+
+#ifdef CONFIG_OF
+extern uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
+  struct device_node *port);
+#else
+static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
+ struct device_node *port)
+{
+   return 0;
+}
+#endif
+
+#endif /* __DRM_OF_H__ */
-- 
1.8.3.1



[PATCH RFC 09/15] component: fix bug with legacy API

2014-07-05 Thread Russell King
Sachin Kamat reports that "component: add support for component match
array" broke Exynos DRM due to a NULL pointer deref.  Fix this.

Reported-by: Sachin Kamat 
Tested-by: Sachin Kamat 
Signed-off-by: Russell King 
---
 drivers/base/component.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/base/component.c b/drivers/base/component.c
index b4236daed4fa..f748430bb654 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -293,10 +293,12 @@ int component_master_add_with_match(struct device *dev,
if (ops->add_components && match)
return -EINVAL;

-   /* Reallocate the match array for its true size */
-   match = component_match_realloc(dev, match, match->num);
-   if (IS_ERR(match))
-   return PTR_ERR(match);
+   if (match) {
+   /* Reallocate the match array for its true size */
+   match = component_match_realloc(dev, match, match->num);
+   if (IS_ERR(match))
+   return PTR_ERR(match);
+   }

master = kzalloc(sizeof(*master), GFP_KERNEL);
if (!master)
-- 
1.8.3.1



[PATCH RFC 12/15] dt-bindings: add Marvell Dove LCD controller documentation

2014-07-05 Thread Russell King
Add the Marvell Dove LCD controller DT binding documentation.  The
clock names used here are intentionally taken from the specification
for the Dove SoC.

Signed-off-by: Russell King 
---
 .../bindings/drm/armada/marvell,dove-lcd.txt   | 30 ++
 1 file changed, 30 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/drm/armada/marvell,dove-lcd.txt

diff --git a/Documentation/devicetree/bindings/drm/armada/marvell,dove-lcd.txt 
b/Documentation/devicetree/bindings/drm/armada/marvell,dove-lcd.txt
new file mode 100644
index ..46525ea3e646
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/armada/marvell,dove-lcd.txt
@@ -0,0 +1,30 @@
+Device Tree bindings for Armada DRM CRTC driver
+
+Required properties:
+ - compatible: value should be "marvell,dove-lcd".
+ - reg: base address and size of the LCD controller
+ - interrupts: single interrupt number for the LCD controller
+ - port: video output port with endpoints, as described by graph.txt
+
+Optional properties:
+
+ - clocks: as described by clock-bindings.txt
+ - clock-names: as described by clock-bindings.txt
+   "axiclk" - axi bus clock for pixel clock
+   "plldivider" - pll divider clock for pixel clock
+   "ext_ref_clk0" - external clock 0 for pixel clock
+   "ext_ref_clk1" - external clock 1 for pixel clock
+
+Note: all clocks are optional but at least one must be specified.
+Further clocks may be added in the future according to requirements of
+different SoCs.
+
+Example:
+
+   lcd0: lcd-controller at 82 {
+   compatible = "marvell,dove-lcd";
+   reg = <0x82 0x1000>;
+   interrupts = <47>;
+   clocks = <&si5351 0>;
+   clock-names = "ext_ref_clk_1";
+   };
-- 
1.8.3.1



[PATCH RFC 13/15] drm/armada: permit CRTCs to be registered as separate devices

2014-07-05 Thread Russell King
Signed-off-by: Russell King 
---
 drivers/gpu/drm/armada/armada_crtc.c | 114 ---
 drivers/gpu/drm/armada/armada_crtc.h |   4 +-
 drivers/gpu/drm/armada/armada_drv.c  |   5 +-
 3 files changed, 110 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_crtc.c 
b/drivers/gpu/drm/armada/armada_crtc.c
index afa497489000..7cc30475f8f3 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -7,6 +7,9 @@
  * published by the Free Software Foundation.
  */
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include "armada_crtc.h"
@@ -1046,19 +1049,19 @@ static int armada_drm_crtc_create_properties(struct 
drm_device *dev)
return 0;
 }

-int armada_drm_crtc_create(struct drm_device *dev, struct resource *res,
-   int irq, const struct armada_variant *variant)
+int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
+   struct resource *res, int irq, const struct armada_variant *variant)
 {
-   struct armada_private *priv = dev->dev_private;
+   struct armada_private *priv = drm->dev_private;
struct armada_crtc *dcrtc;
void __iomem *base;
int ret;

-   ret = armada_drm_crtc_create_properties(dev);
+   ret = armada_drm_crtc_create_properties(drm);
if (ret)
return ret;

-   base = devm_request_and_ioremap(dev->dev, res);
+   base = devm_request_and_ioremap(dev, res);
if (!base) {
DRM_ERROR("failed to ioremap register\n");
return -ENOMEM;
@@ -1070,9 +1073,12 @@ int armada_drm_crtc_create(struct drm_device *dev, 
struct resource *res,
return -ENOMEM;
}

+   if (dev != drm->dev)
+   dev_set_drvdata(dev, dcrtc);
+
dcrtc->variant = variant;
dcrtc->base = base;
-   dcrtc->num = dev->mode_config.num_crtc;
+   dcrtc->num = drm->mode_config.num_crtc;
dcrtc->clk = ERR_PTR(-EINVAL);
dcrtc->csc_yuv_mode = CSC_AUTO;
dcrtc->csc_rgb_mode = CSC_AUTO;
@@ -1105,7 +,7 @@ int armada_drm_crtc_create(struct drm_device *dev, struct 
resource *res,
}

if (dcrtc->variant->init) {
-   ret = dcrtc->variant->init(dcrtc, dev->dev);
+   ret = dcrtc->variant->init(dcrtc, dev);
if (ret) {
kfree(dcrtc);
return ret;
@@ -1117,7 +1123,7 @@ int armada_drm_crtc_create(struct drm_device *dev, struct 
resource *res,

priv->dcrtc[dcrtc->num] = dcrtc;

-   drm_crtc_init(dev, &dcrtc->crtc, &armada_crtc_funcs);
+   drm_crtc_init(drm, &dcrtc->crtc, &armada_crtc_funcs);
drm_crtc_helper_add(&dcrtc->crtc, &armada_crtc_helper_funcs);

drm_object_attach_property(&dcrtc->crtc.base, priv->csc_yuv_prop,
@@ -1125,5 +1131,95 @@ int armada_drm_crtc_create(struct drm_device *dev, 
struct resource *res,
drm_object_attach_property(&dcrtc->crtc.base, priv->csc_rgb_prop,
   dcrtc->csc_rgb_mode);

-   return armada_overlay_plane_create(dev, 1 << dcrtc->num);
+   return armada_overlay_plane_create(drm, 1 << dcrtc->num);
+}
+
+static int
+armada_lcd_bind(struct device *dev, struct device *master, void *data)
+{
+   struct platform_device *pdev = to_platform_device(dev);
+   struct drm_device *drm = data;
+   struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   int irq = platform_get_irq(pdev, 0);
+   const struct armada_variant *variant;
+
+   if (irq < 0)
+   return irq;
+
+   if (!dev->of_node) {
+   const struct platform_device_id *id;
+
+   id = platform_get_device_id(pdev);
+   if (!id)
+   return -ENXIO;
+
+   variant = (const struct armada_variant *)id->driver_data;
+   } else {
+   const struct of_device_id *match;
+
+   match = of_match_device(dev->driver->of_match_table, dev);
+   if (!match)
+   return -ENXIO;
+
+   variant = match->data;
+   }
+
+   return armada_drm_crtc_create(drm, dev, res, irq, variant);
+}
+
+static void
+armada_lcd_unbind(struct device *dev, struct device *master, void *data)
+{
+   struct armada_crtc *dcrtc = dev_get_drvdata(dev);
+
+   armada_drm_crtc_destroy(&dcrtc->crtc);
+}
+
+static const struct component_ops armada_lcd_ops = {
+   .bind = armada_lcd_bind,
+   .unbind = armada_lcd_unbind,
+};
+
+static int armada_lcd_probe(struct platform_device *pdev)
+{
+   return component_add(&pdev->dev, &armada_lcd_ops);
+}
+
+static int armada_lcd_remove(struct platform_device *pdev)
+{
+   component_del(&pdev->dev, &armada_lcd_ops);
+   return 0;
 }
+
+static struct of_device_id armada_lcd_of_match[] = {
+   {
+   .compatible = "marvell,dove-lcd",
+   .data   

[PATCH RFC 14/15] drm/armada: register crtc with port

2014-07-05 Thread Russell King
Register the CRTC with the port node so that the DRM OF helpers can
find the appropriate CRTC.  This is important so that encoders can
identify their corresponding possible CRTCs.

Signed-off-by: Russell King 
---
 drivers/gpu/drm/armada/armada_crtc.c | 21 +++--
 drivers/gpu/drm/armada/armada_crtc.h |  4 +++-
 drivers/gpu/drm/armada/armada_drv.c  |  2 +-
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_crtc.c 
b/drivers/gpu/drm/armada/armada_crtc.c
index 7cc30475f8f3..9b06ff0f5442 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -910,6 +910,8 @@ static void armada_drm_crtc_destroy(struct drm_crtc *crtc)

writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ENA);

+   of_node_put(dcrtc->crtc.port);
+
kfree(dcrtc);
 }

@@ -1050,7 +1052,8 @@ static int armada_drm_crtc_create_properties(struct 
drm_device *dev)
 }

 int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
-   struct resource *res, int irq, const struct armada_variant *variant)
+   struct resource *res, int irq, const struct armada_variant *variant,
+   struct device_node *port)
 {
struct armada_private *priv = drm->dev_private;
struct armada_crtc *dcrtc;
@@ -1123,6 +1126,7 @@ int armada_drm_crtc_create(struct drm_device *drm, struct 
device *dev,

priv->dcrtc[dcrtc->num] = dcrtc;

+   dcrtc->crtc.port = port;
drm_crtc_init(drm, &dcrtc->crtc, &armada_crtc_funcs);
drm_crtc_helper_add(&dcrtc->crtc, &armada_crtc_helper_funcs);

@@ -1142,6 +1146,7 @@ armada_lcd_bind(struct device *dev, struct device 
*master, void *data)
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
int irq = platform_get_irq(pdev, 0);
const struct armada_variant *variant;
+   struct device_node *port = NULL;

if (irq < 0)
return irq;
@@ -1156,15 +1161,27 @@ armada_lcd_bind(struct device *dev, struct device 
*master, void *data)
variant = (const struct armada_variant *)id->driver_data;
} else {
const struct of_device_id *match;
+   struct device_node *np, *parent = dev->of_node;

match = of_match_device(dev->driver->of_match_table, dev);
if (!match)
return -ENXIO;

+   np = of_get_child_by_name(parent, "ports");
+   if (np)
+   parent = np;
+   port = of_get_child_by_name(parent, "port");
+   of_node_put(np);
+   if (!port) {
+   dev_err(dev, "no port node found in %s\n",
+   parent->full_name);
+   return -ENXIO;
+   }
+
variant = match->data;
}

-   return armada_drm_crtc_create(drm, dev, res, irq, variant);
+   return armada_drm_crtc_create(drm, dev, res, irq, variant, port);
 }

 static void
diff --git a/drivers/gpu/drm/armada/armada_crtc.h 
b/drivers/gpu/drm/armada/armada_crtc.h
index 0fc50b39f129..23135aa94b50 100644
--- a/drivers/gpu/drm/armada/armada_crtc.h
+++ b/drivers/gpu/drm/armada/armada_crtc.h
@@ -75,8 +75,10 @@ struct armada_crtc {
 };
 #define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)

+struct device_node;
 int armada_drm_crtc_create(struct drm_device *, struct device *,
-   struct resource *, int, const struct armada_variant *);
+   struct resource *, int, const struct armada_variant *,
+   struct device_node *);
 void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int);
 void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int);
 void armada_drm_crtc_disable_irq(struct armada_crtc *, u32);
diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index ef8a1db7..082ae845d70f 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -169,7 +169,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned 
long flags)
goto err_kms;

ret = armada_drm_crtc_create(dev, dev->dev, res[n], irq,
-variant);
+variant, NULL);
if (ret)
goto err_kms;
}
-- 
1.8.3.1



[GIT PULL] TDA998x fixes

2014-07-05 Thread Russell King
David,

Please incorporate the latest TDA998x fixes, which can be found at:

  git://ftp.arm.linux.org.uk/~rmk/linux-cubox.git tda998x-fixes

with SHA1 de4bf3d51fe38eaf90cb587e4eae1f3f0e056a54.

A number of relatively minor TDA998x fixes, the most serious of which
is the positioning of the drm_i2c_encoder_destroy call, which is marked
for inclusion in stable trees.

These changes are based on v3.15, and test merging with your drm-fixes
(0fcb70c30131) dated 27th June shows no conflicts.

This will update the following files:

 Documentation/devicetree/bindings/drm/i2c/tda998x.txt |  2 ++
 drivers/gpu/drm/i2c/tda998x_drv.c | 12 +---
 2 files changed, 11 insertions(+), 3 deletions(-)

through these changes:

Guido Mart?nez (1):
  drm/i2c: tda998x: move drm_i2c_encoder_destroy call

Jean-Francois Moine (1):
  drm/i2c: tda998x: fix lack of required reg in DT documentation

Russell King (2):
  drm/i2c: tda998x: faster polling for edid
  drm/i2c: tda998x: add some basic mode validation

Many thanks.


[PATCH RFC 02/15] component: ignore multiple additions of the same component

2014-07-05 Thread Russell King
Permit masters to call component_master_add_child() and match the same
child multiple times.  This may happen if there's multiple connections
to a single component device from other devices.  In such scenarios,
we should not return a failure, but instead ignore the attempt.

Acked-by: Laurent Pinchart 
Signed-off-by: Russell King 
---
 drivers/base/component.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/base/component.c b/drivers/base/component.c
index d0ebd4431736..55813e91bf0d 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -69,6 +69,11 @@ static void component_detach_master(struct master *master, 
struct component *c)
c->master = NULL;
 }

+/*
+ * Add a component to a master, finding the component via the compare
+ * function and compare data.  This is safe to call for duplicate matches
+ * and will not result in the same component being added multiple times.
+ */
 int component_master_add_child(struct master *master,
int (*compare)(struct device *, void *), void *compare_data)
 {
@@ -76,11 +81,12 @@ int component_master_add_child(struct master *master,
int ret = -ENXIO;

list_for_each_entry(c, &component_list, node) {
-   if (c->master)
+   if (c->master && c->master != master)
continue;

if (compare(c->dev, compare_data)) {
-   component_attach_master(master, c);
+   if (!c->master)
+   component_attach_master(master, c);
ret = 0;
break;
}
-- 
1.8.3.1



[PATCH RFC 04/15] drm/armada: move IRQ handling into CRTC

2014-07-05 Thread Russell King
Signed-off-by: Russell King 
---
 drivers/gpu/drm/armada/armada_crtc.c | 36 +--
 drivers/gpu/drm/armada/armada_crtc.h |  4 +--
 drivers/gpu/drm/armada/armada_drv.c  | 68 +---
 3 files changed, 45 insertions(+), 63 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_crtc.c 
b/drivers/gpu/drm/armada/armada_crtc.c
index 81c34f949dfc..9341a94cc906 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -349,7 +349,7 @@ static bool armada_drm_crtc_mode_fixup(struct drm_crtc 
*crtc,
return true;
 }

-void armada_drm_crtc_irq(struct armada_crtc *dcrtc, u32 stat)
+static void armada_drm_crtc_irq(struct armada_crtc *dcrtc, u32 stat)
 {
struct armada_vbl_event *e, *n;
void __iomem *base = dcrtc->base;
@@ -410,6 +410,27 @@ void armada_drm_crtc_irq(struct armada_crtc *dcrtc, u32 
stat)
}
 }

+static irqreturn_t armada_drm_irq(int irq, void *arg)
+{
+   struct armada_crtc *dcrtc = arg;
+   u32 v, stat = readl_relaxed(dcrtc->base + LCD_SPU_IRQ_ISR);
+
+   /*
+* This is rediculous - rather than writing bits to clear, we
+* have to set the actual status register value.  This is racy.
+*/
+   writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ISR);
+
+   /* Mask out those interrupts we haven't enabled */
+   v = stat & dcrtc->irq_ena;
+
+   if (v & (VSYNC_IRQ|GRA_FRAME_IRQ|DUMB_FRAMEDONE)) {
+   armada_drm_crtc_irq(dcrtc, stat);
+   return IRQ_HANDLED;
+   }
+   return IRQ_NONE;
+}
+
 /* These are locked by dev->vbl_lock */
 void armada_drm_crtc_disable_irq(struct armada_crtc *dcrtc, u32 mask)
 {
@@ -888,6 +909,8 @@ static void armada_drm_crtc_destroy(struct drm_crtc *crtc)
if (!IS_ERR(dcrtc->clk))
clk_disable_unprepare(dcrtc->clk);

+   writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ENA);
+
kfree(dcrtc);
 }

@@ -1028,7 +1051,7 @@ static int armada_drm_crtc_create_properties(struct 
drm_device *dev)
 }

 int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
-   struct resource *res)
+   struct resource *res, int irq)
 {
struct armada_private *priv = dev->dev_private;
struct armada_crtc *dcrtc;
@@ -1074,6 +1097,15 @@ int armada_drm_crtc_create(struct drm_device *dev, 
unsigned num,
   CFG_PDWN64x66, dcrtc->base + LCD_SPU_SRAM_PARA1);
writel_relaxed(0x2032ff81, dcrtc->base + LCD_SPU_DMA_CTRL1);
writel_relaxed(0x, dcrtc->base + LCD_SPU_GRA_OVSA_HPXL_VLN);
+   writel_relaxed(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA);
+   writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ISR);
+
+   ret = devm_request_irq(dev, irq, armada_drm_irq, 0, "armada_drm_crtc",
+  dcrtc);
+   if (ret < 0) {
+   kfree(dcrtc);
+   return ret;
+   }

if (priv->variant->crtc_init) {
ret = priv->variant->crtc_init(dcrtc);
diff --git a/drivers/gpu/drm/armada/armada_crtc.h 
b/drivers/gpu/drm/armada/armada_crtc.h
index 9c10a07e7492..0e952b271212 100644
--- a/drivers/gpu/drm/armada/armada_crtc.h
+++ b/drivers/gpu/drm/armada/armada_crtc.h
@@ -72,10 +72,10 @@ struct armada_crtc {
 };
 #define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)

-int armada_drm_crtc_create(struct drm_device *, unsigned, struct resource *);
+int armada_drm_crtc_create(struct drm_device *, unsigned, struct resource *,
+   int);
 void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int);
 void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int);
-void armada_drm_crtc_irq(struct armada_crtc *, u32);
 void armada_drm_crtc_disable_irq(struct armada_crtc *, u32);
 void armada_drm_crtc_enable_irq(struct armada_crtc *, u32);
 void armada_drm_crtc_update_regs(struct armada_crtc *, struct armada_regs *);
diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index 8ab3cd1a8cdb..58884d807e6c 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -155,10 +155,16 @@ static int armada_drm_load(struct drm_device *dev, 
unsigned long flags)

/* Create all LCD controllers */
for (n = 0; n < ARRAY_SIZE(priv->dcrtc); n++) {
+   int irq;
+
if (!res[n])
break;

-   ret = armada_drm_crtc_create(dev, n, res[n]);
+   irq = platform_get_irq(dev->platformdev, n);
+   if (irq < 0)
+   goto err_kms;
+
+   ret = armada_drm_crtc_create(dev, n, res[n], irq);
if (ret)
goto err_kms;
}
@@ -173,22 +179,16 @@ static int armada_drm_load(struct drm_device *dev, 
unsigned long flags)
if (ret)
goto err_kms;

-   ret = drm_irq_install(dev, platform_get_irq(dev->platformdev, 0));
-   if (ret)
-

[PATCH RFC 06/15] drm/armada: move variant initialisation to CRTC init

2014-07-05 Thread Russell King
Move the variant initialisation entirely to the CRTC init function -
the variant support is really about the CRTC properties than the whole
system, and we want to treat each CRTC individually when we support DT.

Signed-off-by: Russell King 
---
 drivers/gpu/drm/armada/armada_510.c  | 19 ---
 drivers/gpu/drm/armada/armada_crtc.c |  2 +-
 drivers/gpu/drm/armada/armada_crtc.h |  1 +
 drivers/gpu/drm/armada/armada_drm.h  |  6 ++
 drivers/gpu/drm/armada/armada_drv.c  |  4 
 5 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_510.c 
b/drivers/gpu/drm/armada/armada_510.c
index 59948eff6095..a9dabcaef92e 100644
--- a/drivers/gpu/drm/armada/armada_510.c
+++ b/drivers/gpu/drm/armada/armada_510.c
@@ -15,20 +15,19 @@
 #include "armada_drm.h"
 #include "armada_hw.h"

-static int armada510_init(struct armada_private *priv, struct device *dev)
+static int armada510_crtc_init(struct armada_crtc *dcrtc, struct device *dev)
 {
-   priv->extclk[0] = devm_clk_get(dev, "ext_ref_clk_1");
+   struct clk *clk;

-   if (IS_ERR(priv->extclk[0]) && PTR_ERR(priv->extclk[0]) == -ENOENT)
-   priv->extclk[0] = ERR_PTR(-EPROBE_DEFER);
+   clk = devm_clk_get(dev, "ext_ref_clk_1");
+   if (IS_ERR(clk))
+   return PTR_ERR(clk) == -ENOENT ? -EPROBE_DEFER : PTR_ERR(clk);

-   return PTR_RET(priv->extclk[0]);
-}
+   dcrtc->extclk[0] = clk;

-static int armada510_crtc_init(struct armada_crtc *dcrtc)
-{
/* Lower the watermark so to eliminate jitter at higher bandwidths */
armada_updatel(0x20, (1 << 11) | 0xff, dcrtc->base + LCD_CFG_RDREG4F);
+
return 0;
 }

@@ -45,8 +44,7 @@ static int armada510_crtc_init(struct armada_crtc *dcrtc)
 static int armada510_crtc_compute_clock(struct armada_crtc *dcrtc,
const struct drm_display_mode *mode, uint32_t *sclk)
 {
-   struct armada_private *priv = dcrtc->crtc.dev->dev_private;
-   struct clk *clk = priv->extclk[0];
+   struct clk *clk = dcrtc->extclk[0];
int ret;

if (dcrtc->num == 1)
@@ -81,7 +79,6 @@ static int armada510_crtc_compute_clock(struct armada_crtc 
*dcrtc,
 const struct armada_variant armada510_ops = {
.has_spu_adv_reg = true,
.spu_adv_reg = ADV_HWC32ENABLE | ADV_HWC32ARGB | ADV_HWC32BLEND,
-   .init = armada510_init,
.crtc_init = armada510_crtc_init,
.crtc_compute_clock = armada510_crtc_compute_clock,
 };
diff --git a/drivers/gpu/drm/armada/armada_crtc.c 
b/drivers/gpu/drm/armada/armada_crtc.c
index 4336dfd3585d..3adddabc3626 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -1108,7 +1108,7 @@ int armada_drm_crtc_create(struct drm_device *dev, struct 
resource *res,
}

if (priv->variant->crtc_init) {
-   ret = priv->variant->crtc_init(dcrtc);
+   ret = priv->variant->crtc_init(dcrtc, dev->dev);
if (ret) {
kfree(dcrtc);
return ret;
diff --git a/drivers/gpu/drm/armada/armada_crtc.h 
b/drivers/gpu/drm/armada/armada_crtc.h
index 531a9b0bdcfb..3f0e70bb2e9c 100644
--- a/drivers/gpu/drm/armada/armada_crtc.h
+++ b/drivers/gpu/drm/armada/armada_crtc.h
@@ -38,6 +38,7 @@ struct armada_crtc {
unsignednum;
void __iomem*base;
struct clk  *clk;
+   struct clk  *extclk[2];
struct {
uint32_tspu_v_h_total;
uint32_tspu_v_porch;
diff --git a/drivers/gpu/drm/armada/armada_drm.h 
b/drivers/gpu/drm/armada/armada_drm.h
index a72cae03b99b..a5452ae883d1 100644
--- a/drivers/gpu/drm/armada/armada_drm.h
+++ b/drivers/gpu/drm/armada/armada_drm.h
@@ -59,10 +59,9 @@ void armada_drm_vbl_event_remove_unlocked(struct armada_crtc 
*,
 struct armada_private;

 struct armada_variant {
-   boolhas_spu_adv_reg;
+   bool has_spu_adv_reg;
uint32_t spu_adv_reg;
-   int (*init)(struct armada_private *, struct device *);
-   int (*crtc_init)(struct armada_crtc *);
+   int (*crtc_init)(struct armada_crtc *, struct device *);
int (*crtc_compute_clock)(struct armada_crtc *,
  const struct drm_display_mode *,
  uint32_t *);
@@ -78,7 +77,6 @@ struct armada_private {
struct drm_fb_helper*fbdev;
struct armada_crtc  *dcrtc[2];
struct drm_mm   linear;
-   struct clk  *extclk[2];
struct drm_property *csc_yuv_prop;
struct drm_property *csc_rgb_prop;
struct drm_property *colorkey_prop;
diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index add8b101fa9e..4939a86a2afc 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -130,10 +130,6 @@ static int armada_drm_load(struct drm_device *dev

[PATCH RFC 10/15] drm/armada: convert to componentized support

2014-07-05 Thread Russell King
Convert the Armada DRM driver to use the component helpers, which will
permit us to clean up the driver and move towards an implementation
which is compatible with a DT description of the hardware.

Signed-off-by: Russell King 
---
 drivers/gpu/drm/armada/armada_drv.c | 155 ++--
 1 file changed, 148 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index 3995be3c686b..2b6fc6cf62f2 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -6,7 +6,9 @@
  * published by the Free Software Foundation.
  */
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include "armada_crtc.h"
@@ -52,6 +54,11 @@ static const struct armada_drm_slave_config tda19988_config 
= {
 };
 #endif

+static bool is_componentized(struct device *dev)
+{
+   return dev->of_node || dev->platform_data;
+}
+
 static void armada_drm_unref_work(struct work_struct *work)
 {
struct armada_private *priv =
@@ -166,26 +173,35 @@ static int armada_drm_load(struct drm_device *dev, 
unsigned long flags)
goto err_kms;
}

+   if (is_componentized(dev->dev)) {
+   ret = component_bind_all(dev->dev, dev);
+   if (ret)
+   goto err_kms;
+   } else {
 #ifdef CONFIG_DRM_ARMADA_TDA1998X
-   ret = armada_drm_connector_slave_create(dev, &tda19988_config);
-   if (ret)
-   goto err_kms;
+   ret = armada_drm_connector_slave_create(dev, &tda19988_config);
+   if (ret)
+   goto err_kms;
 #endif
+   }

ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
if (ret)
-   goto err_kms;
+   goto err_comp;

dev->vblank_disable_allowed = 1;

ret = armada_fbdev_init(dev);
if (ret)
-   goto err_kms;
+   goto err_comp;

drm_kms_helper_poll_init(dev);

return 0;

+ err_comp:
+   if (is_componentized(dev->dev))
+   component_unbind_all(dev->dev, dev);
  err_kms:
drm_mode_config_cleanup(dev);
drm_mm_takedown(&priv->linear);
@@ -200,6 +216,10 @@ static int armada_drm_unload(struct drm_device *dev)

drm_kms_helper_poll_fini(dev);
armada_fbdev_fini(dev);
+
+   if (is_componentized(dev->dev))
+   component_unbind_all(dev->dev, dev);
+
drm_mode_config_cleanup(dev);
drm_mm_takedown(&priv->linear);
flush_work(&priv->fb_unref_work);
@@ -314,14 +334,135 @@ static struct drm_driver armada_drm_driver = {
.fops   = &armada_drm_fops,
 };

+static int armada_drm_bind(struct device *dev)
+{
+   return drm_platform_init(&armada_drm_driver, to_platform_device(dev));
+}
+
+static void armada_drm_unbind(struct device *dev)
+{
+   drm_put_dev(dev_get_drvdata(dev));
+}
+
+static int compare_of(struct device *dev, void *data)
+{
+   return dev->of_node == data;
+}
+
+static int compare_dev_name(struct device *dev, void *data)
+{
+   const char *name = data;
+   return !strcmp(dev_name(dev), name);
+}
+
+static void armada_add_endpoints(struct device *dev,
+   struct component_match **match, struct device_node *port)
+{
+   struct device_node *ep, *remote;
+
+   for_each_child_of_node(port, ep) {
+   remote = of_graph_get_remote_port_parent(ep);
+   if (!remote || !of_device_is_available(remote)) {
+   of_node_put(remote);
+   continue;
+   } else if (!of_device_is_available(remote->parent)) {
+   dev_warn(dev, "parent device of %s is not available\n",
+remote->full_name);
+   of_node_put(remote);
+   continue;
+   }
+
+   component_match_add(dev, match, compare_of, remote);
+   of_node_put(remote);
+   }
+}
+
+static int armada_drm_find_components(struct device *dev,
+   struct component_match **match)
+{
+   struct device_node *port;
+   int i;
+
+   if (dev->of_node) {
+   struct device_node *np = dev->of_node;
+
+   for (i = 0; ; i++) {
+   port = of_parse_phandle(np, "ports", i);
+   if (!port)
+   break;
+
+   component_match_add(dev, match, compare_of, port);
+   of_node_put(port);
+   }
+
+   if (i == 0) {
+   dev_err(dev, "missing 'ports' property\n");
+   return -ENODEV;
+   }
+
+   for (i = 0; ; i++) {
+   port = of_parse_phandle(np, "ports", i);
+   if (!port)
+   break;
+
+   armada_add_endpoints(dev, match, po

[PATCH RFC 11/15] drm/armada: update Armada 510 (Dove) to use "ext_ref_clk1" as the clock

2014-07-05 Thread Russell King
Remove the underscore between "clk" and "1" so that we match the name
of the clock given in the documentation.

Signed-off-by: Russell King 
---
 drivers/gpu/drm/armada/armada_510.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/armada/armada_510.c 
b/drivers/gpu/drm/armada/armada_510.c
index 1bcf1a8c1915..ad3d2ebf95c9 100644
--- a/drivers/gpu/drm/armada/armada_510.c
+++ b/drivers/gpu/drm/armada/armada_510.c
@@ -19,7 +19,7 @@ static int armada510_crtc_init(struct armada_crtc *dcrtc, 
struct device *dev)
 {
struct clk *clk;

-   clk = devm_clk_get(dev, "ext_ref_clk_1");
+   clk = devm_clk_get(dev, "ext_ref_clk1");
if (IS_ERR(clk))
return PTR_ERR(clk) == -ENOENT ? -EPROBE_DEFER : PTR_ERR(clk);

-- 
1.8.3.1



[PATCH RFC 15/15] ARM: dts: dove: add DT LCD controllers

2014-07-05 Thread Russell King
Add the DT fragment for the Marvell Dove LCD controllers.

Signed-off-by: Russell King 
---
 arch/arm/boot/dts/dove.dtsi | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
index 3b891dd20993..a5441d5482a6 100644
--- a/arch/arm/boot/dts/dove.dtsi
+++ b/arch/arm/boot/dts/dove.dtsi
@@ -630,6 +630,20 @@
reg = <0xe8400 0x0c>;
ngpios = <8>;
};
+
+   lcd1: lcd-controller at 81 {
+   compatible = "marvell,dove-lcd";
+   reg = <0x81 0x1000>;
+   interrupts = <46>;
+   status = "disabled";
+   };
+
+   lcd0: lcd-controller at 82 {
+   compatible = "marvell,dove-lcd";
+   reg = <0x82 0x1000>;
+   interrupts = <47>;
+   status = "disabled";
+   };
};
};
 };
-- 
1.8.3.1



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

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

--- Comment #66 from perry3d at gmail.com ---
@kilobug: did you try the sysrg keys
(http://en.wikipedia.org/wiki/Magic_SysRq_key). With Alt+Pause+k i can kill X
and start working again.

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


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

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

--- Comment #67 from perry3d at gmail.com ---
Oh i forgot: you have to enable them with "echo 1 > /proc/sys/kernel/sysrq".

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


[PATCH RFC] drm: add of_graph endpoint helper to find possible CRTCs

2014-07-05 Thread Rob Clark
On Thu, Jul 3, 2014 at 6:41 PM, Russell King - ARM Linux
 wrote:
> On Thu, Jul 03, 2014 at 06:17:24PM -0400, Rob Clark wrote:
>> On Thu, Jul 3, 2014 at 12:49 PM, Russell King
>>  wrote:
>> > Add a helper to allow encoders to find their possible CRTCs from the
>> > OF graph without having to re-implement this functionality.  We add a
>> > device_node to drm_crtc which corresponds with the port node in the
>> > DT description of the CRTC device.
>> >
>> > We can then scan the DRM device list for CRTCs to find their index,
>> > matching the appropriate CRTC using the port device_node, thus building
>> > up the possible CRTC mask.
>> >
>> > Signed-off-by: Russell King 
>> > ---
>> > This helper will be shared between imx-drm and Armada DRM, and should
>> > be useful for other OF-based drivers.  At the moment, this is being
>> > sent for comments and acks; I need to build upon this patch in order
>> > to convert Armada DRM to DT.
>>
>> ok, possibly a dumb question, but in my defense I don't claim to be a
>> DT expert ;-)
>>
>> Do you have somewhere handy a example dts which this would be parsing?
>>  I think that would help me understand this patch a bit better.
>
> The patch is merely moving something that's already being used by
> imx-drm into a more convenient location.
>
> The documentation for the "binding" (it isn't really parsing a binding,
> merely traversing the graph itself) is:
>
> Documentation/devicetree/bindings/graph.txt

ahh, thanks.. this makes more sense.  Might be worth putting something
along the lines of "see Documentation/devicetree/bindings/graph.txt"
for the drm_of_find_possible_crtcs() comment block.

BR,
-R

> which is shared from the v4l2 code.
>
> To give an example, this is an extract from the imx6qdl dtsi file.  I've
> cut out a load of stuff which isn't that relevant to the overall
> structure.  The full stuff is arch/arm/boots/dts/imx6qdl.dtsi.
>
> IPU contains two display interfaces (DIs, aka CRTCs).  Each display
> interface is connected to a set of muxes, one mux per display bridge
> (encoder/connector) which can select between DI0 or DI1.  Some chips
> have two IPUs, hence four DIs, making it possible to drive the four
> display bridges entirely independently.
>
> ipu1: ipu at 0240 {
> ipu1_di0: port at 2 {
> ipu1_di0_hdmi: endpoint at 1 {
> remote-endpoint = <&hdmi_mux_0>;
> };
> ...
> ipu1_di0_lvds1: endpoint at 4 {
> remote-endpoint = <&lvds1_mux_0>;
> };
> };
>
> ipu1_di1: port at 3 {
> ipu1_di0_disp1: endpoint at 0 {
> };
>
> ipu1_di1_hdmi: endpoint at 1 {
> remote-endpoint = <&hdmi_mux_1>;
> };
> ...
> ipu1_di1_lvds1: endpoint at 4 {
> remote-endpoint = <&lvds1_mux_1>;
> };
> };
> };
>
> HDMI transmitter component:
>
> hdmi: hdmi at 012 {
> port at 0 {
> reg = <0>;
>
> hdmi_mux_0: endpoint {
> remote-endpoint = 
> <&ipu1_di0_hdmi>;
> };
> };
>
> port at 1 {
> reg = <1>;
>
> hdmi_mux_1: endpoint {
> remote-endpoint = 
> <&ipu1_di1_hdmi>;
> };
> };
> };
>
> --
> FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
> improving, and getting towards what was expected from it.


[PATCH RFC 06/15] drm/armada: move variant initialisation to CRTC init

2014-07-05 Thread Russell King - ARM Linux
On Sat, Jul 05, 2014 at 01:58:37PM +0200, Sebastian Hesselbarth wrote:
> On 07/05/2014 12:38 PM, Russell King wrote:
> > Move the variant initialisation entirely to the CRTC init function -
> > the variant support is really about the CRTC properties than the whole
> > system, and we want to treat each CRTC individually when we support DT.
> > 
> > Signed-off-by: Russell King 
> > ---
> [...]
> > diff --git a/drivers/gpu/drm/armada/armada_crtc.h 
> > b/drivers/gpu/drm/armada/armada_crtc.h
> > index 531a9b0bdcfb..3f0e70bb2e9c 100644
> > --- a/drivers/gpu/drm/armada/armada_crtc.h
> > +++ b/drivers/gpu/drm/armada/armada_crtc.h
> > @@ -38,6 +38,7 @@ struct armada_crtc {
> > unsignednum;
> > void __iomem*base;
> > struct clk  *clk;
> > +   struct clk  *extclk[2];
> 
> Russell,
> 
> I wonder, if we should rename above array srcclk instead of extclk
> while moving it anyway. That way we can use it for the other variant
> specific clocks, too.

pixelclk may be a better name for it.  I would like to think about the
clock handling further though - the issues surrounding clock selection
are not limited to just Armada - imx-drm has the exact same problem.

The issue with clocking of CRTCs is that it seems to be common that:

1. you have multiple clocks to choose from, some of which may be more
   suitable than others depending on the type of output.

2. clocks end up being shared between multiple CRTCs, and one CRTC
   can (at the moment) interfere with the clock rate delivered to
   another CRTC.

This happens on imx-drm today, where the two DIs (CRTCs) are in use -
one for HDMI, the other for LVDS.  We end up with HDMI set first to
148.5MHz, and then LVDS sets it's clock to 65MHz, which results in
HDMI receiving a clock at over 500MHz!  At the moment, there are hacks
to solve this by adjusting the muxes in the clock paths to ensure that
they both derive from different PLLs - moving the LVDS onto the USB OTG
PLL rather than the video PLL.  That works fine until USB OTG wants
to change the OTG PLL.

There's also the issue whether the output can cope with fractional
clock-skipping dividers - entirely synchronous display systems can
(such as synchronously clocked LCD panels), but asynchronous display
systems (such as HDMI, TV out, etc) can't.  That said, the other
parameter that needs to be taken account of here is that even with the
fractional divider, the minimum output clock period isn't the average
frequency, but the maximum frequency, which may violate a panel's minimum
clock period specification.

I think there's lots to do on the clocking side, and as it's a fairly
complex problem which is common to multiple implementations, I think
that any solution should not be specific.

However, this topic isn't one which I want to work on until I have
reduced down my patch sets to something more manageable - something
which I'm desperate to do.  (I've been trying to avoid adding any
further patches to any tree for some time now.)  This is why (eg) I'm
not going to fix the kernel oops-able bugs I found in the SGTL5000
codec - someone else can do that.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.


[Bug 65963] screen goes blank, Linux hangs - Radeon 7870, Gallium, Glamor

2014-07-05 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=65963

Damian Nowak  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #4 from Damian Nowak  ---
This has recently returned.

At random points my system just hangs. Everything dies, so even no SSH
connection is possible to the machine. Today however display hung, CTRL+ALT+F1
was not usable as usual, but SSH worked. I was able to inspect dmesg (totally
nothing related to the crash) and Xorg.0.log (error message and stacktrace!).

I am sure this is a regression. I have never encountered this broblem on mesa
10.1.3 and llvm 3.4. I held these versions on my system for quite a long time
and refrained to update to the latest versions because of some problem with
Steam. (FYI https://bbs.archlinux.org/viewtopic.php?pid=1432315#p1432315)

Right after I updated to mesa 10.2.2 and llvm 3.4.2 three days ago my system
started hanging randomly from 2 to 5 times a day. I am 100% sure it's either
mesa 10.1.3 -> 10.2.2 bump or llvm 3.4 -> 3.4.2.

In the meantime I will try installing various combinations of mesa (10.1.3,
10.1.4, 10.2.0rc1-5, 10.2.1, 10.2.2) and llvm (3.4, 3.4.1, 3.4.2) to find which
package exactly triggers the problem.

Using Arch Linux 3.15.3.

(EE) [mi] EQ overflow continuing.  1000 events have been dropped.
(EE) [mi] No further overflow reports will be reported until the clog is
cleared.
(EE) 
(EE) Backtrace:
(EE) 0: /usr/bin/X (xorg_backtrace+0x56) [0x58f186]
(EE) 1: /usr/bin/X (QueuePointerEvents+0x52) [0x44e602]
(EE) 2: /usr/lib/xorg/modules/input/evdev_drv.so (0x7f27799c9000+0x60ba)
[0x7f27799cf0ba]
(EE) 3: /usr/lib/xorg/modules/input/evdev_drv.so (0x7f27799c9000+0x657d)
[0x7f27799cf57d]
(EE) 4: /usr/bin/X (0x40+0x74d18) [0x474d18]
(EE) 5: /usr/bin/X (0x40+0x9e5b9) [0x49e5b9]
(EE) 6: /usr/lib/libpthread.so.0 (0x7f2780855000+0xf4b0) [0x7f27808644b0]
(EE) 7: /usr/lib/libc.so.6 (ioctl+0x7) [0x7f277f583e47]
(EE) 8: /usr/lib/libdrm.so.2 (drmIoctl+0x28) [0x7f278064c9b8]
(EE) 9: /usr/lib/libdrm.so.2 (drmCommandWrite+0x1b) [0x7f278064ec2b]
(EE) 10: /usr/lib/xorg/modules/dri/radeonsi_dri.so (0x7f2778d4a000+0x69014)
[0x7f2778db3014]
(EE) 11: /usr/lib/xorg/modules/dri/radeonsi_dri.so (0x7f2778d4a000+0x6a3c2)
[0x7f2778db43c2]
(EE) 12: /usr/lib/xorg/modules/dri/radeonsi_dri.so (0x7f2778d4a000+0x5d431)
[0x7f2778da7431]
(EE) 13: /usr/lib/xorg/modules/dri/radeonsi_dri.so (0x7f2778d4a000+0x19f0f9)
[0x7f2778ee90f9]
(EE) 14: /usr/lib/xorg/modules/dri/radeonsi_dri.so (0x7f2778d4a000+0x11e560)
[0x7f2778e68560]
(EE) 15: /usr/lib/xorg/modules/dri/radeonsi_dri.so (0x7f2778d4a000+0x1a14a5)
[0x7f2778eeb4a5]
(EE) 16: /usr/lib/xorg/modules/dri/radeonsi_dri.so (0x7f2778d4a000+0x11f674)
[0x7f2778e69674]
(EE) 17: /usr/lib/xorg/modules/dri/radeonsi_dri.so (0x7f2778d4a000+0x11f8d2)
[0x7f2778e698d2]
(EE) 18: /usr/lib/libglamor.so.0 (0x7f277d11d000+0x2071b) [0x7f277d13d71b]
(EE) 19: /usr/lib/libglamor.so.0 (0x7f277d11d000+0x20ac8) [0x7f277d13dac8]
(EE) 20: /usr/lib/libglamor.so.0 (0x7f277d11d000+0x1ccab) [0x7f277d139cab]
(EE) 21: /usr/bin/X (0x40+0x17fad8) [0x57fad8]
(EE) 22: /usr/bin/X (0x40+0xc40da) [0x4c40da]
(EE) 23: /usr/bin/X (0x40+0x33cdb) [0x433cdb]
(EE) 24: /usr/bin/X (0x40+0x36b2f) [0x436b2f]
(EE) 25: /usr/bin/X (0x40+0x3ad16) [0x43ad16]
(EE) 26: /usr/lib/libc.so.6 (__libc_start_main+0xf0) [0x7f277f4c2000]
(EE) 27: /usr/bin/X (0x40+0x250fe) [0x4250fe]

-- 
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/20140705/20f1ec56/attachment-0001.html>


[Bug 65963] screen goes blank, Linux hangs - Radeon 7870, Gallium, Glamor

2014-07-05 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=65963

--- Comment #5 from Damian Nowak  ---
Created attachment 102301
  --> https://bugs.freedesktop.org/attachment.cgi?id=102301&action=edit
Xorg.0.log

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


[Bug 79011] GPU lockup, screen freeze with Radeon HD7770

2014-07-05 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=79011

--- Comment #14 from Thue Kristensen  ---
I have the same problem, and turning the screen off and on doesn't work. The
computer is completely frozen. (sysrq-boot does work)

Rarely when changing resolution (like during boot), the screen says "signal out
of range", but turning the screen off and on does help then. I believe that is
a separate bug.

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


[PATCH RFC 06/15] drm/armada: move variant initialisation to CRTC init

2014-07-05 Thread Sebastian Hesselbarth
On 07/05/2014 12:38 PM, Russell King wrote:
> Move the variant initialisation entirely to the CRTC init function -
> the variant support is really about the CRTC properties than the whole
> system, and we want to treat each CRTC individually when we support DT.
> 
> Signed-off-by: Russell King 
> ---
[...]
> diff --git a/drivers/gpu/drm/armada/armada_crtc.h 
> b/drivers/gpu/drm/armada/armada_crtc.h
> index 531a9b0bdcfb..3f0e70bb2e9c 100644
> --- a/drivers/gpu/drm/armada/armada_crtc.h
> +++ b/drivers/gpu/drm/armada/armada_crtc.h
> @@ -38,6 +38,7 @@ struct armada_crtc {
>   unsignednum;
>   void __iomem*base;
>   struct clk  *clk;
> + struct clk  *extclk[2];

Russell,

I wonder, if we should rename above array srcclk instead of extclk
while moving it anyway. That way we can use it for the other variant
specific clocks, too.

FWIW, I totally agree the it was the right thing to wait for you
to sort out the dependencies. Good work, great patience.

Sebastian



[PATCH 1/2 v2] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup()

2014-07-05 Thread Bjorn Helgaas
On Wed, Jun 25, 2014 at 12:55:01AM +0200, Bruno Pr?mont wrote:
> With commit b4aa0163056b ("efifb: Implement vga_default_device() (v2)")
> Matthew Garrett introduced a efifb vga_default_device() so that EFI
> systems that do not load shadow VBIOS or setup VGA get proper value for
> boot_vga PCI sysfs attribute on the corresponding PCI device.
> 
> Xorg is refusing to detect devices when boot_vga=0 which is the case on
> some EFI system (e.g. MacBookAir2,1). Xorg detects the GPU and finds
> the dri device but then bails out with "no devices detected".
> 
> Note: When vga_default_device() is set boot_vga PCI sysfs attribute
> reflects its state. When unset this attribute is 1 whenever
> IORESOURCE_ROM_SHADOW flag is set.
> 
> With introduction of sysfb/simplefb/simpledrm efifb is getting obsolete
> while having native drivers for the GPU also makes selecting
> sysfb/efifb optional.
> 
> Remove the efifb implementation of vga_default_device() and initialize
> vgaarb's vga_default_device() with the PCI GPU that matches boot
> screen_info in pci_fixup_video().
> 
> Tested-by: Anibal Francisco Martinez Cortina 
> Cc: Matthew Garrett 
> Cc: stable at vger.kernel.org
> Signed-off-by: Bruno Pr?mont 

I applied both with Matthew's ack to pci/misc for v3.17, thanks!

> ---
> 
> Changes since v1:
>   Added Tested-by, Cc
> 
>  arch/ia64/pci/fixup.c   | 21 +
>  arch/x86/include/asm/vga.h  |  6 --
>  arch/x86/pci/fixup.c| 21 +
>  drivers/video/fbdev/efifb.c | 38 --
>  4 files changed, 42 insertions(+), 44 deletions(-)
> 
> diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
> index eee069a..9ed5bef 100644
> --- a/arch/ia64/pci/fixup.c
> +++ b/arch/ia64/pci/fixup.c
> @@ -37,6 +37,27 @@ static void pci_fixup_video(struct pci_dev *pdev)
>   return;
>   /* Maybe, this machine supports legacy memory map. */
>  
> + if (!vga_default_device()) {
> + resource_size_t start, end;
> + int i;
> +
> + /* Does firmware framebuffer belong to us? */
> + for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
> + if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
> + continue;
> +
> + start = pci_resource_start(pdev, i);
> + end  = pci_resource_end(pdev, i);
> +
> + if (!start || !end)
> + continue;
> +
> + if (screen_info.lfb_base >= start &&
> + (screen_info.lfb_base + screen_info.lfb_size) < 
> end)
> + vga_set_default_device(pdev);
> + }
> + }
> +
>   /* Is VGA routed to us? */
>   bus = pdev->bus;
>   while (bus) {
> diff --git a/arch/x86/include/asm/vga.h b/arch/x86/include/asm/vga.h
> index 44282fb..c4b9dc2 100644
> --- a/arch/x86/include/asm/vga.h
> +++ b/arch/x86/include/asm/vga.h
> @@ -17,10 +17,4 @@
>  #define vga_readb(x) (*(x))
>  #define vga_writeb(x, y) (*(y) = (x))
>  
> -#ifdef CONFIG_FB_EFI
> -#define __ARCH_HAS_VGA_DEFAULT_DEVICE
> -extern struct pci_dev *vga_default_device(void);
> -extern void vga_set_default_device(struct pci_dev *pdev);
> -#endif
> -
>  #endif /* _ASM_X86_VGA_H */
> diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
> index 94ae9ae..7246cf2 100644
> --- a/arch/x86/pci/fixup.c
> +++ b/arch/x86/pci/fixup.c
> @@ -325,6 +325,27 @@ static void pci_fixup_video(struct pci_dev *pdev)
>   struct pci_bus *bus;
>   u16 config;
>  
> + if (!vga_default_device()) {
> + resource_size_t start, end;
> + int i;
> +
> + /* Does firmware framebuffer belong to us? */
> + for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
> + if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
> + continue;
> +
> + start = pci_resource_start(pdev, i);
> + end  = pci_resource_end(pdev, i);
> +
> + if (!start || !end)
> + continue;
> +
> + if (screen_info.lfb_base >= start &&
> + (screen_info.lfb_base + screen_info.lfb_size) < 
> end)
> + vga_set_default_device(pdev);
> + }
> + }
> +
>   /* Is VGA routed to us? */
>   bus = pdev->bus;
>   while (bus) {
> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
> index ae9618f..a033180 100644
> --- a/drivers/video/fbdev/efifb.c
> +++ b/drivers/video/fbdev/efifb.c
> @@ -19,8 +19,6 @@
>  
>  static bool request_mem_succeeded = false;
>  
> -static struct pci_dev *default_vga;
> -
>  static struct fb_var_screeninfo efifb_defined = {
>   .activate   = FB_ACTIVATE_NOW,
>   .height = -1,
> @@ -84,18 +82,6 @@ static struct fb_ops efifb_ops = {
>   .fb_imagebl

[git pull] drm fixes

2014-07-05 Thread Dave Airlie

Hi Linus,

i915, tda998x and vmwgfx fixes, the main one is i915 fix for missing VGA 
connectors, along with some fixes for the tda998x from Russell fixing some 
modesetting problems.

(still on holidays, but got a spare moment to find these).

Dave.

The following changes since commit e1a08b855f56d6528e7f85aae9ca8123f4c3ae04:

  Merge tag 'arm64-fixes' of 
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux (2014-07-05 10:12:52 
-0700)

are available in the git repository at:


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

for you to fetch changes up to dfd7aecfd6d227831d77719379d4c7137f444fee:

  Merge tag 'drm-intel-fixes-2014-07-03' of 
git://anongit.freedesktop.org/drm-intel (2014-07-06 07:49:59 +1000)



Dave Airlie (3):
  Merge branch 'tda998x-fixes' of 
git://ftp.arm.linux.org.uk/~rmk/linux-cubox
  Merge branch 'vmwgfx-fixes-3.16' of 
git://people.freedesktop.org/~thomash/linux
  Merge tag 'drm-intel-fixes-2014-07-03' of 
git://anongit.freedesktop.org/drm-intel

Deepak S (1):
  drm/i915: Drop early VLV WA to fix Voltage not getting dropped to Vmin

Guido Mart?nez (1):
  drm/i2c: tda998x: move drm_i2c_encoder_destroy call

Jesse Barnes (1):
  drm/i915: only apply crt_present check on VLV

Russell King (2):
  drm/i2c: tda998x: faster polling for edid
  drm/i2c: tda998x: add some basic mode validation

Thomas Hellstrom (1):
  drm/vmwgfx: Fix incorrect write to read-only register v2:

Ville Syrj?l? (1):
  drm/i915: Wait for vblank after enabling the primary plane on BDW

 drivers/gpu/drm/i2c/tda998x_drv.c| 12 +---
 drivers/gpu/drm/i915/intel_display.c | 27 ++-
 drivers/gpu/drm/i915/intel_pm.c  |  8 
 drivers/gpu/drm/i915/intel_sprite.c  |  8 
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c   |  1 -
 5 files changed, 51 insertions(+), 5 deletions(-)


[git pull] drm fixes

2014-07-05 Thread Ed Tomlinson
Hi Dave,

This is NOT fixing problems with a stalled boot due to VGA problems as
reported in thread: [PATCH 5/5] drm/i915: Kick out vga console
It can be fixed by reverting: a4de05268e674e8ed31df6348269e22d6c6a1803
or applying the patch from Chris Wilson which can be found as a reply to my 
report.

Thanks
Ed Tomlinson

On Saturday 05 July 2014 23:13:27 Dave Airlie wrote:
> 
> Hi Linus,
> 
> i915, tda998x and vmwgfx fixes, the main one is i915 fix for missing VGA 
> connectors, along with some fixes for the tda998x from Russell fixing some 
> modesetting problems
> 
> (still on holidays, but got a spare moment to find these).
> 
> Dave.
> 
> The following changes since commit e1a08b855f56d6528e7f85aae9ca8123f4c3ae04:
> 
>   Merge tag 'arm64-fixes' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux (2014-07-05 
> 10:12:52 -0700)
> 
> are available in the git repository at:
> 
> 
>   git://people.freedesktop.org/~airlied/linux drm-fixes
> 
> for you to fetch changes up to dfd7aecfd6d227831d77719379d4c7137f444fee:
> 
>   Merge tag 'drm-intel-fixes-2014-07-03' of 
> git://anongit.freedesktop.org/drm-intel (2014-07-06 07:49:59 +1000)
> 
> 
> 
> Dave Airlie (3):
>   Merge branch 'tda998x-fixes' of 
> git://ftp.arm.linux.org.uk/~rmk/linux-cubox
>   Merge branch 'vmwgfx-fixes-3.16' of 
> git://people.freedesktop.org/~thomash/linux
>   Merge tag 'drm-intel-fixes-2014-07-03' of 
> git://anongit.freedesktop.org/drm-intel
> 
> Deepak S (1):
>   drm/i915: Drop early VLV WA to fix Voltage not getting dropped to Vmin
> 
> Guido Mart?nez (1):
>   drm/i2c: tda998x: move drm_i2c_encoder_destroy call
> 
> Jesse Barnes (1):
>   drm/i915: only apply crt_present check on VLV
> 
> Russell King (2):
>   drm/i2c: tda998x: faster polling for edid
>   drm/i2c: tda998x: add some basic mode validation
> 
> Thomas Hellstrom (1):
>   drm/vmwgfx: Fix incorrect write to read-only register v2:
> 
> Ville Syrj?l? (1):
>   drm/i915: Wait for vblank after enabling the primary plane on BDW
> 
>  drivers/gpu/drm/i2c/tda998x_drv.c| 12 +---
>  drivers/gpu/drm/i915/intel_display.c | 27 ++-
>  drivers/gpu/drm/i915/intel_pm.c  |  8 
>  drivers/gpu/drm/i915/intel_sprite.c  |  8 
>  drivers/gpu/drm/vmwgfx/vmwgfx_fb.c   |  1 -
>  5 files changed, 51 insertions(+), 5 deletions(-)