[PATCH] drm/i915: i2c: unconditionally set up gpio fallback

2012-02-14 Thread Daniel Vetter
This way we can simplify the setup and teardown a bit.

Because we don't actually allocate anything anymore for the force_bit
case, we can now convert that into a boolean.

Also and the functionality supported by the bit-banging together with
what gmbus can do, so that this doesn't randomly change any more.

v2: Chris Wilson noticed that I've mixed up && and & ...

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |3 +-
 drivers/gpu/drm/i915/intel_i2c.c |   50 ++---
 2 files changed, 21 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 14b6e94..31affc0 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -293,7 +293,8 @@ struct intel_fbc_work;

 struct intel_gmbus {
struct i2c_adapter adapter;
-   struct i2c_adapter *force_bit;
+   bool force_bit;
+   bool has_gpio;
u32 reg0;
u32 gpio_reg;
struct i2c_algo_bit_data bit_algo;
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 6eb68b7..5e89680 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -140,8 +140,8 @@ static void set_data(void *data, int state_high)
POSTING_READ(bus->gpio_reg);
 }

-static struct i2c_adapter *
-intel_gpio_create(struct intel_gmbus *bus, u32 pin)
+static bool
+intel_gpio_setup(struct intel_gmbus *bus, u32 pin)
 {
struct drm_i915_private *dev_priv = bus->dev_priv;
static const int map_pin_to_reg[] = {
@@ -157,7 +157,7 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
struct i2c_algo_bit_data *algo;

if (pin >= ARRAY_SIZE(map_pin_to_reg) || !map_pin_to_reg[pin])
-   return NULL;
+   return false;

algo = &bus->bit_algo;

@@ -174,12 +174,11 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
algo->timeout = usecs_to_jiffies(2200);
algo->data = bus;

-   return &bus->adapter;
+   return true;
 }

 static int
 intel_i2c_quirk_xfer(struct intel_gmbus *bus,
-struct i2c_adapter *adapter,
 struct i2c_msg *msgs,
 int num)
 {
@@ -193,7 +192,7 @@ intel_i2c_quirk_xfer(struct intel_gmbus *bus,
set_clock(bus, 1);
udelay(I2C_RISEFALL_TIME);

-   ret = i2c_bit_xfer(adapter, msgs, num);
+   ret = i2c_bit_xfer(&bus->adapter, msgs, num);

set_data(bus, 1);
set_clock(bus, 1);
@@ -216,7 +215,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
mutex_lock(&dev_priv->gmbus_mutex);

if (bus->force_bit) {
-   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
+   ret = intel_i2c_quirk_xfer(bus, msgs, num);
goto out;
}

@@ -311,11 +310,11 @@ timeout:
I915_WRITE(GMBUS0 + reg_offset, 0);

/* Hardware may not support GMBUS over these pins? Try GPIO bitbanging 
instead. */
-   bus->force_bit = intel_gpio_create(bus, bus->reg0 & 0xff);
-   if (!bus->force_bit)
-   ret = -ENOMEM;
-   else
-   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
+   ret = -EIO;
+   if (bus->has_gpio) {
+   bus->force_bit = true;
+   ret = intel_i2c_quirk_xfer(bus, msgs, num);
+   }
 out:
mutex_unlock(&dev_priv->gmbus_mutex);
return ret;
@@ -323,14 +322,8 @@ out:

 static u32 gmbus_func(struct i2c_adapter *adapter)
 {
-   struct intel_gmbus *bus = container_of(adapter,
-  struct intel_gmbus,
-  adapter);
-
-   if (bus->force_bit)
-   i2c_bit_func(bus->force_bit);
-
-   return (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
+   return i2c_bit_func(adapter) &
+   (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
/* I2C_FUNC_10BIT_ADDR | */
I2C_FUNC_SMBUS_READ_BLOCK_DATA |
I2C_FUNC_SMBUS_BLOCK_PROC_CALL);
@@ -388,8 +381,11 @@ int intel_setup_gmbus(struct drm_device *dev)
/* By default use a conservative clock rate */
bus->reg0 = i | GMBUS_RATE_100KHZ;

+   bus->has_gpio = intel_gpio_setup(bus, i);
+
/* XXX force bit banging until GMBUS is fully debugged */
-   bus->force_bit = intel_gpio_create(bus, i);
+   if (bus->has_gpio)
+   bus->force_bit = true;
}

intel_i2c_reset(dev_priv->dev);
@@ -417,16 +413,8 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, 
bool force_bit)
 {
struct intel_gmbus *bus = to_intel_gmbus(adapter);

-   if (force_bit) {
-   if (bus->force_bit == NULL) {
-   bus->force_bit = intel_gpio_create(bus,
-  bus->reg0 & 0xff);
-   }
-   } else

Re: linux-3.3-rc2 and radeon kms failure on ppc32 with Radeon X1650PRO pcie

2012-02-14 Thread Michel Dänzer
On Mit, 2012-02-15 at 13:50 +1100, Benjamin Herrenschmidt wrote: 
> On Wed, 2012-02-15 at 03:23 +0100, acrux wrote:
> > On Sun, 12 Feb 2012 11:00:43 +0100
> > Michel Dänzer  wrote:
> > 
> > > On Sam, 2012-02-11 at 21:00 +0100, acrux wrote: 
> > > > 
> > > > Just a curiosity, i've only two powerpc machines[1] equipped with PCIE
> > > > videocards and both them are not able to boot with radeonkms.
> > > > Modern PCI-E videocards are not recognized by the old linux framebuffer
> > > > subsystem and they solely can be managed by the new KMS frame buffer
> > > > that doesn't work properly on Power Architecture.
> > > 
> > > That's too broad a statement, it works fine on other PowerPC machines
> > > (PowerMacs, some embedded boards).
> > > 
> > 
> > hi Michel,
> > thanks a lot for your help, i really appreciate it.
> > 
> > If you say they were tested on real Power Architecture boards with PCIE
> > videocards thus it is reassuring... and i'm happy that you understand
> > my previus assertion wasn't affected by malevolence or sarcasm. Indeed
> > i'm also a bit troubled 'n frustrated thinking that next release of
> > mesa 'll do extend use of llvm (that doesn't work properly on linuxppc
> > and totally untested on linuxppc64)

I don't see any reason to worry yet. LLVM is still completely optional
in Mesa 8.0, and if you're worrying about the upcoming use of LLVM in
the drivers for newer Radeons, I don't think the current problems in the
LLVM usage of llvmpipe/draw on PPC will necessarily translate to that,
as I suspect at least some of the issues are specific to the LLVM PPC
backend, which won't be used in that case.


> > Btw, to sum up the list of Power Architecture machines with PCIE  that
> > aim to be a desktop/workstation: Apple iMac G5 (iSight), Apple PowerMac
> > Quad G5, YDL Powerstation 2x970MP and Acube Sam460ex . And the last
> > two, on present evidence (my attempts), aren't able to boot up if
> > bootkernel has kms enabled.
> 
> Which radeon card, kernel log please ?

See
http://lists.freedesktop.org/archives/dri-devel/2012-February/018792.html 
(start of this thread) and 
http://lists.freedesktop.org/archives/dri-devel/2012-February/018791.html .


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast |  Debian, X and DRI developer
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 27184] Radeon, KMS, 6.12.99: Sleeping screen doesn't wake up reliably

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=27184

--- Comment #22 from tomi.or...@ncircle.nullnet.fi 2012-02-14 22:49:18 PST ---
(In reply to comment #20)
> Does kernel 3.3rc3 or newer work any better?

I tested with the latest git version from yesterday evening 
(13d261932bbfff7f45f288c5c8cce43177cccd3b) and unfortunately none of the "xset 
dpms force off,
standby or suspend" worked any differently than before.
The BenQ monitor just decides to stay in power saving mode and the only way to 
wake it up is to power cycle the monitor.

There really is nothing wrong with the hardware as the fglrx is able to use 
dpms power management just fine.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 45018] [bisected] rendering regression since added support for virtual address space on cayman v11

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45018

--- Comment #15 from Alexandre Demers  2012-02-14 
22:44:50 UTC ---
I'm now running kernel 3.3-rc3 and some applications are completely freezing my 
system. I haven't seen anything special in the various logs. The only error
available is about a conflict in addresses for bo, but they are not related to 
the application that are crashing my system. Renderfeattest.bin64 and sanctuary
from unigine  are exemples of those apps. Gnome-shell is also resetting, 
freezing or crashing from time to time (the problem could come from X when 
crashing).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 45018] [bisected] rendering regression since added support for virtual address space on cayman v11

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=45018

--- Comment #15 from Alexandre Demers  
2012-02-14 22:44:50 UTC ---
I'm now running kernel 3.3-rc3 and some applications are completely freezing my 
system. I haven't seen anything special in the various logs. The only error
available is about a conflict in addresses for bo, but they are not related to 
the application that are crashing my system. Renderfeattest.bin64 and sanctuary
from unigine  are exemples of those apps. Gnome-shell is also resetting, 
freezing or crashing from time to time (the problem could come from X when 
crashing).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[PATCH 7/7] drm/i915: reenable gmbus on gen3+ again

2012-02-14 Thread Daniel Vetter
With the rework to merge the bit-banging fallback into the gmbus
i2c adapter we've gotten rid of the deadlock possibility that
originally lead to the disabling of this code.

This reverts the revert

commit 826c7e4147f902737b281e8a5a7d7aa33fd63316
Author: Jean Delvare 
Date:   Sat Jun 4 19:34:56 2011 +

Revert "drm/i915: Enable GMBUS for post-gen2 chipsets"

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=35572
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/intel_i2c.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 9791546..2ec5f0d 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -384,7 +384,7 @@ int intel_setup_gmbus(struct drm_device *dev)
bus->has_gpio = intel_gpio_setup(bus, i);

/* XXX force bit banging until GMBUS is fully debugged */
-   if (bus->has_gpio)
+   if (bus->has_gpio && IS_GEN2(dev))
bus->force_bit = true;
}

-- 
1.7.7.5



[PATCH 6/7] drm/i915: i2c: unconditionally set up gpio fallback

2012-02-14 Thread Daniel Vetter
This way we can simplify the setup and teardown a bit.

Because we don't actually allocate anything anymore for the force_bit
case, we can now convert that into a boolean.

Also and the functionality supported by the bit-banging together with
what gmbus can do, so that this doesn't randomly change any more.

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |3 +-
 drivers/gpu/drm/i915/intel_i2c.c |   50 ++---
 2 files changed, 21 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 14b6e94..31affc0 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -293,7 +293,8 @@ struct intel_fbc_work;

 struct intel_gmbus {
struct i2c_adapter adapter;
-   struct i2c_adapter *force_bit;
+   bool force_bit;
+   bool has_gpio;
u32 reg0;
u32 gpio_reg;
struct i2c_algo_bit_data bit_algo;
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 6eb68b7..9791546 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -140,8 +140,8 @@ static void set_data(void *data, int state_high)
POSTING_READ(bus->gpio_reg);
 }

-static struct i2c_adapter *
-intel_gpio_create(struct intel_gmbus *bus, u32 pin)
+static bool
+intel_gpio_setup(struct intel_gmbus *bus, u32 pin)
 {
struct drm_i915_private *dev_priv = bus->dev_priv;
static const int map_pin_to_reg[] = {
@@ -157,7 +157,7 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
struct i2c_algo_bit_data *algo;

if (pin >= ARRAY_SIZE(map_pin_to_reg) || !map_pin_to_reg[pin])
-   return NULL;
+   return false;

algo = &bus->bit_algo;

@@ -174,12 +174,11 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
algo->timeout = usecs_to_jiffies(2200);
algo->data = bus;

-   return &bus->adapter;
+   return true;
 }

 static int
 intel_i2c_quirk_xfer(struct intel_gmbus *bus,
-struct i2c_adapter *adapter,
 struct i2c_msg *msgs,
 int num)
 {
@@ -193,7 +192,7 @@ intel_i2c_quirk_xfer(struct intel_gmbus *bus,
set_clock(bus, 1);
udelay(I2C_RISEFALL_TIME);

-   ret = i2c_bit_xfer(adapter, msgs, num);
+   ret = i2c_bit_xfer(&bus->adapter, msgs, num);

set_data(bus, 1);
set_clock(bus, 1);
@@ -216,7 +215,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
mutex_lock(&dev_priv->gmbus_mutex);

if (bus->force_bit) {
-   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
+   ret = intel_i2c_quirk_xfer(bus, msgs, num);
goto out;
}

@@ -311,11 +310,11 @@ timeout:
I915_WRITE(GMBUS0 + reg_offset, 0);

/* Hardware may not support GMBUS over these pins? Try GPIO bitbanging 
instead. */
-   bus->force_bit = intel_gpio_create(bus, bus->reg0 & 0xff);
-   if (!bus->force_bit)
-   ret = -ENOMEM;
-   else
-   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
+   ret = -EIO;
+   if (bus->has_gpio) {
+   bus->force_bit = true;
+   ret = intel_i2c_quirk_xfer(bus, msgs, num);
+   }
 out:
mutex_unlock(&dev_priv->gmbus_mutex);
return ret;
@@ -323,14 +322,8 @@ out:

 static u32 gmbus_func(struct i2c_adapter *adapter)
 {
-   struct intel_gmbus *bus = container_of(adapter,
-  struct intel_gmbus,
-  adapter);
-
-   if (bus->force_bit)
-   i2c_bit_func(bus->force_bit);
-
-   return (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
+   return i2c_bit_func(adapter) &&
+   (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
/* I2C_FUNC_10BIT_ADDR | */
I2C_FUNC_SMBUS_READ_BLOCK_DATA |
I2C_FUNC_SMBUS_BLOCK_PROC_CALL);
@@ -388,8 +381,11 @@ int intel_setup_gmbus(struct drm_device *dev)
/* By default use a conservative clock rate */
bus->reg0 = i | GMBUS_RATE_100KHZ;

+   bus->has_gpio = intel_gpio_setup(bus, i);
+
/* XXX force bit banging until GMBUS is fully debugged */
-   bus->force_bit = intel_gpio_create(bus, i);
+   if (bus->has_gpio)
+   bus->force_bit = true;
}

intel_i2c_reset(dev_priv->dev);
@@ -417,16 +413,8 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, 
bool force_bit)
 {
struct intel_gmbus *bus = to_intel_gmbus(adapter);

-   if (force_bit) {
-   if (bus->force_bit == NULL) {
-   bus->force_bit = intel_gpio_create(bus,
-  bus->reg0 & 0xff);
-   }
-   } else {
-   if (bus->force_bit) {
-   

[PATCH 5/7] drm/i915: merge gmbus and gpio i2c adpater into one

2012-02-14 Thread Daniel Vetter
... and directly call the newly exported i2c bit-banging functions.

The code is still pretty convoluted because we only set up the gpio
i2c stuff when actually falling back, resulting in more complexity
than necessary. This will be fixed up in the next patch.

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |2 ++
 drivers/gpu/drm/i915/intel_i2c.c |   38 +-
 2 files changed, 7 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f137b1d..14b6e94 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -35,6 +35,7 @@
 #include "intel_ringbuffer.h"
 #include 
 #include 
+#include 
 #include 
 #include 

@@ -295,6 +296,7 @@ struct intel_gmbus {
struct i2c_adapter *force_bit;
u32 reg0;
u32 gpio_reg;
+   struct i2c_algo_bit_data bit_algo;
struct drm_i915_private *dev_priv;
 };

diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index b9f17cb..6eb68b7 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -154,29 +154,18 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
0,
GPIOF,
};
-   struct i2c_adapter *adapter;
struct i2c_algo_bit_data *algo;

if (pin >= ARRAY_SIZE(map_pin_to_reg) || !map_pin_to_reg[pin])
return NULL;

-   adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
-   if (adapter == NULL)
-   return NULL;
-
-   algo = kzalloc(sizeof(struct i2c_algo_bit_data), GFP_KERNEL);
-   if (algo == NULL)
-   goto out_adap;
+   algo = &bus->bit_algo;

bus->gpio_reg = map_pin_to_reg[pin];
if (HAS_PCH_SPLIT(dev_priv->dev))
bus->gpio_reg += PCH_GPIOA - GPIOA;

-   snprintf(adapter->name, sizeof(adapter->name),
-"i915 GPIO%c", "?BACDE?F"[pin]);
-   adapter->owner = THIS_MODULE;
-   adapter->algo_data = algo;
-   adapter->dev.parent = &dev_priv->dev->pdev->dev;
+   bus->adapter.algo_data = algo;
algo->setsda = set_data;
algo->setscl = set_clock;
algo->getsda = get_data;
@@ -185,16 +174,7 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
algo->timeout = usecs_to_jiffies(2200);
algo->data = bus;

-   if (i2c_bit_add_bus(adapter))
-   goto out_algo;
-
-   return adapter;
-
-out_algo:
-   kfree(algo);
-out_adap:
-   kfree(adapter);
-   return NULL;
+   return &bus->adapter;
 }

 static int
@@ -213,7 +193,7 @@ intel_i2c_quirk_xfer(struct intel_gmbus *bus,
set_clock(bus, 1);
udelay(I2C_RISEFALL_TIME);

-   ret = adapter->algo->master_xfer(adapter, msgs, num);
+   ret = i2c_bit_xfer(adapter, msgs, num);

set_data(bus, 1);
set_clock(bus, 1);
@@ -348,7 +328,7 @@ static u32 gmbus_func(struct i2c_adapter *adapter)
   adapter);

if (bus->force_bit)
-   bus->force_bit->algo->functionality(bus->force_bit);
+   i2c_bit_func(bus->force_bit);

return (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
/* I2C_FUNC_10BIT_ADDR | */
@@ -444,9 +424,6 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, 
bool force_bit)
}
} else {
if (bus->force_bit) {
-   i2c_del_adapter(bus->force_bit);
-   kfree(bus->force_bit->algo);
-   kfree(bus->force_bit);
bus->force_bit = NULL;
}
}
@@ -462,11 +439,6 @@ void intel_teardown_gmbus(struct drm_device *dev)

for (i = 0; i < GMBUS_NUM_PORTS; i++) {
struct intel_gmbus *bus = &dev_priv->gmbus[i];
-   if (bus->force_bit) {
-   i2c_del_adapter(bus->force_bit);
-   kfree(bus->force_bit->algo);
-   kfree(bus->force_bit);
-   }
i2c_del_adapter(&bus->adapter);
}

-- 
1.7.7.5



[PATCH 4/7] drm/i915: merge struct intel_gpio into struct intel_gmbus

2012-02-14 Thread Daniel Vetter
When we set up the gpio fallback, we always have a 1:1 relationship
with an intel_gmbus. Exploit that to store all gpio related data in
there, too. This is a preparation step to merge the tw i2c adapters
controlling the same bus into one.

Just mundane code-munging in this patch.

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |1 +
 drivers/gpu/drm/i915/intel_i2c.c |  144 +++---
 2 files changed, 72 insertions(+), 73 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ed40743..f137b1d 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -294,6 +294,7 @@ struct intel_gmbus {
struct i2c_adapter adapter;
struct i2c_adapter *force_bit;
u32 reg0;
+   u32 gpio_reg;
struct drm_i915_private *dev_priv;
 };

diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index f496510..b9f17cb 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -45,13 +45,6 @@ to_intel_gmbus(struct i2c_adapter *i2c)
return container_of(i2c, struct intel_gmbus, adapter);
 }

-struct intel_gpio {
-   struct i2c_adapter adapter;
-   struct i2c_algo_bit_data algo;
-   struct drm_i915_private *dev_priv;
-   u32 reg;
-};
-
 void
 intel_i2c_reset(struct drm_device *dev)
 {
@@ -78,15 +71,15 @@ static void intel_i2c_quirk_set(struct drm_i915_private 
*dev_priv, bool enable)
I915_WRITE(DSPCLK_GATE_D, val);
 }

-static u32 get_reserved(struct intel_gpio *gpio)
+static u32 get_reserved(struct intel_gmbus *bus)
 {
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
struct drm_device *dev = dev_priv->dev;
u32 reserved = 0;

/* On most chips, these bits must be preserved in software. */
if (!IS_I830(dev) && !IS_845G(dev))
-   reserved = I915_READ_NOTRACE(gpio->reg) &
+   reserved = I915_READ_NOTRACE(bus->gpio_reg) &
 (GPIO_DATA_PULLUP_DISABLE |
  GPIO_CLOCK_PULLUP_DISABLE);

@@ -95,29 +88,29 @@ static u32 get_reserved(struct intel_gpio *gpio)

 static int get_clock(void *data)
 {
-   struct intel_gpio *gpio = data;
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
-   u32 reserved = get_reserved(gpio);
-   I915_WRITE_NOTRACE(gpio->reg, reserved | GPIO_CLOCK_DIR_MASK);
-   I915_WRITE_NOTRACE(gpio->reg, reserved);
-   return (I915_READ_NOTRACE(gpio->reg) & GPIO_CLOCK_VAL_IN) != 0;
+   struct intel_gmbus *bus = data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
+   u32 reserved = get_reserved(bus);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved | GPIO_CLOCK_DIR_MASK);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved);
+   return (I915_READ_NOTRACE(bus->gpio_reg) & GPIO_CLOCK_VAL_IN) != 0;
 }

 static int get_data(void *data)
 {
-   struct intel_gpio *gpio = data;
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
-   u32 reserved = get_reserved(gpio);
-   I915_WRITE_NOTRACE(gpio->reg, reserved | GPIO_DATA_DIR_MASK);
-   I915_WRITE_NOTRACE(gpio->reg, reserved);
-   return (I915_READ_NOTRACE(gpio->reg) & GPIO_DATA_VAL_IN) != 0;
+   struct intel_gmbus *bus = data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
+   u32 reserved = get_reserved(bus);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved | GPIO_DATA_DIR_MASK);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved);
+   return (I915_READ_NOTRACE(bus->gpio_reg) & GPIO_DATA_VAL_IN) != 0;
 }

 static void set_clock(void *data, int state_high)
 {
-   struct intel_gpio *gpio = data;
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
-   u32 reserved = get_reserved(gpio);
+   struct intel_gmbus *bus = data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
+   u32 reserved = get_reserved(bus);
u32 clock_bits;

if (state_high)
@@ -126,15 +119,15 @@ static void set_clock(void *data, int state_high)
clock_bits = GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_DIR_MASK |
GPIO_CLOCK_VAL_MASK;

-   I915_WRITE_NOTRACE(gpio->reg, reserved | clock_bits);
-   POSTING_READ(gpio->reg);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved | clock_bits);
+   POSTING_READ(bus->gpio_reg);
 }

 static void set_data(void *data, int state_high)
 {
-   struct intel_gpio *gpio = data;
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
-   u32 reserved = get_reserved(gpio);
+   struct intel_gmbus *bus = data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
+   u32 reserved = get_reserved(bus);
u32 data_bits;

if (state_high)
@@ -143,13 +136,14 @@ static void set_data(void *data, int state_high)
data_bit

[PATCH 3/7] i2c: export bit-banging algo functions

2012-02-14 Thread Daniel Vetter
i915 has a hw i2c controller (gmbus) but for a bunch of stupid reasons
we need to be able to fall back to the bit-banging algo on gpio pins.

The current code sets up a 2nd i2c controller for the same i2c bus using
the bit-banging algo. This has a bunch of issues, the major one being
that userspace can directly access this fallback i2c adaptor behind
the drivers back.

But we need to frob a few registers before and after using fallback
gpio bit-banging, so this horribly fails.

The new plan is to only set up one i2c adaptor and transparently fall
back to bit-banging by directly calling the xfer function of the bit-
banging algo in the i2c core.

To make that possible, export the 2 i2c algo functions.

Signed-off-by: Daniel Vetter 
---
 drivers/i2c/algos/i2c-algo-bit.c |   12 +++-
 include/linux/i2c-algo-bit.h |4 
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index 525c734..ec1651a 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -531,8 +531,8 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, 
struct i2c_msg *msg)
return 0;
 }

-static int bit_xfer(struct i2c_adapter *i2c_adap,
-   struct i2c_msg msgs[], int num)
+int i2c_bit_xfer(struct i2c_adapter *i2c_adap,
+struct i2c_msg msgs[], int num)
 {
struct i2c_msg *pmsg;
struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
@@ -598,21 +598,23 @@ bailout:
adap->post_xfer(i2c_adap);
return ret;
 }
+EXPORT_SYMBOL(i2c_bit_xfer);

-static u32 bit_func(struct i2c_adapter *adap)
+u32 i2c_bit_func(struct i2c_adapter *adap)
 {
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
   I2C_FUNC_SMBUS_READ_BLOCK_DATA |
   I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
   I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
 }
+EXPORT_SYMBOL(i2c_bit_func);


 /* -exported algorithm data: - */

 static const struct i2c_algorithm i2c_bit_algo = {
-   .master_xfer= bit_xfer,
-   .functionality  = bit_func,
+   .master_xfer= i2c_bit_xfer,
+   .functionality  = i2c_bit_func,
 };

 /*
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h
index 4f98148..cdd6336 100644
--- a/include/linux/i2c-algo-bit.h
+++ b/include/linux/i2c-algo-bit.h
@@ -47,6 +47,10 @@ struct i2c_algo_bit_data {
int timeout;/* in jiffies */
 };

+int i2c_bit_xfer(struct i2c_adapter *i2c_adap,
+struct i2c_msg msgs[], int num);
+u32 i2c_bit_func(struct i2c_adapter *adap);
+
 int i2c_bit_add_bus(struct i2c_adapter *);
 int i2c_bit_add_numbered_bus(struct i2c_adapter *);

-- 
1.7.7.5



[PATCH 2/7] drm/nouveau: do a better job at hiding the NIH i2c bit-banging algo

2012-02-14 Thread Daniel Vetter
I'd like to export the corresponding functions from the i2c core
so that I can use them in fallback bit-banging in i915.ko

Cc: nouveau at lists.freedesktop.org
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/nouveau/nouveau_i2c.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c 
b/drivers/gpu/drm/nouveau/nouveau_i2c.c
index 820ae7f..7a7e751 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.c
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c
@@ -242,7 +242,7 @@ i2c_addr(struct nouveau_i2c_chan *port, struct i2c_msg *msg)
 }

 static int
-i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+nouveau_i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 {
struct nouveau_i2c_chan *port = (struct nouveau_i2c_chan *)adap;
struct i2c_msg *msg = msgs;
@@ -272,14 +272,14 @@ i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg 
*msgs, int num)
 }

 static u32
-i2c_bit_func(struct i2c_adapter *adap)
+nouveau_i2c_bit_func(struct i2c_adapter *adap)
 {
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
 }

 const struct i2c_algorithm i2c_bit_algo = {
-   .master_xfer = i2c_bit_xfer,
-   .functionality = i2c_bit_func
+   .master_xfer = nouveau_i2c_bit_xfer,
+   .functionality = nouveau_i2c_bit_func
 };

 static const uint32_t nv50_i2c_port[] = {
-- 
1.7.7.5



[PATCH 1/7] drm/i915: add dev_priv to intel_gmbus

2012-02-14 Thread Daniel Vetter
This way we can free up the bus->adaptor.algo_data pointer and make it
available for use with the bitbanging fallback algo.

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |   13 -
 drivers/gpu/drm/i915/intel_i2c.c |6 +++---
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8e3eb5e..ed40743 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -290,6 +290,13 @@ enum intel_pch {
 struct intel_fbdev;
 struct intel_fbc_work;

+struct intel_gmbus {
+   struct i2c_adapter adapter;
+   struct i2c_adapter *force_bit;
+   u32 reg0;
+   struct drm_i915_private *dev_priv;
+};
+
 typedef struct drm_i915_private {
struct drm_device *dev;

@@ -307,11 +314,7 @@ typedef struct drm_i915_private {
/** gt_lock is also taken in irq contexts. */
struct spinlock gt_lock;

-   struct intel_gmbus {
-   struct i2c_adapter adapter;
-   struct i2c_adapter *force_bit;
-   u32 reg0;
-   } *gmbus;
+   struct intel_gmbus *gmbus;

/** gmbus_mutex protects against concurrent usage of the single hw gmbus
 * controller on different i2c buses. */
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index fc75d71..f496510 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -232,7 +232,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
struct intel_gmbus *bus = container_of(adapter,
   struct intel_gmbus,
   adapter);
-   struct drm_i915_private *dev_priv = adapter->algo_data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
int i, reg_offset, ret;

mutex_lock(&dev_priv->gmbus_mutex);
@@ -401,7 +401,7 @@ int intel_setup_gmbus(struct drm_device *dev)
 names[i]);

bus->adapter.dev.parent = &dev->pdev->dev;
-   bus->adapter.algo_data  = dev_priv;
+   bus->dev_priv = dev_priv;

bus->adapter.algo = &gmbus_algorithm;
ret = i2c_add_adapter(&bus->adapter);
@@ -442,7 +442,7 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, 
bool force_bit)

if (force_bit) {
if (bus->force_bit == NULL) {
-   struct drm_i915_private *dev_priv = adapter->algo_data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
bus->force_bit = intel_gpio_create(dev_priv,
   bus->reg0 & 0xff);
}
-- 
1.7.7.5



[PATCH 6/7] drm/i915: i2c: unconditionally set up gpio fallback

2012-02-14 Thread Eugeni Dodonov
On Tue, Feb 14, 2012 at 19:37, Daniel Vetter  wrote:

>/* Hardware may not support GMBUS over these pins? Try GPIO
> bitbanging instead. */
> -   bus->force_bit = intel_gpio_create(bus, bus->reg0 & 0xff);
> -   if (!bus->force_bit)
> -   ret = -ENOMEM;
> -   else
> -   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
> +   ret = -EIO;
> +   if (bus->has_gpio) {
> +   bus->force_bit = true;
> +   ret = intel_i2c_quirk_xfer(bus, msgs, num);
> +   }
>


Wouldn't it be cleaner and more consistent with the rest of the code to use:

if (!bus->has_gpio)
ret = -EIO;
else {
bus->force_bit = true;
ret = intel_i2c_quirk_xfer(bus, msgs, num);
}

instead?


Other than that, it looks correct to me, and certainly makes code more
clean.

Reviewed-by: Eugeni Dodonov 

-- 
Eugeni Dodonov
<http://eugeni.dodonov.net/>
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20120214/a59f3d5e/attachment.htm>


[Bug 45880] Xorg crash with ColorTiling2D patch (r600g)

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=45880

--- Comment #3 from Jerome Glisse  2012-02-14 
12:54:39 PST ---
I pushed a fix please confirm that it also works for you

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[Bug 27184] Radeon, KMS, 6.12.99: Sleeping screen doesn't wake up reliably

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=27184

--- Comment #21 from Oliver Winker  2012-02-14 
12:36:44 PST ---
Hi,

Just for info: in my case, since quite some time using 3.1 and 3.2 (and on 
debian xorg 7.6+11, radeon 6.14.3-2) the screen wake-up works quite reliable 
now,
without the xset dpms workaround.

I kept postponing to give an update on this on - sorry. Anyway, it looks better 
here in the meanwhile ;).

BR, Oliver

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[Bug 46004] [r300g, bisected] piglit glsl-fs-discard-02 fails

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=46004

--- Comment #5 from Tom Stellard  2012-02-14 19:38:21 PST 
---
I'm guessing that this is a bug in the vertex shader.  Does running with 
RADEON_NO_TCL=1 fix it?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 27184] Radeon, KMS, 6.12.99: Sleeping screen doesn't wake up reliably

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=27184

--- Comment #20 from Alex Deucher  2012-02-14 11:07:38 PST 
---
Does kernel 3.3rc3 or newer work any better?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


Re: linux-3.3-rc2 and radeon kms failure on ppc32 with Radeon X1650PRO pcie

2012-02-14 Thread Benjamin Herrenschmidt
On Wed, 2012-02-15 at 03:23 +0100, acrux wrote:
> On Sun, 12 Feb 2012 11:00:43 +0100
> Michel Dänzer  wrote:
> 
> > On Sam, 2012-02-11 at 21:00 +0100, acrux wrote: 
> > > 
> > > Just a curiosity, i've only two powerpc machines[1] equipped with PCIE
> > > videocards and both them are not able to boot with radeonkms.
> > > Modern PCI-E videocards are not recognized by the old linux framebuffer
> > > subsystem and they solely can be managed by the new KMS frame buffer
> > > that doesn't work properly on Power Architecture.
> > 
> > That's too broad a statement, it works fine on other PowerPC machines
> > (PowerMacs, some embedded boards).
> > 
> 
> hi Michel,
> thanks a lot for your help, i really appreciate it.
> 
> If you say they were tested on real Power Architecture boards with PCIE
> videocards thus it is reassuring... and i'm happy that you understand
> my previus assertion wasn't affected by malevolence or sarcasm. Indeed
> i'm also a bit troubled 'n frustrated thinking that next release of
> mesa 'll do extend use of llvm (that doesn't work properly on linuxppc
> and totally untested on linuxppc64)
> 
> Btw, to sum up the list of Power Architecture machines with PCIE  that
> aim to be a desktop/workstation: Apple iMac G5 (iSight), Apple PowerMac
> Quad G5, YDL Powerstation 2x970MP and Acube Sam460ex . And the last
> two, on present evidence (my attempts), aren't able to boot up if
> bootkernel has kms enabled.

Which radeon card, kernel log please ? I've successfully booted various
reasonably modern radeons on these. I've also used gnome3 with GL
acceleration etc... on some of these. Granted that was a few month ago
so it's possible that something regressed.

>  Furthermore the first tree ones can
> fallback to the legacy OpenFirmware framebuffer and safely get a
> console.
> 
> > It looks like there's a problem with accessing the PCIe device memory,
> > and at this point it's not even 100% clear that this is due to a problem
> > in the driver, as opposed to e.g. in the platform code.
> > 
> 
> it could be the right problem and i've CC BenH that has a better global
> perspective.

Can you give me more data about the problem please ? It could be a
recent regression or some setup problem.

Also I've noticed on the PowerStation some issues where heavy DMA use by
a video card will eventually lock up the system. From what I can tell
this is an issue with the northbridge, though a Quad G5 with the same
bridge (tho not quite the same revision) doesn't show the problem. Could
be a configuration issue.

Cheers,
Ben.



___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/exynos: exynos_drm.h header file fixes

2012-02-14 Thread Inki Dae
Hi, Kamil.
Sorry. our patch has no problem and this is my mistake. so your patch has
been merged to our git repository.

Thanks.

> -Original Message-
> From: Inki Dae [mailto:inki.dae at samsung.com]
> Sent: Tuesday, February 14, 2012 5:58 PM
> To: 'Kamil Debski'; 'dri-devel at lists.freedesktop.org'
> Cc: 'kyungmin.park at samsung.com'; 'jy0922.shim at samsung.com';
> 'sw0312.kim at samsung.com'; 'airlied at linux.ie'
> Subject: RE: [PATCH] drm/exynos: exynos_drm.h header file fixes
> 
> Hi, Kamil.
> Sorry for being late.
> 
> Below is my comments.
> 
> > -Original Message-
> > From: Kamil Debski [mailto:k.debski at samsung.com]
> > Sent: Saturday, February 11, 2012 2:32 AM
> > To: dri-devel at lists.freedesktop.org
> > Cc: kyungmin.park at samsung.com; inki.dae at samsung.com;
> > jy0922.shim at samsung.com; sw0312.kim at samsung.com; airlied at linux.ie; 
> > Kamil
> > Debski
> > Subject: [PATCH] drm/exynos: exynos_drm.h header file fixes
> >
> > First of all #ifdef __KERNEL__ was added to exynos_drm.h to
> > mark the part that should be left out of userspace.
> > Secondly exynos_drm.h was added to include/drm/Kbuild, so it
> > will be included when doing make headers_install.
> >
> > Signed-off-by: Kamil Debski 
> > Signed-off-by: Kyungmin Park 
> > ---
> >  include/drm/Kbuild   |1 +
> >  include/drm/exynos_drm.h |5 +++--
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/drm/Kbuild b/include/drm/Kbuild
> > index a5c0e10..1e38a19 100644
> > --- a/include/drm/Kbuild
> > +++ b/include/drm/Kbuild
> > @@ -2,6 +2,7 @@ header-y += drm.h
> >  header-y += drm_fourcc.h
> >  header-y += drm_mode.h
> >  header-y += drm_sarea.h
> > +header-y += exynos_drm.h
> >  header-y += i810_drm.h
> >  header-y += i915_drm.h
> >  header-y += mga_drm.h
> > diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
> > index 13b8660..5900e0b 100644
> > --- a/include/drm/exynos_drm.h
> > +++ b/include/drm/exynos_drm.h
> > @@ -99,6 +99,7 @@ struct drm_exynos_plane_set_zpos {
> >  #define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOSDRM_IOWR(DRM_COMMAND_BASE +
> > \
> > DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos)
> >
> > +#ifdef __KERNEL__
> 
> could you please modify it for this macro to be place above of struct
> exynos_drm_panel_info? struct exynos_drm_panel_info also isn't needed for
> user side.
> 
> Thanks.
> 
> >  /**
> >   * Platform Specific Structure for DRM based FIMD.
> >   *
> > @@ -140,5 +141,5 @@ struct exynos_drm_hdmi_pdata {
> > unsigned intdefault_win;
> > unsigned intbpp;
> >  };
> > -
> > -#endif
> > +#endif /* __KERNEL__ */
> > +#endif /* _EXYNOS_DRM_H_ */
> > --
> > 1.7.0.4



[Bug 27184] Radeon, KMS, 6.12.99: Sleeping screen doesn't wake up reliably

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=27184

--- Comment #19 from tomi.orava at ncircle.nullnet.fi 2012-02-14 10:43:41 PST 
---
Sorry about the disappearence for a long time. I thought I had enabled the 
notifications for this bug.

It seems that I still have this very same problem even with kernel.org 3.2.5 
kernel. The previously mentioned workaround "xset dpms 0 240 0" that helped
someone, did not work in my setup at all.

In case the following debug info helps at all:

get-edid | parse-edid
get-edid: get-edid version 2.0.0

Performing real mode VBE call
Interrupt 0x10 ax=0x4f00 bx=0x0 cx=0x0
Function supported
Call successful

VBE version 300
VBE string at 0xc0204 "ATI ATOMBIOS"

VBE/DDC service about to be called
Report DDC capabilities

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x0 cx=0x0
Function supported
Call successful

Monitor and video card combination does not support DDC1 transfers
Monitor and video card combination supports DDC2 transfers
0 seconds per 128 byte EDID block transfer
Screen is not blanked during DDC transfer

Reading next EDID block

VBE/DDC service about to be called
Read EDID

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x1 cx=0x0
[/pub/linux/kernel]
alderan#root>get-edid | parse-edid 2>&1 
get-edid: get-edid version 2.0.0

Performing real mode VBE call
Interrupt 0x10 ax=0x4f00 bx=0x0 cx=0x0
Function supported
Call successful

VBE version 300
VBE string at 0xc0204 "ATI ATOMBIOS"

VBE/DDC service about to be called
Report DDC capabilities

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x0 cx=0x0
Function supported
Call successful

Monitor and video card combination does not support DDC1 transfers
Monitor and video card combination supports DDC2 transfers
0 seconds per 128 byte EDID block transfer
Screen is not blanked during DDC transfer

Reading next EDID block

VBE/DDC service about to be called
Read EDID

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x1 cx=0x0
parse-edid: parse-edid version 2.0.0
Function supported
Call successful

parse-edid: EDID checksum passed.

# EDID version 1 revision 3
Section "Monitor"
# Block type: 2:0 3:ff
# Block type: 2:0 3:fd
# Block type: 2:0 3:fc
Identifier "BenQ G2400W"
VendorName "BNQ"
ModelName "BenQ G2400W"
# Block type: 2:0 3:ff
# Block type: 2:0 3:fd
HorizSync 31-94
VertRefresh 50-85
# Max dot clock (video bandwidth) 170 MHz
# Block type: 2:0 3:fc
# DPMS capabilities: Active off:yes  Suspend:no  Standby:no

Mode "1920x1200"# vfreq 59.950Hz, hfreq 74.038kHz
DotClock154.00
HTimings1920 1968 2000 2080
VTimings1200 1203 1209 1235
Flags"-HSync" "+VSync"
EndMode
# Block type: 2:0 3:ff
# Block type: 2:0 3:fd
# Block type: 2:0 3:fc
EndSection

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[RESEND][PATCH 9/9] drm/exynos: exynos_drm.h header file fixes

2012-02-14 Thread Inki Dae
From: Kamil Debski 

First of all #ifdef __KERNEL__ was added to exynos_drm.h to
mark the part that should be left out of userspace.
Secondly exynos_drm.h was added to include/drm/Kbuild, so it
will be included when doing make headers_install.

Signed-off-by: Kamil Debski 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 include/drm/Kbuild   |1 +
 include/drm/exynos_drm.h |5 -
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/drm/Kbuild b/include/drm/Kbuild
index a5c0e10..1e38a19 100644
--- a/include/drm/Kbuild
+++ b/include/drm/Kbuild
@@ -2,6 +2,7 @@ header-y += drm.h
 header-y += drm_fourcc.h
 header-y += drm_mode.h
 header-y += drm_sarea.h
+header-y += exynos_drm.h
 header-y += i810_drm.h
 header-y += i915_drm.h
 header-y += mga_drm.h
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
index 308575e..1ed3aae 100644
--- a/include/drm/exynos_drm.h
+++ b/include/drm/exynos_drm.h
@@ -97,6 +97,8 @@ struct drm_exynos_plane_set_zpos {
 #define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOSDRM_IOWR(DRM_COMMAND_BASE + \
DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos)
 
+#ifdef __KERNEL__
+
 /**
  * A structure for lcd panel information.
  *
@@ -152,4 +154,5 @@ struct exynos_drm_hdmi_pdata {
unsigned intbpp;
 };
 
-#endif
+#endif /* __KERNEL__ */
+#endif /* _EXYNOS_DRM_H_ */
-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[RESEND][PATCH 7/9] drm/exynos: added postclose to release resource.

2012-02-14 Thread Inki Dae
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 76a111f..58820eb 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -151,6 +151,17 @@ static void exynos_drm_preclose(struct drm_device *dev,
 
 }
 
+static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
+{
+   DRM_DEBUG_DRIVER("%s\n", __FILE__);
+
+   if (!file->driver_priv)
+   return;
+
+   kfree(file->driver_priv);
+   file->driver_priv = NULL;
+}
+
 static void exynos_drm_lastclose(struct drm_device *dev)
 {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
@@ -193,6 +204,7 @@ static struct drm_driver exynos_drm_driver = {
.unload = exynos_drm_unload,
.preclose   = exynos_drm_preclose,
.lastclose  = exynos_drm_lastclose,
+   .postclose  = exynos_drm_postclose,
.get_vblank_counter = drm_vblank_count,
.enable_vblank  = exynos_drm_crtc_enable_vblank,
.disable_vblank = exynos_drm_crtc_disable_vblank,
-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[RESEND][PATCH 6/9] drm/exynos: removed exynos_drm_fbdev_recreate function.

2012-02-14 Thread Inki Dae
this function ins't needed anymore.

Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |   70 ++---
 1 files changed, 4 insertions(+), 66 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index d7ae29d..3508700 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -195,66 +195,6 @@ out:
return ret;
 }
 
-static bool
-exynos_drm_fbdev_is_samefb(struct drm_framebuffer *fb,
-   struct drm_fb_helper_surface_size *sizes)
-{
-   if (fb->width != sizes->surface_width)
-   return false;
-   if (fb->height != sizes->surface_height)
-   return false;
-   if (fb->bits_per_pixel != sizes->surface_bpp)
-   return false;
-   if (fb->depth != sizes->surface_depth)
-   return false;
-
-   return true;
-}
-
-static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper,
- struct drm_fb_helper_surface_size *sizes)
-{
-   struct drm_device *dev = helper->dev;
-   struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper);
-   struct exynos_drm_gem_obj *exynos_gem_obj;
-   struct drm_framebuffer *fb = helper->fb;
-   struct drm_mode_fb_cmd2 mode_cmd = { 0 };
-   unsigned long size;
-
-   DRM_DEBUG_KMS("%s\n", __FILE__);
-
-   if (exynos_drm_fbdev_is_samefb(fb, sizes))
-   return 0;
-
-   mode_cmd.width = sizes->surface_width;
-   mode_cmd.height = sizes->surface_height;
-   mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3);
-   mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
- sizes->surface_depth);
-
-   if (exynos_fbdev->exynos_gem_obj)
-   exynos_drm_gem_destroy(exynos_fbdev->exynos_gem_obj);
-
-   if (fb->funcs->destroy)
-   fb->funcs->destroy(fb);
-
-   size = mode_cmd.pitches[0] * mode_cmd.height;
-   exynos_gem_obj = exynos_drm_gem_create(dev, size);
-   if (IS_ERR(exynos_gem_obj))
-   return PTR_ERR(exynos_gem_obj);
-
-   exynos_fbdev->exynos_gem_obj = exynos_gem_obj;
-
-   helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd,
-   &exynos_gem_obj->base);
-   if (IS_ERR_OR_NULL(helper->fb)) {
-   DRM_ERROR("failed to create drm framebuffer.\n");
-   return PTR_ERR(helper->fb);
-   }
-
-   return exynos_drm_fbdev_update(helper, helper->fb);
-}
-
 static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper,
   struct drm_fb_helper_surface_size *sizes)
 {
@@ -262,6 +202,10 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper 
*helper,
 
DRM_DEBUG_KMS("%s\n", __FILE__);
 
+   /*
+* with !helper->fb, it means that this funcion is called first time
+* and after that, the helper->fb would be used as clone mode.
+*/
if (!helper->fb) {
ret = exynos_drm_fbdev_create(helper, sizes);
if (ret < 0) {
@@ -274,12 +218,6 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper 
*helper,
 * because register_framebuffer() should be called.
 */
ret = 1;
-   } else {
-   ret = exynos_drm_fbdev_recreate(helper, sizes);
-   if (ret < 0) {
-   DRM_ERROR("failed to reconfigure fbdev\n");
-   return ret;
-   }
}
 
return ret;
-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[RESEND][PATCH 5/9] drm/exynos: fixed page flip issue.

2012-02-14 Thread Inki Dae
with vblank_refcount = 1, there was the case that drm_vblank_put
is called by specific page flip function so this patch fixes the
issue.

Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c |6 +++---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |7 ++-
 drivers/gpu/drm/exynos/exynos_mixer.c|7 ++-
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index e3861ac..de81883 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -307,9 +307,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 */
event->pipe = exynos_crtc->pipe;
 
-   list_add_tail(&event->base.link,
-   &dev_priv->pageflip_event_list);
-
ret = drm_vblank_get(dev, exynos_crtc->pipe);
if (ret) {
DRM_DEBUG("failed to acquire vblank counter\n");
@@ -318,6 +315,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
goto out;
}
 
+   list_add_tail(&event->base.link,
+   &dev_priv->pageflip_event_list);
+
crtc->fb = fb;
ret = exynos_drm_crtc_update(crtc);
if (ret) {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index b6a737d..0dbb32b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -604,7 +604,12 @@ static void fimd_finish_pageflip(struct drm_device 
*drm_dev, int crtc)
}
 
if (is_checked) {
-   drm_vblank_put(drm_dev, crtc);
+   /*
+* call drm_vblank_put only in case that drm_vblank_get was
+* called.
+*/
+   if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
+   drm_vblank_put(drm_dev, crtc);
 
/*
 * don't off vblank if vblank_disable_allowed is 1,
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index 4796167..93846e8 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -712,7 +712,12 @@ static void mixer_finish_pageflip(struct drm_device 
*drm_dev, int crtc)
}
 
if (is_checked)
-   drm_vblank_put(drm_dev, crtc);
+   /*
+* call drm_vblank_put only in case that drm_vblank_get was
+* called.
+*/
+   if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
+   drm_vblank_put(drm_dev, crtc);
 
spin_unlock_irqrestore(&drm_dev->event_lock, flags);
 }
-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[RESEND][PATCH 2/9] drm/exynos: changed priority of mixer layers.

2012-02-14 Thread Inki Dae
From: Joonyoung Shim 

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_mixer.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index 33afd0c..4796167 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -779,15 +779,15 @@ static void mixer_win_reset(struct mixer_context *ctx)
mixer_reg_writemask(res, MXR_STATUS, MXR_STATUS_16_BURST,
MXR_STATUS_BURST_MASK);
 
-   /* setting default layer priority: layer1 > video > layer0
+   /* setting default layer priority: layer1 > layer0 > video
 * because typical usage scenario would be
+* layer1 - OSD
 * layer0 - framebuffer
 * video - video overlay
-* layer1 - OSD
 */
-   val  = MXR_LAYER_CFG_GRP0_VAL(1);
-   val |= MXR_LAYER_CFG_VP_VAL(2);
-   val |= MXR_LAYER_CFG_GRP1_VAL(3);
+   val = MXR_LAYER_CFG_GRP1_VAL(3);
+   val |= MXR_LAYER_CFG_GRP0_VAL(2);
+   val |= MXR_LAYER_CFG_VP_VAL(1);
mixer_reg_write(res, MXR_LAYER_CFG, val);
 
/* setting background color */
-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[RESEND][PATCH 4/9] drm/exynos: added possible_clones setup function.

2012-02-14 Thread Inki Dae
basically, all crtcs are possible to clone each other.

Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_core.c|3 ++
 drivers/gpu/drm/exynos/exynos_drm_drv.c |4 +++
 drivers/gpu/drm/exynos/exynos_drm_encoder.c |   34 +++
 drivers/gpu/drm/exynos/exynos_drm_encoder.h |1 +
 4 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c 
b/drivers/gpu/drm/exynos/exynos_drm_core.c
index 661a035..d08a558 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_core.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_core.c
@@ -193,6 +193,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv 
*subdrv)
return err;
}
 
+   /* setup possible_clones. */
+   exynos_drm_encoder_setup(drm_dev);
+
/*
 * if any specific driver such as fimd or hdmi driver called
 * exynos_drm_subdrv_register() later than drm_load(),
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 2ef12aa..76a111f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -33,6 +33,7 @@
 
 #include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
+#include "exynos_drm_encoder.h"
 #include "exynos_drm_fbdev.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_gem.h"
@@ -99,6 +100,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned 
long flags)
if (ret)
goto err_vblank;
 
+   /* setup possible_clones. */
+   exynos_drm_encoder_setup(dev);
+
/*
 * create and configure fb helper and also exynos specific
 * fbdev object.
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index 86b93dd..ef4754f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -195,6 +195,40 @@ static struct drm_encoder_funcs exynos_encoder_funcs = {
.destroy = exynos_drm_encoder_destroy,
 };
 
+static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder)
+{
+   struct drm_encoder *clone;
+   struct drm_device *dev = encoder->dev;
+   struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
+   struct exynos_drm_display_ops *display_ops =
+   exynos_encoder->manager->display_ops;
+   unsigned int clone_mask = 0;
+   int cnt = 0;
+
+   list_for_each_entry(clone, &dev->mode_config.encoder_list, head) {
+   switch (display_ops->type) {
+   case EXYNOS_DISPLAY_TYPE_LCD:
+   case EXYNOS_DISPLAY_TYPE_HDMI:
+   clone_mask |= (1 << (cnt++));
+   break;
+   default:
+   continue;
+   }
+   }
+
+   return clone_mask;
+}
+
+void exynos_drm_encoder_setup(struct drm_device *dev)
+{
+   struct drm_encoder *encoder;
+
+   DRM_DEBUG_KMS("%s\n", __FILE__);
+
+   list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
+   encoder->possible_clones = exynos_drm_encoder_clones(encoder);
+}
+
 struct drm_encoder *
 exynos_drm_encoder_create(struct drm_device *dev,
   struct exynos_drm_manager *manager,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
index 97b087a..eb7d231 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
@@ -30,6 +30,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);
-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[RESEND][PATCH 1/9] drm/exynos: Fix typo in exynos_mixer.c

2012-02-14 Thread Inki Dae
From: Masanari Iida 

Correct spelling "sucessful" to "successful" in
drivers/gpu/drm/exynos/exynos_mixer.c

Signed-off-by: Masanari Iida 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_mixer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index ac24cff..33afd0c 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1044,7 +1044,7 @@ static int mixer_remove(struct platform_device *pdev)
platform_get_drvdata(pdev);
struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx->ctx;
 
-   dev_info(dev, "remove sucessful\n");
+   dev_info(dev, "remove successful\n");
 
mixer_resource_poweroff(ctx);
mixer_resources_cleanup(ctx);
-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[RESEND][PATCH 3/9] drm/exynos: removed pageflip_event_list init code when closed.

2012-02-14 Thread Inki Dae
From: Joonyoung Shim 

if one process is terminated by ctrl-c while two processes are
using pageflip feature then for last pageflip event,
user can't get poll from kernel side so this patch fixes the problem.

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyoungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   10 ++
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 35889ca..2ef12aa 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -141,16 +141,10 @@ static int exynos_drm_unload(struct drm_device *dev)
 }
 
 static void exynos_drm_preclose(struct drm_device *dev,
-   struct drm_file *file_priv)
+   struct drm_file *file)
 {
-   struct exynos_drm_private *dev_priv = dev->dev_private;
+   DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
-   /*
-* drm framework frees all events at release time,
-* so private event list should be cleared.
-*/
-   if (!list_empty(&dev_priv->pageflip_event_list))
-   INIT_LIST_HEAD(&dev_priv->pageflip_event_list);
 }
 
 static void exynos_drm_lastclose(struct drm_device *dev)
-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[RESEND][PATCH 0/9] drm/exynos: fixed exynos drm driver.

2012-02-14 Thread Inki Dae
I am resending the patch set removing new features from previous one.
this patch set fixes page flip issue and releases some resources
and these new features will be sent to drm-next later.

this is based on git repository below:
git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git,
branch name: drm-fixes
commit-id: 6f9f8a61089bb177e53e14ee62f4a65134f3692f

and you can refer to our working repository below:
http://git.infradead.org/users/kmpark/linux-2.6-samsung,
branch name: exynos-drm-fixes

Thanks.

Eun-Chul Kim (1):
  drm/exynos: added panel physical size.

Inki Dae (4):
  drm/exynos: added possible_clones setup function.
  drm/exynos: fixed page flip issue.
  drm/exynos: removed exynos_drm_fbdev_recreate function.
  drm/exynos: added postclose to release resource.

Joonyoung Shim (2):
  drm/exynos: changed priority of mixer layers.
  drm/exynos: removed pageflip_event_list init code when closed.

Kamil Debski (1):
  drm/exynos: exynos_drm.h header file fixes

Masanari Iida (1):
  drm/exynos: Fix typo in exynos_mixer.c

 drivers/gpu/drm/exynos/exynos_drm_connector.c |   16 --
 drivers/gpu/drm/exynos/exynos_drm_core.c  |3 +
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |6 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |   26 ++---
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |4 +-
 drivers/gpu/drm/exynos/exynos_drm_encoder.c   |   34 
 drivers/gpu/drm/exynos/exynos_drm_encoder.h   |1 +
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |   70 ++---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  |   34 +++-
 drivers/gpu/drm/exynos/exynos_mixer.c |   19 ---
 include/drm/Kbuild|1 +
 include/drm/exynos_drm.h  |   22 +++-
 12 files changed, 128 insertions(+), 108 deletions(-)

-- 
1.7.4.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: linux-3.3-rc2 and radeon kms failure on ppc32 with Radeon X1650PRO pcie

2012-02-14 Thread acrux
On Sun, 12 Feb 2012 11:00:43 +0100
Michel Dänzer  wrote:

> On Sam, 2012-02-11 at 21:00 +0100, acrux wrote: 
> > 
> > Just a curiosity, i've only two powerpc machines[1] equipped with PCIE
> > videocards and both them are not able to boot with radeonkms.
> > Modern PCI-E videocards are not recognized by the old linux framebuffer
> > subsystem and they solely can be managed by the new KMS frame buffer
> > that doesn't work properly on Power Architecture.
> 
> That's too broad a statement, it works fine on other PowerPC machines
> (PowerMacs, some embedded boards).
> 

hi Michel,
thanks a lot for your help, i really appreciate it.

If you say they were tested on real Power Architecture boards with PCIE
videocards thus it is reassuring... and i'm happy that you understand
my previus assertion wasn't affected by malevolence or sarcasm. Indeed
i'm also a bit troubled 'n frustrated thinking that next release of
mesa 'll do extend use of llvm (that doesn't work properly on linuxppc
and totally untested on linuxppc64)

Btw, to sum up the list of Power Architecture machines with PCIE  that
aim to be a desktop/workstation: Apple iMac G5 (iSight), Apple PowerMac
Quad G5, YDL Powerstation 2x970MP and Acube Sam460ex . And the last
two, on present evidence (my attempts), aren't able to boot up if
bootkernel has kms enabled. Furthermore the first tree ones can
fallback to the legacy OpenFirmware framebuffer and safely get a
console.

> It looks like there's a problem with accessing the PCIe device memory,
> and at this point it's not even 100% clear that this is due to a problem
> in the driver, as opposed to e.g. in the platform code.
> 

it could be the right problem and i've CC BenH that has a better global
perspective.

all the best,
--nico
-- 
acrux 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 45968] [RADEON:KMS:RS780:HD3200] l 2560x1440 detected by monitor as 1280x1440, every second pixel missing

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=45968

--- Comment #11 from Roland Scheidegger  2012-02-14 
10:04:35 PST ---
(In reply to comment #9)
> FWIW using HDMI on 3.3-rc I can go up to 2560x1440 at 48, but 2560x1440 at 60 
> is above the 340MHz pixelclock limit for one link.

I'm surprised this old hw supports 340Mhz pixelclock on hdmi, I thought only 
Tahiti could do that, and monitors wouldn't support it neither typically 
(though I
know some hw tolerates overclocking tmds quite well).
In any case 2560x1440 at 60Hz should be clearly below 340Mhz with reduced 
blanking (around 250Mhz).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[PATCH] drm/exynos: exynos_drm.h header file fixes

2012-02-14 Thread Inki Dae
Hi, Kamil.
Sorry for being late.

Below is my comments.

> -Original Message-
> From: Kamil Debski [mailto:k.debski at samsung.com]
> Sent: Saturday, February 11, 2012 2:32 AM
> To: dri-devel at lists.freedesktop.org
> Cc: kyungmin.park at samsung.com; inki.dae at samsung.com;
> jy0922.shim at samsung.com; sw0312.kim at samsung.com; airlied at linux.ie; 
> Kamil
> Debski
> Subject: [PATCH] drm/exynos: exynos_drm.h header file fixes
> 
> First of all #ifdef __KERNEL__ was added to exynos_drm.h to
> mark the part that should be left out of userspace.
> Secondly exynos_drm.h was added to include/drm/Kbuild, so it
> will be included when doing make headers_install.
> 
> Signed-off-by: Kamil Debski 
> Signed-off-by: Kyungmin Park 
> ---
>  include/drm/Kbuild   |1 +
>  include/drm/exynos_drm.h |5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/drm/Kbuild b/include/drm/Kbuild
> index a5c0e10..1e38a19 100644
> --- a/include/drm/Kbuild
> +++ b/include/drm/Kbuild
> @@ -2,6 +2,7 @@ header-y += drm.h
>  header-y += drm_fourcc.h
>  header-y += drm_mode.h
>  header-y += drm_sarea.h
> +header-y += exynos_drm.h
>  header-y += i810_drm.h
>  header-y += i915_drm.h
>  header-y += mga_drm.h
> diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
> index 13b8660..5900e0b 100644
> --- a/include/drm/exynos_drm.h
> +++ b/include/drm/exynos_drm.h
> @@ -99,6 +99,7 @@ struct drm_exynos_plane_set_zpos {
>  #define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS  DRM_IOWR(DRM_COMMAND_BASE +
> \
>   DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos)
> 
> +#ifdef __KERNEL__

could you please modify it for this macro to be place above of struct
exynos_drm_panel_info? struct exynos_drm_panel_info also isn't needed for
user side.

Thanks.

>  /**
>   * Platform Specific Structure for DRM based FIMD.
>   *
> @@ -140,5 +141,5 @@ struct exynos_drm_hdmi_pdata {
>   unsigned intdefault_win;
>   unsigned intbpp;
>  };
> -
> -#endif
> +#endif /* __KERNEL__ */
> +#endif /* _EXYNOS_DRM_H_ */
> --
> 1.7.0.4



RE: [PATCH 00/11] drm/exynos: fixed exynos drm driver.

2012-02-14 Thread Inki Dae
Hi, Dave.

I'm so sorry. I will resent it removing new feature.

Thanks,
Inki Dae

> -Original Message-
> From: Dave Airlie [mailto:airl...@gmail.com]
> Sent: Tuesday, February 14, 2012 7:54 PM
> To: Inki Dae
> Cc: airl...@linux.ie; dri-devel@lists.freedesktop.org;
> kyungmin.p...@samsung.com; sw0312@samsung.com
> Subject: Re: [PATCH 00/11] drm/exynos: fixed exynos drm driver.
> 
> On Tue, Feb 14, 2012 at 7:52 AM, Inki Dae  wrote:
> > this patch set fixes page flip and mode setting issues and also
> > hdmi v1.4 support.
> 
> Adding hdmi v1.4 support doesn't seem like a fix to me, it seems like
> a new feature.
> 
> This should be in a -next tree, if you want to have fixes in 3.3 then
> please resend a -fixes tree
> with no new features, and put hdmi1.4 into a -next branch.
> 
> Dave.

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 11/11] drm/exynos: added panel physical size.

2012-02-14 Thread Inki Dae
From: Eun-Chul Kim 

Signed-off-by: Eun-Chul Kim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_connector.c |   16 ++
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |4 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  |   27 +
 include/drm/exynos_drm.h  |   17 +-
 4 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c 
b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index c35eb32..ebdd71d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -28,6 +28,7 @@
 #include "drmP.h"
 #include "drm_crtc_helper.h"

+#include 
 #include "exynos_drm_drv.h"
 #include "exynos_drm_encoder.h"

@@ -44,8 +45,9 @@ struct exynos_drm_connector {
 /* convert exynos_video_timings to drm_display_mode */
 static inline void
 convert_to_display_mode(struct drm_display_mode *mode,
-   struct fb_videomode *timing)
+   struct exynos_drm_panel_info *panel)
 {
+   struct fb_videomode *timing = &panel->timing;
DRM_DEBUG_KMS("%s\n", __FILE__);

mode->clock = timing->pixclock / 1000;
@@ -60,6 +62,8 @@ convert_to_display_mode(struct drm_display_mode *mode,
mode->vsync_start = mode->vdisplay + timing->upper_margin;
mode->vsync_end = mode->vsync_start + timing->vsync_len;
mode->vtotal = mode->vsync_end + timing->lower_margin;
+   mode->width_mm = panel->width_mm;
+   mode->height_mm = panel->height_mm;

if (timing->vmode & FB_VMODE_INTERLACED)
mode->flags |= DRM_MODE_FLAG_INTERLACE;
@@ -148,16 +152,18 @@ static int exynos_drm_connector_get_modes(struct 
drm_connector *connector)
connector->display_info.raw_edid = edid;
} else {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
-   struct fb_videomode *timing;
+   struct exynos_drm_panel_info *panel;

-   if (display_ops->get_timing)
-   timing = display_ops->get_timing(manager->dev);
+   if (display_ops->get_panel)
+   panel = display_ops->get_panel(manager->dev);
else {
drm_mode_destroy(connector->dev, mode);
return 0;
}

-   convert_to_display_mode(mode, timing);
+   convert_to_display_mode(mode, panel);
+   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);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index eb03f95..4115a9f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -136,7 +136,7 @@ struct exynos_drm_overlay {
  * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI.
  * @is_connected: check for that display is connected or not.
  * @get_edid: get edid modes from display driver.
- * @get_timing: get timing object from display driver.
+ * @get_panel: get panel object from display driver.
  * @check_timing: check if timing is valid or not.
  * @power_on: display device on or off.
  */
@@ -145,7 +145,7 @@ struct exynos_drm_display_ops {
bool (*is_connected)(struct device *dev);
int (*get_edid)(struct device *dev, struct drm_connector *connector,
u8 *edid, int len);
-   void *(*get_timing)(struct device *dev);
+   void *(*get_panel)(struct device *dev);
int (*check_timing)(struct device *dev, void *timing);
int (*power_on)(struct device *dev, int mode);
 };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 0dbb32b..360adf2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -89,7 +89,7 @@ struct fimd_context {
boolsuspended;
struct mutexlock;

-   struct fb_videomode *timing;
+   struct exynos_drm_panel_info *panel;
 };

 static bool fimd_display_is_connected(struct device *dev)
@@ -101,13 +101,13 @@ static bool fimd_display_is_connected(struct device *dev)
return true;
 }

-static void *fimd_get_timing(struct device *dev)
+static void *fimd_get_panel(struct device *dev)
 {
struct fimd_context *ctx = get_fimd_context(dev);

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

-   return ctx->timing;
+   return ctx->panel;
 }

 static int fimd_check_timing(struct device *dev, void *timing)
@@ -131,7 +131,7 @@ static int fimd_display_power_on(struct device *dev, int 
mode)
 static struct exynos_drm_display_ops fimd_display_ops = {
.

[PATCH 10/11] drm/exynos: added postclose to release resource.

2012-02-14 Thread Inki Dae
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 76a111f..58820eb 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -151,6 +151,17 @@ static void exynos_drm_preclose(struct drm_device *dev,

 }

+static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
+{
+   DRM_DEBUG_DRIVER("%s\n", __FILE__);
+
+   if (!file->driver_priv)
+   return;
+
+   kfree(file->driver_priv);
+   file->driver_priv = NULL;
+}
+
 static void exynos_drm_lastclose(struct drm_device *dev)
 {
DRM_DEBUG_DRIVER("%s\n", __FILE__);
@@ -193,6 +204,7 @@ static struct drm_driver exynos_drm_driver = {
.unload = exynos_drm_unload,
.preclose   = exynos_drm_preclose,
.lastclose  = exynos_drm_lastclose,
+   .postclose  = exynos_drm_postclose,
.get_vblank_counter = drm_vblank_count,
.enable_vblank  = exynos_drm_crtc_enable_vblank,
.disable_vblank = exynos_drm_crtc_disable_vblank,
-- 
1.7.4.1



[PATCH 09/11] drm/exynos: added mode_fixup feature and code clean.

2012-02-14 Thread Inki Dae
this patch adds mode_fixup feature for hdmi module that
specific driver changes current mode to driver desired mode
properly.

Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_connector.c |   25 +++-
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |6 ++-
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |8 +++
 drivers/gpu/drm/exynos/exynos_drm_encoder.c   |   17 -
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c  |   28 +
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h  |5 ++
 drivers/gpu/drm/exynos/exynos_hdmi.c  |   81 ++--
 7 files changed, 157 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c 
b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index d620b07..c35eb32 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -219,6 +219,29 @@ static struct drm_connector_helper_funcs 
exynos_connector_helper_funcs = {
.best_encoder   = exynos_drm_best_encoder,
 };

+static int exynos_drm_connector_fill_modes(struct drm_connector *connector,
+   unsigned int max_width, unsigned int max_height)
+{
+   struct exynos_drm_connector *exynos_connector =
+   to_exynos_connector(connector);
+   struct exynos_drm_manager *manager = exynos_connector->manager;
+   struct exynos_drm_manager_ops *ops = manager->ops;
+   unsigned int width, height;
+
+   width = max_width;
+   height = max_height;
+
+   /*
+* if specific driver want to find desired_mode using maxmum
+* resolution then get max width and height from that driver.
+*/
+   if (ops && ops->get_max_resol)
+   ops->get_max_resol(manager->dev, &width, &height);
+
+   return drm_helper_probe_single_connector_modes(connector, width,
+   height);
+}
+
 /* get detection status of display device. */
 static enum drm_connector_status
 exynos_drm_connector_detect(struct drm_connector *connector, bool force)
@@ -256,7 +279,7 @@ static void exynos_drm_connector_destroy(struct 
drm_connector *connector)

 static struct drm_connector_funcs exynos_connector_funcs = {
.dpms   = drm_helper_connector_dpms,
-   .fill_modes = drm_helper_probe_single_connector_modes,
+   .fill_modes = exynos_drm_connector_fill_modes,
.detect = exynos_drm_connector_detect,
.destroy= exynos_drm_connector_destroy,
 };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index de81883..2d9a0e6 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -249,7 +249,11 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct 
drm_display_mode *mode,
 {
DRM_DEBUG_KMS("%s\n", __FILE__);

-   mode = adjusted_mode;
+   /*
+* copy the mode data adjusted by mode_fixup() into crtc->mode
+* so that hardware can be seet to proper mode.
+*/
+   memcpy(&crtc->mode, adjusted_mode, sizeof(*adjusted_mode));

return exynos_drm_crtc_update(crtc);
 }
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index e685e1e..eb03f95 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -155,8 +155,10 @@ struct exynos_drm_display_ops {
  *
  * @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().
+ * @get_max_resol: get maximum resolution to specific hardware.
  * @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.
@@ -164,7 +166,13 @@ struct exynos_drm_display_ops {
 struct exynos_drm_manager_ops {
void (*dpms)(struct device *subdrv_dev, int mode);
void (*apply)(struct device *subdrv_dev);
+   void (*mode_fixup)(struct device *subdrv_dev,
+   struct drm_connector *connector,
+   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);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers

[PATCH 08/11] drm/exynos: removed exynos_drm_fbdev_recreate function.

2012-02-14 Thread Inki Dae
this function ins't needed anymore.

Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |   70 ++---
 1 files changed, 4 insertions(+), 66 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index d7ae29d..3508700 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -195,66 +195,6 @@ out:
return ret;
 }

-static bool
-exynos_drm_fbdev_is_samefb(struct drm_framebuffer *fb,
-   struct drm_fb_helper_surface_size *sizes)
-{
-   if (fb->width != sizes->surface_width)
-   return false;
-   if (fb->height != sizes->surface_height)
-   return false;
-   if (fb->bits_per_pixel != sizes->surface_bpp)
-   return false;
-   if (fb->depth != sizes->surface_depth)
-   return false;
-
-   return true;
-}
-
-static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper,
- struct drm_fb_helper_surface_size *sizes)
-{
-   struct drm_device *dev = helper->dev;
-   struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper);
-   struct exynos_drm_gem_obj *exynos_gem_obj;
-   struct drm_framebuffer *fb = helper->fb;
-   struct drm_mode_fb_cmd2 mode_cmd = { 0 };
-   unsigned long size;
-
-   DRM_DEBUG_KMS("%s\n", __FILE__);
-
-   if (exynos_drm_fbdev_is_samefb(fb, sizes))
-   return 0;
-
-   mode_cmd.width = sizes->surface_width;
-   mode_cmd.height = sizes->surface_height;
-   mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3);
-   mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
- sizes->surface_depth);
-
-   if (exynos_fbdev->exynos_gem_obj)
-   exynos_drm_gem_destroy(exynos_fbdev->exynos_gem_obj);
-
-   if (fb->funcs->destroy)
-   fb->funcs->destroy(fb);
-
-   size = mode_cmd.pitches[0] * mode_cmd.height;
-   exynos_gem_obj = exynos_drm_gem_create(dev, size);
-   if (IS_ERR(exynos_gem_obj))
-   return PTR_ERR(exynos_gem_obj);
-
-   exynos_fbdev->exynos_gem_obj = exynos_gem_obj;
-
-   helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd,
-   &exynos_gem_obj->base);
-   if (IS_ERR_OR_NULL(helper->fb)) {
-   DRM_ERROR("failed to create drm framebuffer.\n");
-   return PTR_ERR(helper->fb);
-   }
-
-   return exynos_drm_fbdev_update(helper, helper->fb);
-}
-
 static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper,
   struct drm_fb_helper_surface_size *sizes)
 {
@@ -262,6 +202,10 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper 
*helper,

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

+   /*
+* with !helper->fb, it means that this funcion is called first time
+* and after that, the helper->fb would be used as clone mode.
+*/
if (!helper->fb) {
ret = exynos_drm_fbdev_create(helper, sizes);
if (ret < 0) {
@@ -274,12 +218,6 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper 
*helper,
 * because register_framebuffer() should be called.
 */
ret = 1;
-   } else {
-   ret = exynos_drm_fbdev_recreate(helper, sizes);
-   if (ret < 0) {
-   DRM_ERROR("failed to reconfigure fbdev\n");
-   return ret;
-   }
}

return ret;
-- 
1.7.4.1



[PATCH 07/11] drm/exynos: fixed page flip issue.

2012-02-14 Thread Inki Dae
with vblank_refcount = 1, there was the case that drm_vblank_put
is called by specific page flip function so this patch fixes the
issue.

Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c |6 +++---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |7 ++-
 drivers/gpu/drm/exynos/exynos_mixer.c|7 ++-
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index e3861ac..de81883 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -307,9 +307,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 */
event->pipe = exynos_crtc->pipe;

-   list_add_tail(&event->base.link,
-   &dev_priv->pageflip_event_list);
-
ret = drm_vblank_get(dev, exynos_crtc->pipe);
if (ret) {
DRM_DEBUG("failed to acquire vblank counter\n");
@@ -318,6 +315,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
goto out;
}

+   list_add_tail(&event->base.link,
+   &dev_priv->pageflip_event_list);
+
crtc->fb = fb;
ret = exynos_drm_crtc_update(crtc);
if (ret) {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index b6a737d..0dbb32b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -604,7 +604,12 @@ static void fimd_finish_pageflip(struct drm_device 
*drm_dev, int crtc)
}

if (is_checked) {
-   drm_vblank_put(drm_dev, crtc);
+   /*
+* call drm_vblank_put only in case that drm_vblank_get was
+* called.
+*/
+   if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
+   drm_vblank_put(drm_dev, crtc);

/*
 * don't off vblank if vblank_disable_allowed is 1,
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index 4796167..93846e8 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -712,7 +712,12 @@ static void mixer_finish_pageflip(struct drm_device 
*drm_dev, int crtc)
}

if (is_checked)
-   drm_vblank_put(drm_dev, crtc);
+   /*
+* call drm_vblank_put only in case that drm_vblank_get was
+* called.
+*/
+   if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
+   drm_vblank_put(drm_dev, crtc);

spin_unlock_irqrestore(&drm_dev->event_lock, flags);
 }
-- 
1.7.4.1



[PATCH 06/11] drm/exynos: added possible_clones setup function.

2012-02-14 Thread Inki Dae
basically, all crtcs are possible to clone each other.

Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_core.c|3 ++
 drivers/gpu/drm/exynos/exynos_drm_drv.c |4 +++
 drivers/gpu/drm/exynos/exynos_drm_encoder.c |   34 +++
 drivers/gpu/drm/exynos/exynos_drm_encoder.h |1 +
 4 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c 
b/drivers/gpu/drm/exynos/exynos_drm_core.c
index 661a035..d08a558 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_core.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_core.c
@@ -193,6 +193,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv 
*subdrv)
return err;
}

+   /* setup possible_clones. */
+   exynos_drm_encoder_setup(drm_dev);
+
/*
 * if any specific driver such as fimd or hdmi driver called
 * exynos_drm_subdrv_register() later than drm_load(),
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 2ef12aa..76a111f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -33,6 +33,7 @@

 #include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
+#include "exynos_drm_encoder.h"
 #include "exynos_drm_fbdev.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_gem.h"
@@ -99,6 +100,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned 
long flags)
if (ret)
goto err_vblank;

+   /* setup possible_clones. */
+   exynos_drm_encoder_setup(dev);
+
/*
 * create and configure fb helper and also exynos specific
 * fbdev object.
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index 86b93dd..ef4754f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -195,6 +195,40 @@ static struct drm_encoder_funcs exynos_encoder_funcs = {
.destroy = exynos_drm_encoder_destroy,
 };

+static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder)
+{
+   struct drm_encoder *clone;
+   struct drm_device *dev = encoder->dev;
+   struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
+   struct exynos_drm_display_ops *display_ops =
+   exynos_encoder->manager->display_ops;
+   unsigned int clone_mask = 0;
+   int cnt = 0;
+
+   list_for_each_entry(clone, &dev->mode_config.encoder_list, head) {
+   switch (display_ops->type) {
+   case EXYNOS_DISPLAY_TYPE_LCD:
+   case EXYNOS_DISPLAY_TYPE_HDMI:
+   clone_mask |= (1 << (cnt++));
+   break;
+   default:
+   continue;
+   }
+   }
+
+   return clone_mask;
+}
+
+void exynos_drm_encoder_setup(struct drm_device *dev)
+{
+   struct drm_encoder *encoder;
+
+   DRM_DEBUG_KMS("%s\n", __FILE__);
+
+   list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
+   encoder->possible_clones = exynos_drm_encoder_clones(encoder);
+}
+
 struct drm_encoder *
 exynos_drm_encoder_create(struct drm_device *dev,
   struct exynos_drm_manager *manager,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h 
b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
index 97b087a..eb7d231 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
@@ -30,6 +30,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);
-- 
1.7.4.1



[PATCH 05/11] drm/exynos: removed pageflip_event_list init code when closed.

2012-02-14 Thread Inki Dae
From: Joonyoung Shim 

if one process is terminated by ctrl-c while two processes are
using pageflip feature then for last pageflip event,
user can't get poll from kernel side so this patch fixes the problem.

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyoungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   10 ++
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 35889ca..2ef12aa 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -141,16 +141,10 @@ static int exynos_drm_unload(struct drm_device *dev)
 }

 static void exynos_drm_preclose(struct drm_device *dev,
-   struct drm_file *file_priv)
+   struct drm_file *file)
 {
-   struct exynos_drm_private *dev_priv = dev->dev_private;
+   DRM_DEBUG_DRIVER("%s\n", __FILE__);

-   /*
-* drm framework frees all events at release time,
-* so private event list should be cleared.
-*/
-   if (!list_empty(&dev_priv->pageflip_event_list))
-   INIT_LIST_HEAD(&dev_priv->pageflip_event_list);
 }

 static void exynos_drm_lastclose(struct drm_device *dev)
-- 
1.7.4.1



[PATCH 04/11] drm/exynos: changed priority of mixer layers.

2012-02-14 Thread Inki Dae
From: Joonyoung Shim 

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_mixer.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index 33afd0c..4796167 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -779,15 +779,15 @@ static void mixer_win_reset(struct mixer_context *ctx)
mixer_reg_writemask(res, MXR_STATUS, MXR_STATUS_16_BURST,
MXR_STATUS_BURST_MASK);

-   /* setting default layer priority: layer1 > video > layer0
+   /* setting default layer priority: layer1 > layer0 > video
 * because typical usage scenario would be
+* layer1 - OSD
 * layer0 - framebuffer
 * video - video overlay
-* layer1 - OSD
 */
-   val  = MXR_LAYER_CFG_GRP0_VAL(1);
-   val |= MXR_LAYER_CFG_VP_VAL(2);
-   val |= MXR_LAYER_CFG_GRP1_VAL(3);
+   val = MXR_LAYER_CFG_GRP1_VAL(3);
+   val |= MXR_LAYER_CFG_GRP0_VAL(2);
+   val |= MXR_LAYER_CFG_VP_VAL(1);
mixer_reg_write(res, MXR_LAYER_CFG, val);

/* setting background color */
-- 
1.7.4.1



[PATCH 03/11] drm/exynos: fixed hdmi 720p config.

2012-02-14 Thread Inki Dae
From: Joonyoung Shim 

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_hdmi.c |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 733b9ec..1cfe86e 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -545,9 +545,9 @@ static const struct hdmi_preset_conf hdmi_conf_720p50 = {
 static const struct hdmi_preset_conf hdmi_conf_720p60 = {
.core = {
.h_blank = {0x72, 0x01},
-   .v2_blank = {0xdc, 0x05},
+   .v2_blank = {0xee, 0x02},
.v1_blank = {0x1e, 0x00},
-   .v_line = {0xdc, 0x05},
+   .v_line = {0xee, 0x02},
.h_line = {0x72, 0x06},
.hsync_pol = {0x00},
.vsync_pol = {0x00},
@@ -574,8 +574,8 @@ static const struct hdmi_preset_conf hdmi_conf_720p60 = {
.v_sync_line_aft_pxl_4 = {0xff, 0xff},
.v_sync_line_aft_pxl_5 = {0xff, 0xff},
.v_sync_line_aft_pxl_6 = {0xff, 0xff},
-   .vact_space_1 = {0xee, 0x02},
-   .vact_space_2 = {0x0c, 0x03},
+   .vact_space_1 = {0xff, 0xff},
+   .vact_space_2 = {0xff, 0xff},
.vact_space_3 = {0xff, 0xff},
.vact_space_4 = {0xff, 0xff},
.vact_space_5 = {0xff, 0xff},
@@ -586,16 +586,16 @@ static const struct hdmi_preset_conf hdmi_conf_720p60 = {
0x00, /* cmd */
0x72, 0x06, /* h_fsz */
0x72, 0x01, 0x00, 0x05, /* hact */
-   0xdc, 0x05, /* v_fsz */
+   0xee, 0x02, /* v_fsz */
0x01, 0x00, 0x33, 0x02, /* vsync */
-   0x1e, 0x00, 0x00, 0x2d, /* vact */
+   0x1e, 0x00, 0xd0, 0x02, /* vact */
0x33, 0x02, /* field_chg */
-   0x0c, 0x03, /* vact_st2 */
+   0x48, 0x02, /* vact_st2 */
0x00, 0x00, /* vact_st3 */
0x00, 0x00, /* vact_st4 */
0x01, 0x00, 0x01, 0x00, /* vsync top/bot */
0x01, 0x00, 0x33, 0x02, /* field top/bot */
-   0x01, /* 3d FP */
+   0x00, /* 3d FP */
},
 };

-- 
1.7.4.1



[PATCH 02/11] drm/exynos: added hdmi version 1.4 support.

2012-02-14 Thread Inki Dae
From: Joonyoung Shim 

Signed-off-by: Joonyoung Shim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 1152 +++---
 drivers/gpu/drm/exynos/exynos_hdmi.h |   10 +-
 drivers/gpu/drm/exynos/regs-hdmi.h   |  306 --
 include/drm/exynos_drm.h |2 +
 4 files changed, 1325 insertions(+), 145 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 3429d3f..733b9ec 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -43,42 +43,43 @@
 #define HDMI_OVERLAY_NUMBER3
 #define get_hdmi_context(dev)  platform_get_drvdata(to_platform_device(dev))

-static const u8 hdmiphy_conf27[32] = {
+/* HDMI Version 1.3 */
+static const u8 hdmiphy_v13_conf27[32] = {
0x01, 0x05, 0x00, 0xD8, 0x10, 0x1C, 0x30, 0x40,
0x6B, 0x10, 0x02, 0x51, 0xDF, 0xF2, 0x54, 0x87,
0x84, 0x00, 0x30, 0x38, 0x00, 0x08, 0x10, 0xE0,
0x22, 0x40, 0xE3, 0x26, 0x00, 0x00, 0x00, 0x00,
 };

-static const u8 hdmiphy_conf27_027[32] = {
+static const u8 hdmiphy_v13_conf27_027[32] = {
0x01, 0x05, 0x00, 0xD4, 0x10, 0x9C, 0x09, 0x64,
0x6B, 0x10, 0x02, 0x51, 0xDF, 0xF2, 0x54, 0x87,
0x84, 0x00, 0x30, 0x38, 0x00, 0x08, 0x10, 0xE0,
0x22, 0x40, 0xE3, 0x26, 0x00, 0x00, 0x00, 0x00,
 };

-static const u8 hdmiphy_conf74_175[32] = {
+static const u8 hdmiphy_v13_conf74_175[32] = {
0x01, 0x05, 0x00, 0xD8, 0x10, 0x9C, 0xef, 0x5B,
0x6D, 0x10, 0x01, 0x51, 0xef, 0xF3, 0x54, 0xb9,
0x84, 0x00, 0x30, 0x38, 0x00, 0x08, 0x10, 0xE0,
0x22, 0x40, 0xa5, 0x26, 0x01, 0x00, 0x00, 0x00,
 };

-static const u8 hdmiphy_conf74_25[32] = {
+static const u8 hdmiphy_v13_conf74_25[32] = {
0x01, 0x05, 0x00, 0xd8, 0x10, 0x9c, 0xf8, 0x40,
0x6a, 0x10, 0x01, 0x51, 0xff, 0xf1, 0x54, 0xba,
0x84, 0x00, 0x10, 0x38, 0x00, 0x08, 0x10, 0xe0,
0x22, 0x40, 0xa4, 0x26, 0x01, 0x00, 0x00, 0x00,
 };

-static const u8 hdmiphy_conf148_5[32] = {
+static const u8 hdmiphy_v13_conf148_5[32] = {
0x01, 0x05, 0x00, 0xD8, 0x10, 0x9C, 0xf8, 0x40,
0x6A, 0x18, 0x00, 0x51, 0xff, 0xF1, 0x54, 0xba,
0x84, 0x00, 0x10, 0x38, 0x00, 0x08, 0x10, 0xE0,
0x22, 0x40, 0xa4, 0x26, 0x02, 0x00, 0x00, 0x00,
 };

-struct hdmi_tg_regs {
+struct hdmi_v13_tg_regs {
u8 cmd;
u8 h_fsz_l;
u8 h_fsz_h;
@@ -110,7 +111,7 @@ struct hdmi_tg_regs {
u8 field_bot_hdmi_h;
 };

-struct hdmi_core_regs {
+struct hdmi_v13_core_regs {
u8 h_blank[2];
u8 v_blank[3];
u8 h_v_line[3];
@@ -123,12 +124,21 @@ struct hdmi_core_regs {
u8 v_sync_gen3[3];
 };

-struct hdmi_preset_conf {
-   struct hdmi_core_regs core;
-   struct hdmi_tg_regs tg;
+struct hdmi_v13_preset_conf {
+   struct hdmi_v13_core_regs core;
+   struct hdmi_v13_tg_regs tg;
+};
+
+struct hdmi_v13_conf {
+   int width;
+   int height;
+   int vrefresh;
+   bool interlace;
+   const u8 *hdmiphy_data;
+   const struct hdmi_v13_preset_conf *conf;
 };

-static const struct hdmi_preset_conf hdmi_conf_480p = {
+static const struct hdmi_v13_preset_conf hdmi_v13_conf_480p = {
.core = {
.h_blank = {0x8a, 0x00},
.v_blank = {0x0d, 0x6a, 0x01},
@@ -154,7 +164,7 @@ static const struct hdmi_preset_conf hdmi_conf_480p = {
},
 };

-static const struct hdmi_preset_conf hdmi_conf_720p60 = {
+static const struct hdmi_v13_preset_conf hdmi_v13_conf_720p60 = {
.core = {
.h_blank = {0x72, 0x01},
.v_blank = {0xee, 0xf2, 0x00},
@@ -182,7 +192,7 @@ static const struct hdmi_preset_conf hdmi_conf_720p60 = {
},
 };

-static const struct hdmi_preset_conf hdmi_conf_1080i50 = {
+static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080i50 = {
.core = {
.h_blank = {0xd0, 0x02},
.v_blank = {0x32, 0xB2, 0x00},
@@ -210,7 +220,7 @@ static const struct hdmi_preset_conf hdmi_conf_1080i50 = {
},
 };

-static const struct hdmi_preset_conf hdmi_conf_1080p50 = {
+static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080p50 = {
.core = {
.h_blank = {0xd0, 0x02},
.v_blank = {0x65, 0x6c, 0x01},
@@ -238,7 +248,7 @@ static const struct hdmi_preset_conf hdmi_conf_1080p50 = {
},
 };

-static const struct hdmi_preset_conf hdmi_conf_1080i60 = {
+static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080i60 = {
.core = {
.h_blank = {0x18, 0x01},
.v_blank = {0x32, 0xB2, 0x00},
@@ -266,7 +276,7 @@ static const struct hdmi_preset_conf hdmi_conf_1080i60 = {
},
 };

-static const struct hdmi_preset_conf hdmi_conf_1080p60 = {
+static const struct hdmi_v13_preset_conf hdmi_v13_conf_1080p60 = {
.core = {
.h_blank = {0x18, 0x01},
.v_blank = {0x65, 0x

[PATCH 01/11] drm/exynos: Fix typo in exynos_mixer.c

2012-02-14 Thread Inki Dae
From: Masanari Iida 

Correct spelling "sucessful" to "successful" in
drivers/gpu/drm/exynos/exynos_mixer.c

Signed-off-by: Masanari Iida 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_mixer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index ac24cff..33afd0c 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1044,7 +1044,7 @@ static int mixer_remove(struct platform_device *pdev)
platform_get_drvdata(pdev);
struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx->ctx;

-   dev_info(dev, "remove sucessful\n");
+   dev_info(dev, "remove successful\n");

mixer_resource_poweroff(ctx);
mixer_resources_cleanup(ctx);
-- 
1.7.4.1



[PATCH 00/11] drm/exynos: fixed exynos drm driver.

2012-02-14 Thread Inki Dae
this patch set fixes page flip and mode setting issues and also
hdmi v1.4 support.

this is based on git repository below:
git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git,
branch name: drm-fixes
commit-id: 28a4d5675857f6386930a324317281cb8ed1e5d0

and you can refer to our working repository below:
http://git.infradead.org/users/kmpark/linux-2.6-samsung,
branch name: exynos-drm-fixes

Thanks.

Eun-Chul Kim (1):
  drm/exynos: added panel physical size.

Inki Dae (5):
  drm/exynos: added possible_clones setup function.
  drm/exynos: fixed page flip issue.
  drm/exynos: removed exynos_drm_fbdev_recreate function.
  drm/exynos: added mode_fixup feature and code clean.
  drm/exynos: added postclose to release resource.

Joonyoung Shim (4):
  drm/exynos: added hdmi version 1.4 support.
  drm/exynos: fixed hdmi 720p config.
  drm/exynos: changed priority of mixer layers.
  drm/exynos: removed pageflip_event_list init code when closed.

Masanari Iida (1):
  drm/exynos: Fix typo in exynos_mixer.c

 drivers/gpu/drm/exynos/exynos_drm_connector.c |   41 +-
 drivers/gpu/drm/exynos/exynos_drm_core.c  |3 +
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |   12 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |   26 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |   12 +-
 drivers/gpu/drm/exynos/exynos_drm_encoder.c   |   51 +-
 drivers/gpu/drm/exynos/exynos_drm_encoder.h   |1 +
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |   70 +--
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  |   34 +-
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c  |   28 +
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h  |5 +
 drivers/gpu/drm/exynos/exynos_hdmi.c  | 1225 +++--
 drivers/gpu/drm/exynos/exynos_hdmi.h  |   10 +-
 drivers/gpu/drm/exynos/exynos_mixer.c |   19 +-
 drivers/gpu/drm/exynos/regs-hdmi.h|  306 ++-
 include/drm/exynos_drm.h  |   19 +-
 16 files changed, 1601 insertions(+), 261 deletions(-)

-- 
1.7.4.1



Re: [PATCH 6/7] drm/i915: i2c: unconditionally set up gpio fallback

2012-02-14 Thread Eugeni Dodonov
On Tue, Feb 14, 2012 at 19:37, Daniel Vetter  wrote:

>/* Hardware may not support GMBUS over these pins? Try GPIO
> bitbanging instead. */
> -   bus->force_bit = intel_gpio_create(bus, bus->reg0 & 0xff);
> -   if (!bus->force_bit)
> -   ret = -ENOMEM;
> -   else
> -   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
> +   ret = -EIO;
> +   if (bus->has_gpio) {
> +   bus->force_bit = true;
> +   ret = intel_i2c_quirk_xfer(bus, msgs, num);
> +   }
>


Wouldn't it be cleaner and more consistent with the rest of the code to use:

if (!bus->has_gpio)
ret = -EIO;
else {
bus->force_bit = true;
ret = intel_i2c_quirk_xfer(bus, msgs, num);
}

instead?


Other than that, it looks correct to me, and certainly makes code more
clean.

Reviewed-by: Eugeni Dodonov 

-- 
Eugeni Dodonov

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/i915: i2c: unconditionally set up gpio fallback

2012-02-14 Thread Daniel Vetter
This way we can simplify the setup and teardown a bit.

Because we don't actually allocate anything anymore for the force_bit
case, we can now convert that into a boolean.

Also and the functionality supported by the bit-banging together with
what gmbus can do, so that this doesn't randomly change any more.

v2: Chris Wilson noticed that I've mixed up && and & ...

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |3 +-
 drivers/gpu/drm/i915/intel_i2c.c |   50 ++---
 2 files changed, 21 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 14b6e94..31affc0 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -293,7 +293,8 @@ struct intel_fbc_work;
 
 struct intel_gmbus {
struct i2c_adapter adapter;
-   struct i2c_adapter *force_bit;
+   bool force_bit;
+   bool has_gpio;
u32 reg0;
u32 gpio_reg;
struct i2c_algo_bit_data bit_algo;
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 6eb68b7..5e89680 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -140,8 +140,8 @@ static void set_data(void *data, int state_high)
POSTING_READ(bus->gpio_reg);
 }
 
-static struct i2c_adapter *
-intel_gpio_create(struct intel_gmbus *bus, u32 pin)
+static bool
+intel_gpio_setup(struct intel_gmbus *bus, u32 pin)
 {
struct drm_i915_private *dev_priv = bus->dev_priv;
static const int map_pin_to_reg[] = {
@@ -157,7 +157,7 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
struct i2c_algo_bit_data *algo;
 
if (pin >= ARRAY_SIZE(map_pin_to_reg) || !map_pin_to_reg[pin])
-   return NULL;
+   return false;
 
algo = &bus->bit_algo;
 
@@ -174,12 +174,11 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
algo->timeout = usecs_to_jiffies(2200);
algo->data = bus;
 
-   return &bus->adapter;
+   return true;
 }
 
 static int
 intel_i2c_quirk_xfer(struct intel_gmbus *bus,
-struct i2c_adapter *adapter,
 struct i2c_msg *msgs,
 int num)
 {
@@ -193,7 +192,7 @@ intel_i2c_quirk_xfer(struct intel_gmbus *bus,
set_clock(bus, 1);
udelay(I2C_RISEFALL_TIME);
 
-   ret = i2c_bit_xfer(adapter, msgs, num);
+   ret = i2c_bit_xfer(&bus->adapter, msgs, num);
 
set_data(bus, 1);
set_clock(bus, 1);
@@ -216,7 +215,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
mutex_lock(&dev_priv->gmbus_mutex);
 
if (bus->force_bit) {
-   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
+   ret = intel_i2c_quirk_xfer(bus, msgs, num);
goto out;
}
 
@@ -311,11 +310,11 @@ timeout:
I915_WRITE(GMBUS0 + reg_offset, 0);
 
/* Hardware may not support GMBUS over these pins? Try GPIO bitbanging 
instead. */
-   bus->force_bit = intel_gpio_create(bus, bus->reg0 & 0xff);
-   if (!bus->force_bit)
-   ret = -ENOMEM;
-   else
-   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
+   ret = -EIO;
+   if (bus->has_gpio) {
+   bus->force_bit = true;
+   ret = intel_i2c_quirk_xfer(bus, msgs, num);
+   }
 out:
mutex_unlock(&dev_priv->gmbus_mutex);
return ret;
@@ -323,14 +322,8 @@ out:
 
 static u32 gmbus_func(struct i2c_adapter *adapter)
 {
-   struct intel_gmbus *bus = container_of(adapter,
-  struct intel_gmbus,
-  adapter);
-
-   if (bus->force_bit)
-   i2c_bit_func(bus->force_bit);
-
-   return (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
+   return i2c_bit_func(adapter) &
+   (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
/* I2C_FUNC_10BIT_ADDR | */
I2C_FUNC_SMBUS_READ_BLOCK_DATA |
I2C_FUNC_SMBUS_BLOCK_PROC_CALL);
@@ -388,8 +381,11 @@ int intel_setup_gmbus(struct drm_device *dev)
/* By default use a conservative clock rate */
bus->reg0 = i | GMBUS_RATE_100KHZ;
 
+   bus->has_gpio = intel_gpio_setup(bus, i);
+
/* XXX force bit banging until GMBUS is fully debugged */
-   bus->force_bit = intel_gpio_create(bus, i);
+   if (bus->has_gpio)
+   bus->force_bit = true;
}
 
intel_i2c_reset(dev_priv->dev);
@@ -417,16 +413,8 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, 
bool force_bit)
 {
struct intel_gmbus *bus = to_intel_gmbus(adapter);
 
-   if (force_bit) {
-   if (bus->force_bit == NULL) {
-   bus->force_bit = intel_gpio_create(bus,
-  bus->reg0 & 0xff);
-   

[Bug 45968] [RADEON:KMS:RS780:HD3200] l 2560x1440 detected by monitor as 1280x1440, every second pixel missing

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=45968

Alex Deucher  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||NOTOURBUG

--- Comment #10 from Alex Deucher  2012-02-14 06:01:56 PST 
---
Seems like the oem may not have wired up the DVI port correctly for duallink.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[PATCH 7/7] drm/i915: reenable gmbus on gen3+ again

2012-02-14 Thread Daniel Vetter
With the rework to merge the bit-banging fallback into the gmbus
i2c adapter we've gotten rid of the deadlock possibility that
originally lead to the disabling of this code.

This reverts the revert

commit 826c7e4147f902737b281e8a5a7d7aa33fd63316
Author: Jean Delvare 
Date:   Sat Jun 4 19:34:56 2011 +

Revert "drm/i915: Enable GMBUS for post-gen2 chipsets"

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=35572
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/intel_i2c.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 9791546..2ec5f0d 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -384,7 +384,7 @@ int intel_setup_gmbus(struct drm_device *dev)
bus->has_gpio = intel_gpio_setup(bus, i);
 
/* XXX force bit banging until GMBUS is fully debugged */
-   if (bus->has_gpio)
+   if (bus->has_gpio && IS_GEN2(dev))
bus->force_bit = true;
}
 
-- 
1.7.7.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 6/7] drm/i915: i2c: unconditionally set up gpio fallback

2012-02-14 Thread Daniel Vetter
This way we can simplify the setup and teardown a bit.

Because we don't actually allocate anything anymore for the force_bit
case, we can now convert that into a boolean.

Also and the functionality supported by the bit-banging together with
what gmbus can do, so that this doesn't randomly change any more.

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |3 +-
 drivers/gpu/drm/i915/intel_i2c.c |   50 ++---
 2 files changed, 21 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 14b6e94..31affc0 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -293,7 +293,8 @@ struct intel_fbc_work;
 
 struct intel_gmbus {
struct i2c_adapter adapter;
-   struct i2c_adapter *force_bit;
+   bool force_bit;
+   bool has_gpio;
u32 reg0;
u32 gpio_reg;
struct i2c_algo_bit_data bit_algo;
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 6eb68b7..9791546 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -140,8 +140,8 @@ static void set_data(void *data, int state_high)
POSTING_READ(bus->gpio_reg);
 }
 
-static struct i2c_adapter *
-intel_gpio_create(struct intel_gmbus *bus, u32 pin)
+static bool
+intel_gpio_setup(struct intel_gmbus *bus, u32 pin)
 {
struct drm_i915_private *dev_priv = bus->dev_priv;
static const int map_pin_to_reg[] = {
@@ -157,7 +157,7 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
struct i2c_algo_bit_data *algo;
 
if (pin >= ARRAY_SIZE(map_pin_to_reg) || !map_pin_to_reg[pin])
-   return NULL;
+   return false;
 
algo = &bus->bit_algo;
 
@@ -174,12 +174,11 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
algo->timeout = usecs_to_jiffies(2200);
algo->data = bus;
 
-   return &bus->adapter;
+   return true;
 }
 
 static int
 intel_i2c_quirk_xfer(struct intel_gmbus *bus,
-struct i2c_adapter *adapter,
 struct i2c_msg *msgs,
 int num)
 {
@@ -193,7 +192,7 @@ intel_i2c_quirk_xfer(struct intel_gmbus *bus,
set_clock(bus, 1);
udelay(I2C_RISEFALL_TIME);
 
-   ret = i2c_bit_xfer(adapter, msgs, num);
+   ret = i2c_bit_xfer(&bus->adapter, msgs, num);
 
set_data(bus, 1);
set_clock(bus, 1);
@@ -216,7 +215,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
mutex_lock(&dev_priv->gmbus_mutex);
 
if (bus->force_bit) {
-   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
+   ret = intel_i2c_quirk_xfer(bus, msgs, num);
goto out;
}
 
@@ -311,11 +310,11 @@ timeout:
I915_WRITE(GMBUS0 + reg_offset, 0);
 
/* Hardware may not support GMBUS over these pins? Try GPIO bitbanging 
instead. */
-   bus->force_bit = intel_gpio_create(bus, bus->reg0 & 0xff);
-   if (!bus->force_bit)
-   ret = -ENOMEM;
-   else
-   ret = intel_i2c_quirk_xfer(bus, bus->force_bit, msgs, num);
+   ret = -EIO;
+   if (bus->has_gpio) {
+   bus->force_bit = true;
+   ret = intel_i2c_quirk_xfer(bus, msgs, num);
+   }
 out:
mutex_unlock(&dev_priv->gmbus_mutex);
return ret;
@@ -323,14 +322,8 @@ out:
 
 static u32 gmbus_func(struct i2c_adapter *adapter)
 {
-   struct intel_gmbus *bus = container_of(adapter,
-  struct intel_gmbus,
-  adapter);
-
-   if (bus->force_bit)
-   i2c_bit_func(bus->force_bit);
-
-   return (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
+   return i2c_bit_func(adapter) &&
+   (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
/* I2C_FUNC_10BIT_ADDR | */
I2C_FUNC_SMBUS_READ_BLOCK_DATA |
I2C_FUNC_SMBUS_BLOCK_PROC_CALL);
@@ -388,8 +381,11 @@ int intel_setup_gmbus(struct drm_device *dev)
/* By default use a conservative clock rate */
bus->reg0 = i | GMBUS_RATE_100KHZ;
 
+   bus->has_gpio = intel_gpio_setup(bus, i);
+
/* XXX force bit banging until GMBUS is fully debugged */
-   bus->force_bit = intel_gpio_create(bus, i);
+   if (bus->has_gpio)
+   bus->force_bit = true;
}
 
intel_i2c_reset(dev_priv->dev);
@@ -417,16 +413,8 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, 
bool force_bit)
 {
struct intel_gmbus *bus = to_intel_gmbus(adapter);
 
-   if (force_bit) {
-   if (bus->force_bit == NULL) {
-   bus->force_bit = intel_gpio_create(bus,
-  bus->reg0 & 0xff);
-   }
-   } else {
-   if (bus->force_bit) {

[PATCH 5/7] drm/i915: merge gmbus and gpio i2c adpater into one

2012-02-14 Thread Daniel Vetter
... and directly call the newly exported i2c bit-banging functions.

The code is still pretty convoluted because we only set up the gpio
i2c stuff when actually falling back, resulting in more complexity
than necessary. This will be fixed up in the next patch.

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |2 ++
 drivers/gpu/drm/i915/intel_i2c.c |   38 +-
 2 files changed, 7 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f137b1d..14b6e94 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -35,6 +35,7 @@
 #include "intel_ringbuffer.h"
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -295,6 +296,7 @@ struct intel_gmbus {
struct i2c_adapter *force_bit;
u32 reg0;
u32 gpio_reg;
+   struct i2c_algo_bit_data bit_algo;
struct drm_i915_private *dev_priv;
 };
 
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index b9f17cb..6eb68b7 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -154,29 +154,18 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
0,
GPIOF,
};
-   struct i2c_adapter *adapter;
struct i2c_algo_bit_data *algo;
 
if (pin >= ARRAY_SIZE(map_pin_to_reg) || !map_pin_to_reg[pin])
return NULL;
 
-   adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
-   if (adapter == NULL)
-   return NULL;
-
-   algo = kzalloc(sizeof(struct i2c_algo_bit_data), GFP_KERNEL);
-   if (algo == NULL)
-   goto out_adap;
+   algo = &bus->bit_algo;
 
bus->gpio_reg = map_pin_to_reg[pin];
if (HAS_PCH_SPLIT(dev_priv->dev))
bus->gpio_reg += PCH_GPIOA - GPIOA;
 
-   snprintf(adapter->name, sizeof(adapter->name),
-"i915 GPIO%c", "?BACDE?F"[pin]);
-   adapter->owner = THIS_MODULE;
-   adapter->algo_data = algo;
-   adapter->dev.parent = &dev_priv->dev->pdev->dev;
+   bus->adapter.algo_data = algo;
algo->setsda = set_data;
algo->setscl = set_clock;
algo->getsda = get_data;
@@ -185,16 +174,7 @@ intel_gpio_create(struct intel_gmbus *bus, u32 pin)
algo->timeout = usecs_to_jiffies(2200);
algo->data = bus;
 
-   if (i2c_bit_add_bus(adapter))
-   goto out_algo;
-
-   return adapter;
-
-out_algo:
-   kfree(algo);
-out_adap:
-   kfree(adapter);
-   return NULL;
+   return &bus->adapter;
 }
 
 static int
@@ -213,7 +193,7 @@ intel_i2c_quirk_xfer(struct intel_gmbus *bus,
set_clock(bus, 1);
udelay(I2C_RISEFALL_TIME);
 
-   ret = adapter->algo->master_xfer(adapter, msgs, num);
+   ret = i2c_bit_xfer(adapter, msgs, num);
 
set_data(bus, 1);
set_clock(bus, 1);
@@ -348,7 +328,7 @@ static u32 gmbus_func(struct i2c_adapter *adapter)
   adapter);
 
if (bus->force_bit)
-   bus->force_bit->algo->functionality(bus->force_bit);
+   i2c_bit_func(bus->force_bit);
 
return (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
/* I2C_FUNC_10BIT_ADDR | */
@@ -444,9 +424,6 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, 
bool force_bit)
}
} else {
if (bus->force_bit) {
-   i2c_del_adapter(bus->force_bit);
-   kfree(bus->force_bit->algo);
-   kfree(bus->force_bit);
bus->force_bit = NULL;
}
}
@@ -462,11 +439,6 @@ void intel_teardown_gmbus(struct drm_device *dev)
 
for (i = 0; i < GMBUS_NUM_PORTS; i++) {
struct intel_gmbus *bus = &dev_priv->gmbus[i];
-   if (bus->force_bit) {
-   i2c_del_adapter(bus->force_bit);
-   kfree(bus->force_bit->algo);
-   kfree(bus->force_bit);
-   }
i2c_del_adapter(&bus->adapter);
}
 
-- 
1.7.7.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 4/7] drm/i915: merge struct intel_gpio into struct intel_gmbus

2012-02-14 Thread Daniel Vetter
When we set up the gpio fallback, we always have a 1:1 relationship
with an intel_gmbus. Exploit that to store all gpio related data in
there, too. This is a preparation step to merge the tw i2c adapters
controlling the same bus into one.

Just mundane code-munging in this patch.

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |1 +
 drivers/gpu/drm/i915/intel_i2c.c |  144 +++---
 2 files changed, 72 insertions(+), 73 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ed40743..f137b1d 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -294,6 +294,7 @@ struct intel_gmbus {
struct i2c_adapter adapter;
struct i2c_adapter *force_bit;
u32 reg0;
+   u32 gpio_reg;
struct drm_i915_private *dev_priv;
 };
 
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index f496510..b9f17cb 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -45,13 +45,6 @@ to_intel_gmbus(struct i2c_adapter *i2c)
return container_of(i2c, struct intel_gmbus, adapter);
 }
 
-struct intel_gpio {
-   struct i2c_adapter adapter;
-   struct i2c_algo_bit_data algo;
-   struct drm_i915_private *dev_priv;
-   u32 reg;
-};
-
 void
 intel_i2c_reset(struct drm_device *dev)
 {
@@ -78,15 +71,15 @@ static void intel_i2c_quirk_set(struct drm_i915_private 
*dev_priv, bool enable)
I915_WRITE(DSPCLK_GATE_D, val);
 }
 
-static u32 get_reserved(struct intel_gpio *gpio)
+static u32 get_reserved(struct intel_gmbus *bus)
 {
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
struct drm_device *dev = dev_priv->dev;
u32 reserved = 0;
 
/* On most chips, these bits must be preserved in software. */
if (!IS_I830(dev) && !IS_845G(dev))
-   reserved = I915_READ_NOTRACE(gpio->reg) &
+   reserved = I915_READ_NOTRACE(bus->gpio_reg) &
 (GPIO_DATA_PULLUP_DISABLE |
  GPIO_CLOCK_PULLUP_DISABLE);
 
@@ -95,29 +88,29 @@ static u32 get_reserved(struct intel_gpio *gpio)
 
 static int get_clock(void *data)
 {
-   struct intel_gpio *gpio = data;
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
-   u32 reserved = get_reserved(gpio);
-   I915_WRITE_NOTRACE(gpio->reg, reserved | GPIO_CLOCK_DIR_MASK);
-   I915_WRITE_NOTRACE(gpio->reg, reserved);
-   return (I915_READ_NOTRACE(gpio->reg) & GPIO_CLOCK_VAL_IN) != 0;
+   struct intel_gmbus *bus = data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
+   u32 reserved = get_reserved(bus);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved | GPIO_CLOCK_DIR_MASK);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved);
+   return (I915_READ_NOTRACE(bus->gpio_reg) & GPIO_CLOCK_VAL_IN) != 0;
 }
 
 static int get_data(void *data)
 {
-   struct intel_gpio *gpio = data;
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
-   u32 reserved = get_reserved(gpio);
-   I915_WRITE_NOTRACE(gpio->reg, reserved | GPIO_DATA_DIR_MASK);
-   I915_WRITE_NOTRACE(gpio->reg, reserved);
-   return (I915_READ_NOTRACE(gpio->reg) & GPIO_DATA_VAL_IN) != 0;
+   struct intel_gmbus *bus = data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
+   u32 reserved = get_reserved(bus);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved | GPIO_DATA_DIR_MASK);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved);
+   return (I915_READ_NOTRACE(bus->gpio_reg) & GPIO_DATA_VAL_IN) != 0;
 }
 
 static void set_clock(void *data, int state_high)
 {
-   struct intel_gpio *gpio = data;
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
-   u32 reserved = get_reserved(gpio);
+   struct intel_gmbus *bus = data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
+   u32 reserved = get_reserved(bus);
u32 clock_bits;
 
if (state_high)
@@ -126,15 +119,15 @@ static void set_clock(void *data, int state_high)
clock_bits = GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_DIR_MASK |
GPIO_CLOCK_VAL_MASK;
 
-   I915_WRITE_NOTRACE(gpio->reg, reserved | clock_bits);
-   POSTING_READ(gpio->reg);
+   I915_WRITE_NOTRACE(bus->gpio_reg, reserved | clock_bits);
+   POSTING_READ(bus->gpio_reg);
 }
 
 static void set_data(void *data, int state_high)
 {
-   struct intel_gpio *gpio = data;
-   struct drm_i915_private *dev_priv = gpio->dev_priv;
-   u32 reserved = get_reserved(gpio);
+   struct intel_gmbus *bus = data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
+   u32 reserved = get_reserved(bus);
u32 data_bits;
 
if (state_high)
@@ -143,13 +136,14 @@ static void set_data(void *data, int state_high)

[PATCH 3/7] i2c: export bit-banging algo functions

2012-02-14 Thread Daniel Vetter
i915 has a hw i2c controller (gmbus) but for a bunch of stupid reasons
we need to be able to fall back to the bit-banging algo on gpio pins.

The current code sets up a 2nd i2c controller for the same i2c bus using
the bit-banging algo. This has a bunch of issues, the major one being
that userspace can directly access this fallback i2c adaptor behind
the drivers back.

But we need to frob a few registers before and after using fallback
gpio bit-banging, so this horribly fails.

The new plan is to only set up one i2c adaptor and transparently fall
back to bit-banging by directly calling the xfer function of the bit-
banging algo in the i2c core.

To make that possible, export the 2 i2c algo functions.

Signed-off-by: Daniel Vetter 
---
 drivers/i2c/algos/i2c-algo-bit.c |   12 +++-
 include/linux/i2c-algo-bit.h |4 
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index 525c734..ec1651a 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -531,8 +531,8 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, 
struct i2c_msg *msg)
return 0;
 }
 
-static int bit_xfer(struct i2c_adapter *i2c_adap,
-   struct i2c_msg msgs[], int num)
+int i2c_bit_xfer(struct i2c_adapter *i2c_adap,
+struct i2c_msg msgs[], int num)
 {
struct i2c_msg *pmsg;
struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
@@ -598,21 +598,23 @@ bailout:
adap->post_xfer(i2c_adap);
return ret;
 }
+EXPORT_SYMBOL(i2c_bit_xfer);
 
-static u32 bit_func(struct i2c_adapter *adap)
+u32 i2c_bit_func(struct i2c_adapter *adap)
 {
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
   I2C_FUNC_SMBUS_READ_BLOCK_DATA |
   I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
   I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
 }
+EXPORT_SYMBOL(i2c_bit_func);
 
 
 /* -exported algorithm data: - */
 
 static const struct i2c_algorithm i2c_bit_algo = {
-   .master_xfer= bit_xfer,
-   .functionality  = bit_func,
+   .master_xfer= i2c_bit_xfer,
+   .functionality  = i2c_bit_func,
 };
 
 /*
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h
index 4f98148..cdd6336 100644
--- a/include/linux/i2c-algo-bit.h
+++ b/include/linux/i2c-algo-bit.h
@@ -47,6 +47,10 @@ struct i2c_algo_bit_data {
int timeout;/* in jiffies */
 };
 
+int i2c_bit_xfer(struct i2c_adapter *i2c_adap,
+struct i2c_msg msgs[], int num);
+u32 i2c_bit_func(struct i2c_adapter *adap);
+
 int i2c_bit_add_bus(struct i2c_adapter *);
 int i2c_bit_add_numbered_bus(struct i2c_adapter *);
 
-- 
1.7.7.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/7] drm/nouveau: do a better job at hiding the NIH i2c bit-banging algo

2012-02-14 Thread Daniel Vetter
I'd like to export the corresponding functions from the i2c core
so that I can use them in fallback bit-banging in i915.ko

Cc: nouv...@lists.freedesktop.org
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/nouveau/nouveau_i2c.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c 
b/drivers/gpu/drm/nouveau/nouveau_i2c.c
index 820ae7f..7a7e751 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.c
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c
@@ -242,7 +242,7 @@ i2c_addr(struct nouveau_i2c_chan *port, struct i2c_msg *msg)
 }
 
 static int
-i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+nouveau_i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 {
struct nouveau_i2c_chan *port = (struct nouveau_i2c_chan *)adap;
struct i2c_msg *msg = msgs;
@@ -272,14 +272,14 @@ i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg 
*msgs, int num)
 }
 
 static u32
-i2c_bit_func(struct i2c_adapter *adap)
+nouveau_i2c_bit_func(struct i2c_adapter *adap)
 {
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
 }
 
 const struct i2c_algorithm i2c_bit_algo = {
-   .master_xfer = i2c_bit_xfer,
-   .functionality = i2c_bit_func
+   .master_xfer = nouveau_i2c_bit_xfer,
+   .functionality = nouveau_i2c_bit_func
 };
 
 static const uint32_t nv50_i2c_port[] = {
-- 
1.7.7.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/7] drm/i915: add dev_priv to intel_gmbus

2012-02-14 Thread Daniel Vetter
This way we can free up the bus->adaptor.algo_data pointer and make it
available for use with the bitbanging fallback algo.

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.h  |   13 -
 drivers/gpu/drm/i915/intel_i2c.c |6 +++---
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8e3eb5e..ed40743 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -290,6 +290,13 @@ enum intel_pch {
 struct intel_fbdev;
 struct intel_fbc_work;
 
+struct intel_gmbus {
+   struct i2c_adapter adapter;
+   struct i2c_adapter *force_bit;
+   u32 reg0;
+   struct drm_i915_private *dev_priv;
+};
+
 typedef struct drm_i915_private {
struct drm_device *dev;
 
@@ -307,11 +314,7 @@ typedef struct drm_i915_private {
/** gt_lock is also taken in irq contexts. */
struct spinlock gt_lock;
 
-   struct intel_gmbus {
-   struct i2c_adapter adapter;
-   struct i2c_adapter *force_bit;
-   u32 reg0;
-   } *gmbus;
+   struct intel_gmbus *gmbus;
 
/** gmbus_mutex protects against concurrent usage of the single hw gmbus
 * controller on different i2c buses. */
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index fc75d71..f496510 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -232,7 +232,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
struct intel_gmbus *bus = container_of(adapter,
   struct intel_gmbus,
   adapter);
-   struct drm_i915_private *dev_priv = adapter->algo_data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
int i, reg_offset, ret;
 
mutex_lock(&dev_priv->gmbus_mutex);
@@ -401,7 +401,7 @@ int intel_setup_gmbus(struct drm_device *dev)
 names[i]);
 
bus->adapter.dev.parent = &dev->pdev->dev;
-   bus->adapter.algo_data  = dev_priv;
+   bus->dev_priv = dev_priv;
 
bus->adapter.algo = &gmbus_algorithm;
ret = i2c_add_adapter(&bus->adapter);
@@ -442,7 +442,7 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, 
bool force_bit)
 
if (force_bit) {
if (bus->force_bit == NULL) {
-   struct drm_i915_private *dev_priv = adapter->algo_data;
+   struct drm_i915_private *dev_priv = bus->dev_priv;
bus->force_bit = intel_gpio_create(dev_priv,
   bus->reg0 & 0xff);
}
-- 
1.7.7.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PULL] drm-intel-next

2012-02-14 Thread Daniel Vetter
Hi Dave,

qa just reported on the latest drm-intel-next tree testing and found no
regression. My own testing also hasn't revealed any surprises. The old
tree had 3 outstanding issues:
- this pull request contains a fix for the harmless but annoying i855gm
  dmesg splatter issue
- an otherwise harmless dmesg error about dp is gone with latest -fixes
  merged into -next
- the modeset failures have been tracked down to the additional cea modes
  detected with 3.3-rc1, so not a drm-intel-next issue. Investigation is
  still going on.

Highlights of this pull request:
- quite a few correctness reworks in corner cases (pwrite, swap-in
  swizzling, fence accounting, ...) - i-g-t tests are now rather happy
  about this kernel.
- ilk vt-d infinite recursion due to w/a fixes from Ben
- sprite watermark code from Jesse
- big refactoring and extension of the error_state capture code (still
  more patches to come and some already queued up for -next)
- random set of smaller things (MI_WTF, pageflip on gen2, dp audio, ...)

As usual, qa report below the pull request.

Cheers, Daniel

The following changes since commit 3d29b842e58fbca2c13a9f458fddbaa535c6e578:

  drm/i915: add a LLC feature flag in device description (2012-01-17 20:01:45 
+0100)

are available in the git repository at:

  git://people.freedesktop.org/~danvet/drm-intel drm-intel-next-2012-02-07

for you to fetch changes up to 172975aa746e155533cb386c7159c2d6510e2bc8:

  drm/i915: Handle unmappable buffers during error state capture (2012-01-31 
21:02:54 +0100)


Ben Widawsky (3):
  drm/i915: argument to control retiring behavior
  drm/i915: drm/i915: Fix recursive calls to unmap
  drm/i915: correct lock type in destroy

Chris Wilson (3):
  drm/i915: Separate fence pin counting from normal bind pin counting
  drm/i915: Remove the upper limit on the bo size for mapping into the CPU 
domain
  drm/i915: Handle unmappable buffers during error state capture

Daniel Vetter (18):
  drm/i915: clarify gen2 pageflip cmd
  drm/i915: fixup assert_pipe to take the pipe A quirk into account
  drm/i915: switch ring->id to be a real id
  drm/i915: refactor ring error state capture to use arrays
  drm/i915: collect more per ring error state
  drm/i915/ringbuffer: kill snb blt workaround
  drm/i915: don't trash the gtt when running out of fences
  drm/i915: refactor debugfs open function
  drm/i915: refactor debugfs create functions
  drm/i915: capture error_state also for stuck rings
  drm/i915: remove the i915_batchbuffer_info debugfs file
  drm/i915: reject GTT domain in relocations
  drm/i915: add per-ring fault reg to error_state
  drm/i915: fix swizzle detection for gen3
  drm/i915: add debugfs file for swizzling information
  drm/i915: fall through pwrite_gtt_slow to the shmem slow path
  drm/i915: rewrite shmem_pwrite_slow to use copy_from_user
  drm/i915: rewrite shmem_pread_slow to use copy_to_user

Eric Anholt (2):
  drm/i915: Remove the MI_FLUSH_ENABLE setting.
  drm/i915: Correct the bit number for the MI_FLUSH_ENABLE.

Eugeni Dodonov (1):
  drm/i915: print out which pixel format we do not support

Jesse Barnes (1):
  drm/i915: properly mask and or watermark values for sprites

Wu Fengguang (1):
  drm/i915: set AUD_CONFIG N_value_index for DisplayPort

 drivers/gpu/drm/i915/i915_debugfs.c|  241 -
 drivers/gpu/drm/i915/i915_dma.c|2 +-
 drivers/gpu/drm/i915/i915_drv.h|   53 +++--
 drivers/gpu/drm/i915/i915_gem.c|  394 
 drivers/gpu/drm/i915/i915_gem_evict.c  |2 +-
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  150 +++
 drivers/gpu/drm/i915/i915_gem_gtt.c|2 +-
 drivers/gpu/drm/i915/i915_gem_tiling.c |4 +-
 drivers/gpu/drm/i915/i915_irq.c|  116 +
 drivers/gpu/drm/i915/i915_reg.h|   30 ++-
 drivers/gpu/drm/i915/intel_display.c   |   57 +++-
 drivers/gpu/drm/i915/intel_drv.h   |1 +
 drivers/gpu/drm/i915/intel_overlay.c   |6 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c|   97 +--
 drivers/gpu/drm/i915/intel_ringbuffer.h|   20 +-
 drivers/gpu/drm/i915/intel_sprite.c|4 +-
 16 files changed, 575 insertions(+), 604 deletions(-)


On Tue, Feb 14, 2012 at 07:56:36AM +, Sun, Yi wrote:
> We performed a round of unstable kernel testing with the latest version on 
> Daniel's drm-intel-testing branch.
> The platform which we covered are Ivybridge, Sandybridge, Ironlake, 965g, 
> 945g and Pineview.
> 
> Kernel commit:
> commit 396ee23db6b76354e487fd2cfdacbd989442f81d
> Merge: 172975a c898261
> Author: Daniel Vetter 
> Date:   Tue Feb 7 23:30:10 2012 +0100
> 
> Merge remote-tracking branch 'keithp-kernel/drm-intel-fixes' into 
> drm-intel-testing
> 
> 
> In this round of testing, two new bugs are f

[patch] drm/radeon/evergreen: make texdw[] array larger

2012-02-14 Thread Jerome Glisse
On Tue, Feb 14, 2012 at 10:38:11AM +0300, Dan Carpenter wrote:
> We store stuff in texdw[7] so this array needs to have 8 elements.
> 
> Signed-off-by: Dan Carpenter 
Reviewed-by: Jerome Glisse 
> 
> diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
> b/drivers/gpu/drm/radeon/evergreen_cs.c
> index 2ed17f7..49203b6 100644
> --- a/drivers/gpu/drm/radeon/evergreen_cs.c
> +++ b/drivers/gpu/drm/radeon/evergreen_cs.c
> @@ -638,7 +638,7 @@ static int evergreen_cs_track_validate_texture(struct 
> radeon_cs_parser *p,
>   struct eg_surface surf;
>   unsigned long toffset, moffset;
>   unsigned dim, llevel, mslice, width, height, depth, i;
> - u32 texdw[7];
> + u32 texdw[8];
>   int r;
>  
>   texdw[0] = radeon_get_ib_value(p, idx + 0);


[Bug 45880] Xorg crash with ColorTiling2D patch (r600g)

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45880

--- Comment #3 from Jerome Glisse  2012-02-14 12:54:39 
PST ---
I pushed a fix please confirm that it also works for you

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 27184] Radeon, KMS, 6.12.99: Sleeping screen doesn't wake up reliably

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=27184

--- Comment #21 from Oliver Winker  2012-02-14 12:36:44 
PST ---
Hi,

Just for info: in my case, since quite some time using 3.1 and 3.2 (and on 
debian xorg 7.6+11, radeon 6.14.3-2) the screen wake-up works quite reliable 
now,
without the xset dpms workaround.

I kept postponing to give an update on this on - sorry. Anyway, it looks better 
here in the meanwhile ;).

BR, Oliver

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 27184] Radeon, KMS, 6.12.99: Sleeping screen doesn't wake up reliably

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=27184

--- Comment #20 from Alex Deucher  2012-02-14 11:07:38 PST ---
Does kernel 3.3rc3 or newer work any better?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 45968] [RADEON:KMS:RS780:HD3200] l 2560x1440 detected by monitor as 1280x1440, every second pixel missing

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=45968

--- Comment #9 from Tobias Diedrich  
2012-02-14 03:00:35 PST ---
FWIW using HDMI on 3.3-rc I can go up to 2560x1440 at 48, but 2560x1440 at 60 
is above the 340MHz pixelclock limit for one link.

I installed XP yesterday and found that it shows the same problem with 
dual-link not working properly, so this seems to be just a case of bad HW.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[PATCH 00/11] drm/exynos: fixed exynos drm driver.

2012-02-14 Thread Dave Airlie
On Tue, Feb 14, 2012 at 7:52 AM, Inki Dae  wrote:
> this patch set fixes page flip and mode setting issues and also
> hdmi v1.4 support.

Adding hdmi v1.4 support doesn't seem like a fix to me, it seems like
a new feature.

This should be in a -next tree, if you want to have fixes in 3.3 then
please resend a -fixes tree
with no new features, and put hdmi1.4 into a -next branch.

Dave.


[PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-14 Thread Daniel Vetter
On Mon, Feb 13, 2012 at 05:36:54PM -0500, Yufeng Shen wrote:
> Moved gmbus_mutex below intel_gmbus and added comments.
> Rebased to drm-intel-next-queued.
> 
> 
> 
> GMBUS has several ports and each has it's own corresponding
> I2C adpater. When multiple I2C adapters call gmbus_xfer() at
> the same time there is a race condition in using the underlying
> GMBUS controller. Fixing this by adding a mutex lock when calling
> gmbus_xfer().
> 
> Signed-off-by: Yufeng Shen 

Queued for -next (with some slight modifications in the comments), thanks
for the patch.
-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48


[Bug 27184] Radeon, KMS, 6.12.99: Sleeping screen doesn't wake up reliably

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=27184

--- Comment #19 from tomi.or...@ncircle.nullnet.fi 2012-02-14 10:43:41 PST ---
Sorry about the disappearence for a long time. I thought I had enabled the 
notifications for this bug.

It seems that I still have this very same problem even with kernel.org 3.2.5 
kernel. The previously mentioned workaround "xset dpms 0 240 0" that helped
someone, did not work in my setup at all.

In case the following debug info helps at all:

get-edid | parse-edid
get-edid: get-edid version 2.0.0

Performing real mode VBE call
Interrupt 0x10 ax=0x4f00 bx=0x0 cx=0x0
Function supported
Call successful

VBE version 300
VBE string at 0xc0204 "ATI ATOMBIOS"

VBE/DDC service about to be called
Report DDC capabilities

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x0 cx=0x0
Function supported
Call successful

Monitor and video card combination does not support DDC1 transfers
Monitor and video card combination supports DDC2 transfers
0 seconds per 128 byte EDID block transfer
Screen is not blanked during DDC transfer

Reading next EDID block

VBE/DDC service about to be called
Read EDID

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x1 cx=0x0
[/pub/linux/kernel]
alderan#root>get-edid | parse-edid 2>&1 
get-edid: get-edid version 2.0.0

Performing real mode VBE call
Interrupt 0x10 ax=0x4f00 bx=0x0 cx=0x0
Function supported
Call successful

VBE version 300
VBE string at 0xc0204 "ATI ATOMBIOS"

VBE/DDC service about to be called
Report DDC capabilities

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x0 cx=0x0
Function supported
Call successful

Monitor and video card combination does not support DDC1 transfers
Monitor and video card combination supports DDC2 transfers
0 seconds per 128 byte EDID block transfer
Screen is not blanked during DDC transfer

Reading next EDID block

VBE/DDC service about to be called
Read EDID

Performing real mode VBE call
Interrupt 0x10 ax=0x4f15 bx=0x1 cx=0x0
parse-edid: parse-edid version 2.0.0
Function supported
Call successful

parse-edid: EDID checksum passed.

# EDID version 1 revision 3
Section "Monitor"
# Block type: 2:0 3:ff
# Block type: 2:0 3:fd
# Block type: 2:0 3:fc
Identifier "BenQ G2400W"
VendorName "BNQ"
ModelName "BenQ G2400W"
# Block type: 2:0 3:ff
# Block type: 2:0 3:fd
HorizSync 31-94
VertRefresh 50-85
# Max dot clock (video bandwidth) 170 MHz
# Block type: 2:0 3:fc
# DPMS capabilities: Active off:yes  Suspend:no  Standby:no

Mode "1920x1200"# vfreq 59.950Hz, hfreq 74.038kHz
DotClock154.00
HTimings1920 1968 2000 2080
VTimings1200 1203 1209 1235
Flags"-HSync" "+VSync"
EndMode
# Block type: 2:0 3:ff
# Block type: 2:0 3:fd
# Block type: 2:0 3:fc
EndSection

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[patch] drm/radeon/evergreen: make texdw[] array larger

2012-02-14 Thread Dan Carpenter
We store stuff in texdw[7] so this array needs to have 8 elements.

Signed-off-by: Dan Carpenter 

diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
b/drivers/gpu/drm/radeon/evergreen_cs.c
index 2ed17f7..49203b6 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -638,7 +638,7 @@ static int evergreen_cs_track_validate_texture(struct 
radeon_cs_parser *p,
struct eg_surface surf;
unsigned long toffset, moffset;
unsigned dim, llevel, mslice, width, height, depth, i;
-   u32 texdw[7];
+   u32 texdw[8];
int r;

texdw[0] = radeon_get_ib_value(p, idx + 0);


[patch] drm/radeon/evergreen: make texdw[] array larger

2012-02-14 Thread Dan Carpenter
We store stuff in texdw[7] so this array needs to have 8 elements.

Signed-off-by: Dan Carpenter 

diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
b/drivers/gpu/drm/radeon/evergreen_cs.c
index 2ed17f7..49203b6 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -638,7 +638,7 @@ static int evergreen_cs_track_validate_texture(struct 
radeon_cs_parser *p,
struct eg_surface surf;
unsigned long toffset, moffset;
unsigned dim, llevel, mslice, width, height, depth, i;
-   u32 texdw[7];
+   u32 texdw[8];
int r;
 
texdw[0] = radeon_get_ib_value(p, idx + 0);
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [patch] drm/radeon/evergreen: make texdw[] array larger

2012-02-14 Thread Jerome Glisse
On Tue, Feb 14, 2012 at 10:38:11AM +0300, Dan Carpenter wrote:
> We store stuff in texdw[7] so this array needs to have 8 elements.
> 
> Signed-off-by: Dan Carpenter 
Reviewed-by: Jerome Glisse 
> 
> diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
> b/drivers/gpu/drm/radeon/evergreen_cs.c
> index 2ed17f7..49203b6 100644
> --- a/drivers/gpu/drm/radeon/evergreen_cs.c
> +++ b/drivers/gpu/drm/radeon/evergreen_cs.c
> @@ -638,7 +638,7 @@ static int evergreen_cs_track_validate_texture(struct 
> radeon_cs_parser *p,
>   struct eg_surface surf;
>   unsigned long toffset, moffset;
>   unsigned dim, llevel, mslice, width, height, depth, i;
> - u32 texdw[7];
> + u32 texdw[8];
>   int r;
>  
>   texdw[0] = radeon_get_ib_value(p, idx + 0);
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 45968] [RADEON:KMS:RS780:HD3200] l 2560x1440 detected by monitor as 1280x1440, every second pixel missing

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45968

--- Comment #11 from Roland Scheidegger  2012-02-14 
10:04:35 PST ---
(In reply to comment #9)
> FWIW using HDMI on 3.3-rc I can go up to 2560x1440@48, but 2560x1440@60 is 
> above the 340MHz pixelclock limit for one link.

I'm surprised this old hw supports 340Mhz pixelclock on hdmi, I thought only 
Tahiti could do that, and monitors wouldn't support it neither typically 
(though I
know some hw tolerates overclocking tmds quite well).
In any case 2560x1440@60Hz should be clearly below 340Mhz with reduced blanking 
(around 250Mhz).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] [trivial] drm: Fix typo in exynos_mixer.c

2012-02-14 Thread Inki Dae


> -Original Message-
> From: Masanari Iida [mailto:standby24x7 at gmail.com]
> Sent: Monday, February 13, 2012 11:11 PM
> To: inki.dae at samsung.com; jy0922.shim at samsung.com; sw0312.kim at 
> samsung.com;
> dri-devel at lists.freedesktop.org
> Cc: trivial at kernel.org; linux-kernel at vger.kernel.org;
> standby24x7 at gmail.com
> Subject: [PATCH] [trivial] drm: Fix typo in exynos_mixer.c
> 
> Correct spelling "sucessful" to "successful" in
> drivers/gpu/drm/exynos/exynos_mixer.c
> 
> Signed-off-by: Masanari Iida 
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c
> b/drivers/gpu/drm/exynos/exynos_mixer.c
> index ac24cff..33afd0c 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -1044,7 +1044,7 @@ static int mixer_remove(struct platform_device
*pdev)
>   platform_get_drvdata(pdev);
>   struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx-
> >ctx;
> 
> - dev_info(dev, "remove sucessful\n");
> + dev_info(dev, "remove successful\n");
> 
>   mixer_resource_poweroff(ctx);
>   mixer_resources_cleanup(ctx);
> --
> 1.7.6.5

Applied.

Thanks.
Inki Dae.



[Bug 45984] Piglit:Xserver crashes with segmentation fault after few seconds of r600.tests launch.

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=45984

--- Comment #5 from Michel D?nzer  2012-02-14 01:49:28 
PST ---
> 2) Run ./piglit-run.py tests/r600.tests results/r600.results

BTW, you should use quick-driver.tests these days. I assume that doesn't affect 
this bug though.


> Xserver crashes with segmentation fault after few seconds of r600.tests 
> launch.

The backtrace doesn't look obviously driver related...

Can you get a backtrace with gdb? See 
http://wiki.x.org/wiki/Development/Documentation/ServerDebugging

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


drm/radeon: white screen after X does modeswitch from KMS con

2012-02-14 Thread Alex Deucher
On Mon, Feb 13, 2012 at 9:29 PM, Jan Engelhardt  wrote:
> Hello,
>
>
> the SONY PCG U3 device has a
>
> 00:0c.0 VGA compatible controller [0300]: ATI Technologies Inc Radeon
> Mobility M6 LY [1002:4c59]
>
> graphics card. With linux 3.1.10, X.org server 7.6_1.10.4 and
> xf86-video-ati-6.14.2, switching from KMS'd console to X on tty7
> yields a white screen that also stays when attempting to back to
> tty1.
>
> I have to boot with nomodeset to get a usable Xorg picture.
> Is it just that radeon_drv does not work together with KMS?

It should work fine.  Does it work any better with a newer kernel?  Is
this a regression?  If so, what was the last kernel that was working
properly? Please file a bug:
https://bugs.freedesktop.org
and attach your xorg log and dmesg output.

Alex


[PATCH] drm/i915: Fix single msg gmbus_xfers writes

2012-02-14 Thread Chris Wilson
On Mon, 13 Feb 2012 23:26:23 +0100, Daniel Vetter  wrote:
> On Mon, Feb 13, 2012 at 09:49:35PM +, Chris Wilson wrote:
> > On Mon, 13 Feb 2012 21:38:38 +0100, Daniel Vetter  
> > wrote:
> > However, the outstanding issue is that we need to separate the gmbus
> > i2c adapter from the gpio i2c adapter in order for the pairing to work
> > with the expectations of the i2c core.
> 
> There's another patch floating on dri-devel to add a gmbus_mutex. The
> issue it tries to avoid is that multiple users corrupting each anothers
> state when using the single gmbus controller. See "[PATCH] [PATCH]
> drm/i915: Fix race condition in accessing GMBUS". Or have you thought of
> another interaction that we need to sort out?

The GMBUS interface is currently disabled because we confused the i2c
core.
  https://bugzilla.kernel.org/show_bug.cgi?id=35572
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


[Bug 34155] [drm:radeon_crtc_page_flip] *ERROR* failed to reserve new rbo buffer before flip

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=34155

Michel D?nzer  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED

--- Comment #9 from Michel D?nzer  2012-02-14 01:33:43 
PST ---
(In reply to comment #8)
> After last kernel upgrade ( 3.2.0-1-486 with Debian patches ) I don't get the 
> error messages anymore.

Great, let's assume for now it's been fixed.

> Would you like me to check the value of r with your patch using the previous 
> kernel?

I don't think that's necessary. If you ever see the problem again with the 
newer kernel, it would be interesting to know the value of r though.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[Bug 34155] [drm:radeon_crtc_page_flip] *ERROR* failed to reserve new rbo buffer before flip

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=34155

--- Comment #8 from Marco Albanese  2012-02-14 01:15:48 
PST ---
After last kernel upgrade ( 3.2.0-1-486 with Debian patches ) I don't get the 
error messages anymore.

Would you like me to check the value of r with your patch using the previous 
kernel?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[Bug 46019] New: blur position incorrect

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=46019

 Bug #: 46019
   Summary: blur position incorrect
Classification: Unclassified
   Product: Mesa
   Version: 8.0
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/Gallium/r300
AssignedTo: dri-devel at lists.freedesktop.org
ReportedBy: jakub_o at hotmail.com


just in case no one in charge has seen it, yet:

As to be seen on the second series of pictures (the purple guy), the bloom's 
(or blur or whatever the correct technical term is) position is wrong. it seems 
to
be shifted down left.
http://www.phoronix.com/scan.php?page=news_item&px=MTA1NzI
thank you

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[Bug 46004] [r300g, bisected] piglit glsl-fs-discard-02 fails

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=46004

--- Comment #4 from Pavel Ondra?ka  2012-02-14 
00:36:35 PST ---
Created attachment 57014
  --> https://bugs.freedesktop.org/attachment.cgi?id=57014
RADEON_DEBUG=fp,vp log (piglit pass)

The patch doesn't help. Attaching a new log with 
6d4b35c03619148cde89bc5eedaac3288001edd3 (right before the regression).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[PATCH 5/5] drm/vgem: properly implement mmap

2012-02-14 Thread Dave Airlie
On Tue, Feb 14, 2012 at 2:18 AM, Eric Anholt  wrote:
> On Thu, ?9 Feb 2012 00:19:31 +0100, Ben Widawsky  wrote:
>> Mostly copied from i915 gtt mmaps, this will properly fault in pages as
>> the user tries to use them. The only thing of note are that no
>> prefaulting occurs, so perhaps some kind of madvise will happen later if
>> needed.
>>
>> The only other thing missing right not is shrinker support, which will
>> come next after I figure out if locking is actually required right now.
>> Hmm, and now that I think about it, mremap, and munmap may not work
>> either.
>
> I still think the mmap ioctl should be fixed to just get the mmap
> offset, and you use the normal mmap() syscall later. ?The
> do_mmap-in-the-ioctl in the original GEM implementation was a bad idea.

Yes not accepting an mmap inside things anymore, shouldn't have
accepted the one in GEM.

Dave.


Re: drm/radeon: white screen after X does modeswitch from KMS con

2012-02-14 Thread Alex Deucher
On Mon, Feb 13, 2012 at 9:29 PM, Jan Engelhardt  wrote:
> Hello,
>
>
> the SONY PCG U3 device has a
>
> 00:0c.0 VGA compatible controller [0300]: ATI Technologies Inc Radeon
> Mobility M6 LY [1002:4c59]
>
> graphics card. With linux 3.1.10, X.org server 7.6_1.10.4 and
> xf86-video-ati-6.14.2, switching from KMS'd console to X on tty7
> yields a white screen that also stays when attempting to back to
> tty1.
>
> I have to boot with nomodeset to get a usable Xorg picture.
> Is it just that radeon_drv does not work together with KMS?

It should work fine.  Does it work any better with a newer kernel?  Is
this a regression?  If so, what was the last kernel that was working
properly? Please file a bug:
https://bugs.freedesktop.org
and attach your xorg log and dmesg output.

Alex
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 45968] [RADEON:KMS:RS780:HD3200] l 2560x1440 detected by monitor as 1280x1440, every second pixel missing

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45968

Alex Deucher  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||NOTOURBUG

--- Comment #10 from Alex Deucher  2012-02-14 06:01:56 PST ---
Seems like the oem may not have wired up the DVI port correctly for duallink.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PULL] drm-intel-next

2012-02-14 Thread Daniel Vetter
Hi Dave,

qa just reported on the latest drm-intel-next tree testing and found no
regression. My own testing also hasn't revealed any surprises. The old
tree had 3 outstanding issues:
- this pull request contains a fix for the harmless but annoying i855gm
  dmesg splatter issue
- an otherwise harmless dmesg error about dp is gone with latest -fixes
  merged into -next
- the modeset failures have been tracked down to the additional cea modes
  detected with 3.3-rc1, so not a drm-intel-next issue. Investigation is
  still going on.

Highlights of this pull request:
- quite a few correctness reworks in corner cases (pwrite, swap-in
  swizzling, fence accounting, ...) - i-g-t tests are now rather happy
  about this kernel.
- ilk vt-d infinite recursion due to w/a fixes from Ben
- sprite watermark code from Jesse
- big refactoring and extension of the error_state capture code (still
  more patches to come and some already queued up for -next)
- random set of smaller things (MI_WTF, pageflip on gen2, dp audio, ...)

As usual, qa report below the pull request.

Cheers, Daniel

The following changes since commit 3d29b842e58fbca2c13a9f458fddbaa535c6e578:

  drm/i915: add a LLC feature flag in device description (2012-01-17 20:01:45 
+0100)

are available in the git repository at:

  git://people.freedesktop.org/~danvet/drm-intel drm-intel-next-2012-02-07

for you to fetch changes up to 172975aa746e155533cb386c7159c2d6510e2bc8:

  drm/i915: Handle unmappable buffers during error state capture (2012-01-31 
21:02:54 +0100)


Ben Widawsky (3):
  drm/i915: argument to control retiring behavior
  drm/i915: drm/i915: Fix recursive calls to unmap
  drm/i915: correct lock type in destroy

Chris Wilson (3):
  drm/i915: Separate fence pin counting from normal bind pin counting
  drm/i915: Remove the upper limit on the bo size for mapping into the CPU 
domain
  drm/i915: Handle unmappable buffers during error state capture

Daniel Vetter (18):
  drm/i915: clarify gen2 pageflip cmd
  drm/i915: fixup assert_pipe to take the pipe A quirk into account
  drm/i915: switch ring->id to be a real id
  drm/i915: refactor ring error state capture to use arrays
  drm/i915: collect more per ring error state
  drm/i915/ringbuffer: kill snb blt workaround
  drm/i915: don't trash the gtt when running out of fences
  drm/i915: refactor debugfs open function
  drm/i915: refactor debugfs create functions
  drm/i915: capture error_state also for stuck rings
  drm/i915: remove the i915_batchbuffer_info debugfs file
  drm/i915: reject GTT domain in relocations
  drm/i915: add per-ring fault reg to error_state
  drm/i915: fix swizzle detection for gen3
  drm/i915: add debugfs file for swizzling information
  drm/i915: fall through pwrite_gtt_slow to the shmem slow path
  drm/i915: rewrite shmem_pwrite_slow to use copy_from_user
  drm/i915: rewrite shmem_pread_slow to use copy_to_user

Eric Anholt (2):
  drm/i915: Remove the MI_FLUSH_ENABLE setting.
  drm/i915: Correct the bit number for the MI_FLUSH_ENABLE.

Eugeni Dodonov (1):
  drm/i915: print out which pixel format we do not support

Jesse Barnes (1):
  drm/i915: properly mask and or watermark values for sprites

Wu Fengguang (1):
  drm/i915: set AUD_CONFIG N_value_index for DisplayPort

 drivers/gpu/drm/i915/i915_debugfs.c|  241 -
 drivers/gpu/drm/i915/i915_dma.c|2 +-
 drivers/gpu/drm/i915/i915_drv.h|   53 +++--
 drivers/gpu/drm/i915/i915_gem.c|  394 
 drivers/gpu/drm/i915/i915_gem_evict.c  |2 +-
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  150 +++
 drivers/gpu/drm/i915/i915_gem_gtt.c|2 +-
 drivers/gpu/drm/i915/i915_gem_tiling.c |4 +-
 drivers/gpu/drm/i915/i915_irq.c|  116 +
 drivers/gpu/drm/i915/i915_reg.h|   30 ++-
 drivers/gpu/drm/i915/intel_display.c   |   57 +++-
 drivers/gpu/drm/i915/intel_drv.h   |1 +
 drivers/gpu/drm/i915/intel_overlay.c   |6 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c|   97 +--
 drivers/gpu/drm/i915/intel_ringbuffer.h|   20 +-
 drivers/gpu/drm/i915/intel_sprite.c|4 +-
 16 files changed, 575 insertions(+), 604 deletions(-)


On Tue, Feb 14, 2012 at 07:56:36AM +, Sun, Yi wrote:
> We performed a round of unstable kernel testing with the latest version on 
> Daniel's drm-intel-testing branch.
> The platform which we covered are Ivybridge, Sandybridge, Ironlake, 965g, 
> 945g and Pineview.
> 
> Kernel commit:
> commit 396ee23db6b76354e487fd2cfdacbd989442f81d
> Merge: 172975a c898261
> Author: Daniel Vetter 
> Date:   Tue Feb 7 23:30:10 2012 +0100
> 
> Merge remote-tracking branch 'keithp-kernel/drm-intel-fixes' into 
> drm-intel-testing
> 
> 
> In this round of testing, two new bugs are f

drm/radeon: white screen after X does modeswitch from KMS con

2012-02-14 Thread Jan Engelhardt
Hello,


the SONY PCG U3 device has a

00:0c.0 VGA compatible controller [0300]: ATI Technologies Inc Radeon 
Mobility M6 LY [1002:4c59]

graphics card. With linux 3.1.10, X.org server 7.6_1.10.4 and
xf86-video-ati-6.14.2, switching from KMS'd console to X on tty7
yields a white screen that also stays when attempting to back to
tty1.

I have to boot with nomodeset to get a usable Xorg picture.
Is it just that radeon_drv does not work together with KMS?


= log when starting X from a KMS console =
[   837.009] 
X.Org X Server 1.10.4
Release Date: 2011-08-19
[   837.012] X Protocol Version 11, Revision 0
[   837.013] Build Operating System: openSUSE SUSE LINUX [12.1]
[   837.014] Current Operating System: Linux takeshi 3.1.10-jng3-desktop #1 SMP 
PREEMPT Sun Jan 22 13:04:41 UTC 2012 (479c31a) i586
[   837.016] Kernel command line: root=/dev/mapper/root quiet 3
[   837.018] Build Date: 10 November 2011  03:34:02PM
[   837.019]  
[   837.020] Current version of pixman: 0.24.0
[   837.021]Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[   837.024] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   837.031] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Feb 14 04:18:10 
2012
[   837.035] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   837.037] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   837.042] (==) No Layout section.  Using the first Screen section.
[   837.042] (==) No screen section available. Using defaults.
[   837.042] (**) |-->Screen "Default Screen Section" (0)
[   837.042] (**) |   |-->Monitor ""
[   837.044] (==) No monitor specified for screen "Default Screen Section".
Using a default monitor configuration.
[   837.044] (==) Automatically adding devices
[   837.044] (==) Automatically enabling devices
[   837.046] (==) FontPath set to:
/usr/share/fonts/misc:unscaled,
/usr/share/fonts/Type1/,
/usr/share/fonts/100dpi:unscaled,
/usr/share/fonts/75dpi:unscaled,
/usr/share/fonts/URW/,
/usr/share/fonts/cyrillic:unscaled,
/usr/share/fonts/truetype/,
built-ins
[   837.046] (==) ModulePath set to 
"/usr/lib/xorg/modules/updates,/usr/lib/xorg/modules"
[   837.046] (II) The server relies on udev to provide the list of input 
devices.
If no devices become available, reconfigure udev or disable 
AutoAddDevices.
[   837.046] (II) Loader magic: 0x8233d40
[   837.046] (II) Module ABI versions:
[   837.046]X.Org ANSI C Emulation: 0.4
[   837.046]X.Org Video Driver: 10.0
[   837.047]X.Org XInput driver : 12.2
[   837.047]X.Org Server Extension : 5.0
[   837.054] (--) PCI:*(0:0:12:0) 1002:4c59:104d:810f rev 0, Mem @ 
0xf000/134217728, 0xe811/65536, I/O @ 0x2000/256, BIOS @ 
0x/131072
[   837.060] (II) Open ACPI successful (/var/run/acpid.socket)
[   837.061] (II) LoadModule: "extmod"
[   837.069] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
[   837.070] (II) Module extmod: vendor="X.Org Foundation"
[   837.071]compiled for 1.10.4, module version = 1.0.0
[   837.071]Module class: X.Org Server Extension
[   837.071]ABI class: X.Org Server Extension, version 5.0
[   837.071] (II) Loading extension MIT-SCREEN-SAVER
[   837.071] (II) Loading extension XFree86-VidModeExtension
[   837.071] (II) Loading extension XFree86-DGA
[   837.071] (II) Loading extension DPMS
[   837.071] (II) Loading extension XVideo
[   837.071] (II) Loading extension XVideo-MotionCompensation
[   837.071] (II) Loading extension X-Resource
[   837.072] (II) LoadModule: "dbe"
[   837.075] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
[   837.077] (II) Module dbe: vendor="X.Org Foundation"
[   837.077]compiled for 1.10.4, module version = 1.0.0
[   837.077]Module class: X.Org Server Extension
[   837.077]ABI class: X.Org Server Extension, version 5.0
[   837.077] (II) Loading extension DOUBLE-BUFFER
[   837.077] (II) LoadModule: "glx"
[   837.081] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   837.083] (II) Module glx: vendor="X.Org Foundation"
[   837.083]compiled for 1.10.4, module version = 1.0.0
[   837.083]ABI class: X.Org Server Extension, version 5.0
[   837.083] (==) AIGLX enabled
[   837.083] (II) Loading extension GLX
[   837.084] (II) LoadModule: "record"
[   837.088] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
[   837.089] (II) Module record: vendor="X.Org Foundation"
[   837.089]compiled for 1.10.4, module version = 1.13.0
[   837.089]Module class: X.Org Server Extension
[   837.089]ABI class: X.Org Server Extension, version 5.0
[   837.089] (II) Loading extension RECORD
[   837.089] (II) LoadModule: "dri"
[   837.094] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
[   837.095]

[Bug 45968] [RADEON:KMS:RS780:HD3200] l 2560x1440 detected by monitor as 1280x1440, every second pixel missing

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45968

--- Comment #9 from Tobias Diedrich  2012-02-14 
03:00:35 PST ---
FWIW using HDMI on 3.3-rc I can go up to 2560x1440@48, but 2560x1440@60 is 
above the 340MHz pixelclock limit for one link.

I installed XP yesterday and found that it shows the same problem with 
dual-link not working properly, so this seems to be just a case of bad HW.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 00/11] drm/exynos: fixed exynos drm driver.

2012-02-14 Thread Dave Airlie
On Tue, Feb 14, 2012 at 7:52 AM, Inki Dae  wrote:
> this patch set fixes page flip and mode setting issues and also
> hdmi v1.4 support.

Adding hdmi v1.4 support doesn't seem like a fix to me, it seems like
a new feature.

This should be in a -next tree, if you want to have fixes in 3.3 then
please resend a -fixes tree
with no new features, and put hdmi1.4 into a -next branch.

Dave.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 46005] [r300g, bisected] piglit glsl-vs-loop-redundant-condition fails

2012-02-14 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=46005

--- Comment #1 from Tom Stellard  2012-02-13 18:51:03 
PST ---
This is a r300 compiler bug.  Flow control doesn't work very well for vertex 
shaders at the moment.  I have been slowly working on fixing this, but I'm not
quite done yet.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


RE: [PATCH] drm/exynos: exynos_drm.h header file fixes

2012-02-14 Thread Inki Dae
Hi, Kamil.
Sorry. our patch has no problem and this is my mistake. so your patch has
been merged to our git repository.

Thanks.

> -Original Message-
> From: Inki Dae [mailto:inki@samsung.com]
> Sent: Tuesday, February 14, 2012 5:58 PM
> To: 'Kamil Debski'; 'dri-devel@lists.freedesktop.org'
> Cc: 'kyungmin.p...@samsung.com'; 'jy0922.s...@samsung.com';
> 'sw0312@samsung.com'; 'airl...@linux.ie'
> Subject: RE: [PATCH] drm/exynos: exynos_drm.h header file fixes
> 
> Hi, Kamil.
> Sorry for being late.
> 
> Below is my comments.
> 
> > -Original Message-
> > From: Kamil Debski [mailto:k.deb...@samsung.com]
> > Sent: Saturday, February 11, 2012 2:32 AM
> > To: dri-devel@lists.freedesktop.org
> > Cc: kyungmin.p...@samsung.com; inki@samsung.com;
> > jy0922.s...@samsung.com; sw0312@samsung.com; airl...@linux.ie; Kamil
> > Debski
> > Subject: [PATCH] drm/exynos: exynos_drm.h header file fixes
> >
> > First of all #ifdef __KERNEL__ was added to exynos_drm.h to
> > mark the part that should be left out of userspace.
> > Secondly exynos_drm.h was added to include/drm/Kbuild, so it
> > will be included when doing make headers_install.
> >
> > Signed-off-by: Kamil Debski 
> > Signed-off-by: Kyungmin Park 
> > ---
> >  include/drm/Kbuild   |1 +
> >  include/drm/exynos_drm.h |5 +++--
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/drm/Kbuild b/include/drm/Kbuild
> > index a5c0e10..1e38a19 100644
> > --- a/include/drm/Kbuild
> > +++ b/include/drm/Kbuild
> > @@ -2,6 +2,7 @@ header-y += drm.h
> >  header-y += drm_fourcc.h
> >  header-y += drm_mode.h
> >  header-y += drm_sarea.h
> > +header-y += exynos_drm.h
> >  header-y += i810_drm.h
> >  header-y += i915_drm.h
> >  header-y += mga_drm.h
> > diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
> > index 13b8660..5900e0b 100644
> > --- a/include/drm/exynos_drm.h
> > +++ b/include/drm/exynos_drm.h
> > @@ -99,6 +99,7 @@ struct drm_exynos_plane_set_zpos {
> >  #define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOSDRM_IOWR(DRM_COMMAND_BASE +
> > \
> > DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos)
> >
> > +#ifdef __KERNEL__
> 
> could you please modify it for this macro to be place above of struct
> exynos_drm_panel_info? struct exynos_drm_panel_info also isn't needed for
> user side.
> 
> Thanks.
> 
> >  /**
> >   * Platform Specific Structure for DRM based FIMD.
> >   *
> > @@ -140,5 +141,5 @@ struct exynos_drm_hdmi_pdata {
> > unsigned intdefault_win;
> > unsigned intbpp;
> >  };
> > -
> > -#endif
> > +#endif /* __KERNEL__ */
> > +#endif /* _EXYNOS_DRM_H_ */
> > --
> > 1.7.0.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 45984] Piglit:Xserver crashes with segmentation fault after few seconds of r600.tests launch.

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=45984

--- Comment #5 from Michel Dänzer  2012-02-14 01:49:28 PST 
---
> 2) Run ./piglit-run.py tests/r600.tests results/r600.results

BTW, you should use quick-driver.tests these days. I assume that doesn't affect 
this bug though.


> Xserver crashes with segmentation fault after few seconds of r600.tests 
> launch.

The backtrace doesn't look obviously driver related...

Can you get a backtrace with gdb? See 
http://wiki.x.org/wiki/Development/Documentation/ServerDebugging

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/i915: Fix race condition in accessing GMBUS

2012-02-14 Thread Daniel Vetter
On Mon, Feb 13, 2012 at 05:36:54PM -0500, Yufeng Shen wrote:
> Moved gmbus_mutex below intel_gmbus and added comments.
> Rebased to drm-intel-next-queued.
> 
> 
> 
> GMBUS has several ports and each has it's own corresponding
> I2C adpater. When multiple I2C adapters call gmbus_xfer() at
> the same time there is a race condition in using the underlying
> GMBUS controller. Fixing this by adding a mutex lock when calling
> gmbus_xfer().
> 
> Signed-off-by: Yufeng Shen 

Queued for -next (with some slight modifications in the comments), thanks
for the patch.
-Daniel
-- 
Daniel Vetter
Mail: dan...@ffwll.ch
Mobile: +41 (0)79 365 57 48
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/i915: Fix single msg gmbus_xfers writes

2012-02-14 Thread Chris Wilson
On Mon, 13 Feb 2012 23:26:23 +0100, Daniel Vetter  wrote:
> On Mon, Feb 13, 2012 at 09:49:35PM +, Chris Wilson wrote:
> > On Mon, 13 Feb 2012 21:38:38 +0100, Daniel Vetter  wrote:
> > However, the outstanding issue is that we need to separate the gmbus
> > i2c adapter from the gpio i2c adapter in order for the pairing to work
> > with the expectations of the i2c core.
> 
> There's another patch floating on dri-devel to add a gmbus_mutex. The
> issue it tries to avoid is that multiple users corrupting each anothers
> state when using the single gmbus controller. See "[PATCH] [PATCH]
> drm/i915: Fix race condition in accessing GMBUS". Or have you thought of
> another interaction that we need to sort out?

The GMBUS interface is currently disabled because we confused the i2c
core.
  https://bugzilla.kernel.org/show_bug.cgi?id=35572
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 34155] [drm:radeon_crtc_page_flip] *ERROR* failed to reserve new rbo buffer before flip

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=34155

Michel Dänzer  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED

--- Comment #9 from Michel Dänzer  2012-02-14 01:33:43 PST 
---
(In reply to comment #8)
> After last kernel upgrade ( 3.2.0-1-486 with Debian patches ) I don't get the 
> error messages anymore.

Great, let's assume for now it's been fixed.

> Would you like me to check the value of r with your patch using the previous 
> kernel?

I don't think that's necessary. If you ever see the problem again with the 
newer kernel, it would be interesting to know the value of r though.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 34155] [drm:radeon_crtc_page_flip] *ERROR* failed to reserve new rbo buffer before flip

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=34155

--- Comment #8 from Marco Albanese  2012-02-14 01:15:48 PST 
---
After last kernel upgrade ( 3.2.0-1-486 with Debian patches ) I don't get the 
error messages anymore.

Would you like me to check the value of r with your patch using the previous 
kernel?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


RE: [PATCH] drm/exynos: exynos_drm.h header file fixes

2012-02-14 Thread Inki Dae
Hi, Kamil.
Sorry for being late.

Below is my comments.

> -Original Message-
> From: Kamil Debski [mailto:k.deb...@samsung.com]
> Sent: Saturday, February 11, 2012 2:32 AM
> To: dri-devel@lists.freedesktop.org
> Cc: kyungmin.p...@samsung.com; inki@samsung.com;
> jy0922.s...@samsung.com; sw0312@samsung.com; airl...@linux.ie; Kamil
> Debski
> Subject: [PATCH] drm/exynos: exynos_drm.h header file fixes
> 
> First of all #ifdef __KERNEL__ was added to exynos_drm.h to
> mark the part that should be left out of userspace.
> Secondly exynos_drm.h was added to include/drm/Kbuild, so it
> will be included when doing make headers_install.
> 
> Signed-off-by: Kamil Debski 
> Signed-off-by: Kyungmin Park 
> ---
>  include/drm/Kbuild   |1 +
>  include/drm/exynos_drm.h |5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/drm/Kbuild b/include/drm/Kbuild
> index a5c0e10..1e38a19 100644
> --- a/include/drm/Kbuild
> +++ b/include/drm/Kbuild
> @@ -2,6 +2,7 @@ header-y += drm.h
>  header-y += drm_fourcc.h
>  header-y += drm_mode.h
>  header-y += drm_sarea.h
> +header-y += exynos_drm.h
>  header-y += i810_drm.h
>  header-y += i915_drm.h
>  header-y += mga_drm.h
> diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
> index 13b8660..5900e0b 100644
> --- a/include/drm/exynos_drm.h
> +++ b/include/drm/exynos_drm.h
> @@ -99,6 +99,7 @@ struct drm_exynos_plane_set_zpos {
>  #define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS  DRM_IOWR(DRM_COMMAND_BASE +
> \
>   DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos)
> 
> +#ifdef __KERNEL__

could you please modify it for this macro to be place above of struct
exynos_drm_panel_info? struct exynos_drm_panel_info also isn't needed for
user side.

Thanks.

>  /**
>   * Platform Specific Structure for DRM based FIMD.
>   *
> @@ -140,5 +141,5 @@ struct exynos_drm_hdmi_pdata {
>   unsigned intdefault_win;
>   unsigned intbpp;
>  };
> -
> -#endif
> +#endif /* __KERNEL__ */
> +#endif /* _EXYNOS_DRM_H_ */
> --
> 1.7.0.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 46019] New: blur position incorrect

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=46019

 Bug #: 46019
   Summary: blur position incorrect
Classification: Unclassified
   Product: Mesa
   Version: 8.0
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/Gallium/r300
AssignedTo: dri-devel@lists.freedesktop.org
ReportedBy: jaku...@hotmail.com


just in case no one in charge has seen it, yet:

As to be seen on the second series of pictures (the purple guy), the bloom's 
(or blur or whatever the correct technical term is) position is wrong. it seems 
to
be shifted down left.
http://www.phoronix.com/scan.php?page=news_item&px=MTA1NzI
thank you

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 46004] [r300g, bisected] piglit glsl-fs-discard-02 fails

2012-02-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=46004

--- Comment #4 from Pavel Ondračka  2012-02-14 
00:36:35 PST ---
Created attachment 57014
  --> https://bugs.freedesktop.org/attachment.cgi?id=57014
RADEON_DEBUG=fp,vp log (piglit pass)

The patch doesn't help. Attaching a new log with 
6d4b35c03619148cde89bc5eedaac3288001edd3 (right before the regression).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


No subject

2012-02-14 Thread
k in return path of radeon_fence_count_emitted" fixes=0Athe problem. Tested=
 on top of 47492a23a and 3.3.0-rc3+00188-g3ec1e88.=0A=0A=0AThanks,=0A=0AMik=
ko


[PATCH 11/11] drm/exynos: added panel physical size.

2012-02-14 Thread Inki Dae
From: Eun-Chul Kim 

Signed-off-by: Eun-Chul Kim 
Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_connector.c |   16 ++
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |4 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  |   27 +
 include/drm/exynos_drm.h  |   17 +-
 4 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c 
b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index c35eb32..ebdd71d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -28,6 +28,7 @@
 #include "drmP.h"
 #include "drm_crtc_helper.h"
 
+#include 
 #include "exynos_drm_drv.h"
 #include "exynos_drm_encoder.h"
 
@@ -44,8 +45,9 @@ struct exynos_drm_connector {
 /* convert exynos_video_timings to drm_display_mode */
 static inline void
 convert_to_display_mode(struct drm_display_mode *mode,
-   struct fb_videomode *timing)
+   struct exynos_drm_panel_info *panel)
 {
+   struct fb_videomode *timing = &panel->timing;
DRM_DEBUG_KMS("%s\n", __FILE__);
 
mode->clock = timing->pixclock / 1000;
@@ -60,6 +62,8 @@ convert_to_display_mode(struct drm_display_mode *mode,
mode->vsync_start = mode->vdisplay + timing->upper_margin;
mode->vsync_end = mode->vsync_start + timing->vsync_len;
mode->vtotal = mode->vsync_end + timing->lower_margin;
+   mode->width_mm = panel->width_mm;
+   mode->height_mm = panel->height_mm;
 
if (timing->vmode & FB_VMODE_INTERLACED)
mode->flags |= DRM_MODE_FLAG_INTERLACE;
@@ -148,16 +152,18 @@ static int exynos_drm_connector_get_modes(struct 
drm_connector *connector)
connector->display_info.raw_edid = edid;
} else {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
-   struct fb_videomode *timing;
+   struct exynos_drm_panel_info *panel;
 
-   if (display_ops->get_timing)
-   timing = display_ops->get_timing(manager->dev);
+   if (display_ops->get_panel)
+   panel = display_ops->get_panel(manager->dev);
else {
drm_mode_destroy(connector->dev, mode);
return 0;
}
 
-   convert_to_display_mode(mode, timing);
+   convert_to_display_mode(mode, panel);
+   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);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index eb03f95..4115a9f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -136,7 +136,7 @@ struct exynos_drm_overlay {
  * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI.
  * @is_connected: check for that display is connected or not.
  * @get_edid: get edid modes from display driver.
- * @get_timing: get timing object from display driver.
+ * @get_panel: get panel object from display driver.
  * @check_timing: check if timing is valid or not.
  * @power_on: display device on or off.
  */
@@ -145,7 +145,7 @@ struct exynos_drm_display_ops {
bool (*is_connected)(struct device *dev);
int (*get_edid)(struct device *dev, struct drm_connector *connector,
u8 *edid, int len);
-   void *(*get_timing)(struct device *dev);
+   void *(*get_panel)(struct device *dev);
int (*check_timing)(struct device *dev, void *timing);
int (*power_on)(struct device *dev, int mode);
 };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 0dbb32b..360adf2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -89,7 +89,7 @@ struct fimd_context {
boolsuspended;
struct mutexlock;
 
-   struct fb_videomode *timing;
+   struct exynos_drm_panel_info *panel;
 };
 
 static bool fimd_display_is_connected(struct device *dev)
@@ -101,13 +101,13 @@ static bool fimd_display_is_connected(struct device *dev)
return true;
 }
 
-static void *fimd_get_timing(struct device *dev)
+static void *fimd_get_panel(struct device *dev)
 {
struct fimd_context *ctx = get_fimd_context(dev);
 
DRM_DEBUG_KMS("%s\n", __FILE__);
 
-   return ctx->timing;
+   return ctx->panel;
 }
 
 static int fimd_check_timing(struct device *dev, void *timing)
@@ -131,7 +131,7 @@ static int fimd_display_power_on(struct device *dev, int 
mode)
 static struct exynos_drm_display_ops fimd_display_ops 

[PATCH 09/11] drm/exynos: added mode_fixup feature and code clean.

2012-02-14 Thread Inki Dae
this patch adds mode_fixup feature for hdmi module that
specific driver changes current mode to driver desired mode
properly.

Signed-off-by: Inki Dae 
Signed-off-by: Kyungmin Park 
---
 drivers/gpu/drm/exynos/exynos_drm_connector.c |   25 +++-
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |6 ++-
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |8 +++
 drivers/gpu/drm/exynos/exynos_drm_encoder.c   |   17 -
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c  |   28 +
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h  |5 ++
 drivers/gpu/drm/exynos/exynos_hdmi.c  |   81 ++--
 7 files changed, 157 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c 
b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index d620b07..c35eb32 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -219,6 +219,29 @@ static struct drm_connector_helper_funcs 
exynos_connector_helper_funcs = {
.best_encoder   = exynos_drm_best_encoder,
 };
 
+static int exynos_drm_connector_fill_modes(struct drm_connector *connector,
+   unsigned int max_width, unsigned int max_height)
+{
+   struct exynos_drm_connector *exynos_connector =
+   to_exynos_connector(connector);
+   struct exynos_drm_manager *manager = exynos_connector->manager;
+   struct exynos_drm_manager_ops *ops = manager->ops;
+   unsigned int width, height;
+
+   width = max_width;
+   height = max_height;
+
+   /*
+* if specific driver want to find desired_mode using maxmum
+* resolution then get max width and height from that driver.
+*/
+   if (ops && ops->get_max_resol)
+   ops->get_max_resol(manager->dev, &width, &height);
+
+   return drm_helper_probe_single_connector_modes(connector, width,
+   height);
+}
+
 /* get detection status of display device. */
 static enum drm_connector_status
 exynos_drm_connector_detect(struct drm_connector *connector, bool force)
@@ -256,7 +279,7 @@ static void exynos_drm_connector_destroy(struct 
drm_connector *connector)
 
 static struct drm_connector_funcs exynos_connector_funcs = {
.dpms   = drm_helper_connector_dpms,
-   .fill_modes = drm_helper_probe_single_connector_modes,
+   .fill_modes = exynos_drm_connector_fill_modes,
.detect = exynos_drm_connector_detect,
.destroy= exynos_drm_connector_destroy,
 };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c 
b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index de81883..2d9a0e6 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -249,7 +249,11 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct 
drm_display_mode *mode,
 {
DRM_DEBUG_KMS("%s\n", __FILE__);
 
-   mode = adjusted_mode;
+   /*
+* copy the mode data adjusted by mode_fixup() into crtc->mode
+* so that hardware can be seet to proper mode.
+*/
+   memcpy(&crtc->mode, adjusted_mode, sizeof(*adjusted_mode));
 
return exynos_drm_crtc_update(crtc);
 }
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h 
b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index e685e1e..eb03f95 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -155,8 +155,10 @@ struct exynos_drm_display_ops {
  *
  * @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().
+ * @get_max_resol: get maximum resolution to specific hardware.
  * @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.
@@ -164,7 +166,13 @@ struct exynos_drm_display_ops {
 struct exynos_drm_manager_ops {
void (*dpms)(struct device *subdrv_dev, int mode);
void (*apply)(struct device *subdrv_dev);
+   void (*mode_fixup)(struct device *subdrv_dev,
+   struct drm_connector *connector,
+   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);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c 
b/dri