[Bug 82977] New: freeze when copying between larger OpenGL buffers (glCopyBufferSubData)

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82977

  Priority: medium
Bug ID: 82977
  Assignee: dri-devel at lists.freedesktop.org
   Summary: freeze when copying between larger OpenGL buffers
(glCopyBufferSubData)
  Severity: normal
Classification: Unclassified
OS: Linux (All)
  Reporter: osbios at web.de
  Hardware: x86-64 (AMD64)
Status: NEW
   Version: git
 Component: Drivers/Gallium/radeonsi
   Product: Mesa

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

Ubuntu 14.04. With Oibaf repository for GPU drivers.
Radeon 7870 (Pitcairn)

When I try to run glCopyBufferSubData on large buffers (128MB works ok, 200MiB
not) my Desktop freezes and I only can move the mouse around.
The mouse curser image stays the same after that. E.g. a normal pointer or text
marker icon.

I have no relevant message in dmsg.0 or Xorg.1.log, as far as I can tell.


Minimal example code that will trigger the freeze (After using sdl2 to init
Core GL3.3 Context + Window):

int bufferSize = 200 * 1024 * 1024;
GLuint clientBufferId, serverBufferId;
glGenBuffers(1, );
glBindBuffer(GL_ARRAY_BUFFER, clientBufferId);
glBufferStorage(GL_ARRAY_BUFFER, bufferSize, 0, /*GL_DYNAMIC_STORAGE_BIT |
GL_MAP_WRITE_BIT | GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT|
GL_CLIENT_STORAGE_BIT*/0);

glGenBuffers(1, );
glBindBuffer(GL_ARRAY_BUFFER, serverBufferId);
glBufferStorage(GL_ARRAY_BUFFER, bufferSize, 0, 0);

glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_COPY_READ_BUFFER,  clientBufferId);
glBindBuffer(GL_COPY_WRITE_BUFFER, serverBufferId);
glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0,
bufferSize);

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


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

2014-08-22 Thread Andreas Noever
On Fri, Aug 22, 2014 at 8:23 AM, Bruno Pr?mont
 wrote:
> On Thu, 21 Aug 2014 23:39:31 -0500 Bjorn Helgaas wrote:
>> On Thu, Aug 21, 2014 at 4:34 PM, Bruno Pr?mont wrote:
>>
>> > A second step would then be to tune vgaarb's initial selection.
>> > Bjorn, is it possible to verify which I/O ports are decoded by a PCI
>> > device at the time of adding it to vgaarb? If so, how? I would like to
>> > check for legacy VGA I/O range (0x03B0-0x03DF) and only let vgaarb set
>> > a device as default if that I/O range is decoded by the device.
>>
>> I don't know of a way.  I'm pretty sure VGA devices are allowed to
>> respond to those legacy addresses even if there's no BAR for them, but
>> I haven't found a spec reference for this.  There is the VGA Enable
>> bit in bridges, of course (PCI Bridge spec, sec 12.1.1.  If the VGA
>> device is behind a bridge that doesn't have the VGA Enable bit set, it
>> probably isn't the default device.
>
> Those VGA devices behind bridges are the easy ones that vgaarb selects
> properly.
> It's the ones not behind a bridge (integrated graphics) like the intel
> one that cause problems.
>
> For Andreas's system the discrete nvidia GPU has no I/O enabled
> according to PCI_COMMAND flags while the integrated intel one does have
> them (that's why the Intel GPU is chosen).
>
> Unfortunately I don't know what makes his system choke at boot time as
> he did not provide logs for the failing case.
Attached dmesg for the failing case (obtained via ssh).

Without blacklisting a small horizontal bar of vertical green bars
appears (no x, no console).
If nouveau is blacklisted then I get a console, but X will not start
(No devices found).
If i915 is blacklisted then I do not get a console. The screen just
freezes after a few boot messages.

What is vga_default_device() used for? Is it supposed to hold the
device that is controlling the (boot) screen? Why can't we just read
the configuration from vga_switcheroo/gmux?

>
> If there is no better way to detect the proper legacy VGA device the
> only remaining option would be to perform the screen_info testing in
> vga_arb_device_init() enclosed in arch #ifdef...
>
> Bruno
-- next part --
[0.00] Initializing cgroup subsys cpuset
[0.00] Initializing cgroup subsys cpu
[0.00] Initializing cgroup subsys cpuacct
[0.00] Linux version 3.17.0-rc1-hdev-2-g0d1f272-dirty (anoever at 
linuxbook) (gcc version 4.9.1 (GCC) ) #258 SMP PREEMPT Fri Aug 22 21:20:37 CEST 
2014
[0.00] Command line: BOOT_IMAGE=/boot/vmlinuz-hdev 
root=UUID=555026f1-7426-49a7-80aa-3d2bf31d5cc8 rw quiet 
systemd.unit=graphical.target resume=/dev/sda5
[0.00] e820: BIOS-provided physical RAM map:
[0.00] BIOS-e820: [mem 0x-0x0008dfff] usable
[0.00] BIOS-e820: [mem 0x0008e000-0x0008] reserved
[0.00] BIOS-e820: [mem 0x0009-0x0009] usable
[0.00] BIOS-e820: [mem 0x000a-0x000b] reserved
[0.00] BIOS-e820: [mem 0x0010-0x1fff] usable
[0.00] BIOS-e820: [mem 0x2000-0x201f] reserved
[0.00] BIOS-e820: [mem 0x2020-0x40003fff] usable
[0.00] BIOS-e820: [mem 0x40004000-0x40004fff] reserved
[0.00] BIOS-e820: [mem 0x40005000-0x8ad13fff] usable
[0.00] BIOS-e820: [mem 0x8ad14000-0x8ad52fff] ACPI NVS
[0.00] BIOS-e820: [mem 0x8ad53000-0x8ad68fff] usable
[0.00] BIOS-e820: [mem 0x8ad69000-0x8ad8efff] ACPI data
[0.00] BIOS-e820: [mem 0x8ad8f000-0x8ae39fff] usable
[0.00] BIOS-e820: [mem 0x8ae3a000-0x8ae8efff] reserved
[0.00] BIOS-e820: [mem 0x8ae8f000-0x8aecdfff] usable
[0.00] BIOS-e820: [mem 0x8aece000-0x8aefefff] type 20
[0.00] BIOS-e820: [mem 0x8aeff000-0x8af91fff] usable
[0.00] BIOS-e820: [mem 0x8af92000-0x8affefff] reserved
[0.00] BIOS-e820: [mem 0x8afff000-0x8aff] usable
[0.00] BIOS-e820: [mem 0x8b00-0x8f9f] reserved
[0.00] BIOS-e820: [mem 0xe00f8000-0xe00f8fff] reserved
[0.00] BIOS-e820: [mem 0xfed1c000-0xfed1] reserved
[0.00] BIOS-e820: [mem 0xffe7-0xffe9] reserved
[0.00] BIOS-e820: [mem 0x0001-0x00046f5f] usable
[0.00] NX (Execute Disable) protection: active
[0.00] efi: EFI v1.10 by Apple
[0.00] efi:  ACPI=0x8ad8e000  ACPI 2.0=0x8ad8e014  SMBIOS=0x8ad1b000 
[0.00] efi: mem00: type=7, attr=0x80f, 
range=[0x-0x0008e000) (0MB)
[0.00] efi: mem01: type=0, attr=0x80f, 
range=[0x0008e000-0x0009) 

[Bug 79980] Random radeonsi crashes

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #108 from darkbasic  ---
The original bug wasn't fixed in 3.16-rc but it seems fixed in 3.17+drm-fixes.
I will let you know after a couple of days, I'm really happy I can use radeonsi
once more. With 3.16-rc I had crashes after a few minutes of usage.

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


[Bug 82920] Invalid read during geometry program build

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82920

--- Comment #3 from pavol at klacansky.com ---
I tested modified version and it still crashes

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


[Bug 79980] Random radeonsi crashes

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #107 from agapito  ---
3.17 rc1 and 3.16.1 are still affected by this bug, but they are more stable
than previous kernels.

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


[Bug 82717] OpenCL support for mandelbulber-opencl

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82717

--- Comment #7 from Christoph Haag  ---
(In reply to comment #6)

> Does it require any other OpenCL 1.2 features besides the static keyword on
> functions? 

Yes. The next one is clCreateImage I believe (not at the PC right now).
Mesa has a stub for it that tells the user is not supported in opencl 1.1.

I haven't gotten around testing the denorms parameter yet, but assuming it
works I don't think there's anything to do for OpenCL 1.1.

So close it until there's opencl 1.2 or keep it open and update whether
something it uses is implemented, however you prefer it. But it's not very
important, so if you have something better to do, please don't go out of your
way to support it.

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


[PATCH 2/2] drm/ast: Add reduced/non-reduced mode parsing for wide screen mode

2014-08-22 Thread Egbert Eich

Hi YC,

Y.C. Chen writes:
 > From: "Y.C. Chen" 
 > 
 > Signed-off-by: Y.C. Chen 
 > ---
 >  drivers/gpu/drm/ast/ast_mode.c   | 32 +++---
 >  drivers/gpu/drm/ast/ast_tables.h | 42 
 > 
 >  2 files changed, 50 insertions(+), 24 deletions(-)
 > 
 > diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
 > index 5389350..5533920 100644
 > --- a/drivers/gpu/drm/ast/ast_mode.c
 > +++ b/drivers/gpu/drm/ast/ast_mode.c
 > @@ -141,14 +141,30 @@ static bool ast_get_vbios_mode_info(struct drm_crtc 
 > *crtc, struct drm_display_mo
 >  }
 >  
 >  refresh_rate = drm_mode_vrefresh(mode);
 > -while (vbios_mode->enh_table->refresh_rate < refresh_rate) {
 > -vbios_mode->enh_table++;
 > -if ((vbios_mode->enh_table->refresh_rate > refresh_rate) ||
 > -(vbios_mode->enh_table->refresh_rate == 0xff)) {
 > +do {
 > +if ((vbios_mode->enh_table->flags & WideScreenMode) &&
 > +(((mode->flags & DRM_MODE_FLAG_NVSYNC)  &&
 > +  (vbios_mode->enh_table->flags & PVSync))  ||
 > + ((mode->flags & DRM_MODE_FLAG_PVSYNC)  &&
 > +  (vbios_mode->enh_table->flags & NVSync))  ||
 > + ((mode->flags & DRM_MODE_FLAG_NHSYNC)  &&
 > +  (vbios_mode->enh_table->flags & PHSync))  ||
 > + ((mode->flags & DRM_MODE_FLAG_PHSYNC)  &&
 > +  (vbios_mode->enh_table->flags & NHSync {
 > +vbios_mode->enh_table++;
 > +continue;
 > +}
 > +if (vbios_mode->enh_table->refresh_rate < refresh_rate) {
 > +vbios_mode->enh_table++;
 > +}
 > +if ((vbios_mode->enh_table->refresh_rate_index > 1) &&
 > +(vbios_mode->enh_table->refresh_rate > refresh_rate)) {
 >  vbios_mode->enh_table--;
 >  break;
 >  }
 > -}
 > +} while (vbios_mode->enh_table->refresh_rate != 0xff);
 > +if (vbios_mode->enh_table->refresh_rate == 0xff)
 > +vbios_mode->enh_table--;

I've tested this and experimented around a bit and came up with code like this:

bool check_sync;
struct ast_vbios_enhtable *best = NULL;
[..]

refresh_rate = drm_mode_vrefresh(mode);
check_sync = vbios_mode->enh_table->flags & WideScreenMode;
do {
struct ast_vbios_enhtable *loop = best = vbios_mode->enh_table;

while (loop->refresh_rate != 0xff) {
if ((check_sync) &&
(((mode->flags & DRM_MODE_FLAG_NVSYNC)  &&
  (loop->flags & PVSync))  ||
 ((mode->flags & DRM_MODE_FLAG_PVSYNC)  &&
  (loop->flags & NVSync))  ||
 ((mode->flags & DRM_MODE_FLAG_NHSYNC)  &&
  (loop->flags & PHSync))  ||
 ((mode->flags & DRM_MODE_FLAG_PHSYNC)  &&
  (loop->flags & NHSync {
loop++;
continue;
}
if (loop->refresh_rate <= refresh_rate
&& loop->refresh_rate > best->refresh_rate)
best = loop;
loop++;
}
if (!check_sync)
break;
check_sync = 0;
} while (1);
if (!best)
return false;
vbios_mode->enh_table = best;

This way the code doesn't make the assumption that the refresh rates
are in ascending order and we can map the sync polarities for all modes,
not just the wide screen ones.

 >  
 >  hborder = (vbios_mode->enh_table->flags & HBorder) ? 8 : 0;
 >  vborder = (vbios_mode->enh_table->flags & VBorder) ? 8 : 0;
 > @@ -419,8 +435,10 @@ static void ast_set_sync_reg(struct drm_device *dev, 
 > struct drm_display_mode *mo
 >  struct ast_private *ast = dev->dev_private;
 >  u8 jreg;
 >  
 > -jreg = ast_io_read8(ast, AST_IO_MISC_PORT_READ);
 > -jreg |= (vbios_mode->enh_table->flags & SyncNN);
 > +jreg  = ast_io_read8(ast, AST_IO_MISC_PORT_READ);
 > +jreg &= 0xC0;

This should be: 
jreg &= ~0xC0U;

 > +if (vbios_mode->enh_table->flags & NVSync) jreg |= 0x80;
 > +if (vbios_mode->enh_table->flags & NHSync) jreg |= 0x40;
 >  ast_io_write8(ast, AST_IO_MISC_PORT_WRITE, jreg);
 >  }
 >  

Cheers,
Egbert.


[PATCH 2/2] drm/ast: Add reduced/non-reduced mode parsing for wide screen mode

2014-08-22 Thread Egbert Eich

Hi YC,

Y.C. Chen writes:
 > From: "Y.C. Chen" 
 > 
 > Signed-off-by: Y.C. Chen 
 > ---
 >  drivers/gpu/drm/ast/ast_mode.c   | 32 +++---
 >  drivers/gpu/drm/ast/ast_tables.h | 42 
 > 
 >  2 files changed, 50 insertions(+), 24 deletions(-)
 > 
 > diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
 > index 5389350..5533920 100644
 > --- a/drivers/gpu/drm/ast/ast_mode.c
 > +++ b/drivers/gpu/drm/ast/ast_mode.c
 > @@ -141,14 +141,30 @@ static bool ast_get_vbios_mode_info(struct drm_crtc 
 > *crtc, struct drm_display_mo
 >  }
 >  
 >  refresh_rate = drm_mode_vrefresh(mode);
 > -while (vbios_mode->enh_table->refresh_rate < refresh_rate) {
 > -vbios_mode->enh_table++;
 > -if ((vbios_mode->enh_table->refresh_rate > refresh_rate) ||
 > -(vbios_mode->enh_table->refresh_rate == 0xff)) {
 > +do {
 > +if ((vbios_mode->enh_table->flags & WideScreenMode) &&
 > +(((mode->flags & DRM_MODE_FLAG_NVSYNC)  &&
 > +  (vbios_mode->enh_table->flags & PVSync))  ||
 > + ((mode->flags & DRM_MODE_FLAG_PVSYNC)  &&
 > +  (vbios_mode->enh_table->flags & NVSync))  ||
 > + ((mode->flags & DRM_MODE_FLAG_NHSYNC)  &&
 > +  (vbios_mode->enh_table->flags & PHSync))  ||
 > + ((mode->flags & DRM_MODE_FLAG_PHSYNC)  &&
 > +  (vbios_mode->enh_table->flags & NHSync {
 > +vbios_mode->enh_table++;
 > +continue;
 > +}
 > +if (vbios_mode->enh_table->refresh_rate < refresh_rate) {
 > +vbios_mode->enh_table++;
 > +}
 > +if ((vbios_mode->enh_table->refresh_rate_index > 1) &&
 > +(vbios_mode->enh_table->refresh_rate > refresh_rate)) {
 >  vbios_mode->enh_table--;
 >  break;
 >  }
 > -}
 > +} while (vbios_mode->enh_table->refresh_rate != 0xff);
 > +if (vbios_mode->enh_table->refresh_rate == 0xff)
 > +vbios_mode->enh_table--;

I've tested this and experimented around a bit and came up with code like this:

bool check_sync;
struct ast_vbios_enhtable *best = NULL;
[..]

refresh_rate = drm_mode_vrefresh(mode);
check_sync = vbios_mode->enh_table->flags & WideScreenMode;
do {
struct ast_vbios_enhtable *loop = best = vbios_mode->enh_table;

while (loop->refresh_rate != 0xff) {
if ((check_sync) &&
(((mode->flags & DRM_MODE_FLAG_NVSYNC)  &&
  (loop->flags & PVSync))  ||
 ((mode->flags & DRM_MODE_FLAG_PVSYNC)  &&
  (loop->flags & NVSync))  ||
 ((mode->flags & DRM_MODE_FLAG_NHSYNC)  &&
  (loop->flags & PHSync))  ||
 ((mode->flags & DRM_MODE_FLAG_PHSYNC)  &&
  (loop->flags & NHSync {
loop++;
continue;
}
if (loop->refresh_rate <= refresh_rate
&& loop->refresh_rate > best->refresh_rate)
best = loop;
loop++;
}
if (!check_sync)
break;
check_sync = 0;
} while (1);
if (!best)
return false;
vbios_mode->enh_table = best;

This way the code doesn't make the assumption that the refresh rates
are in ascending order and we can map the sync polarities for all modes,
not just the wide screen ones.

 >  
 >  hborder = (vbios_mode->enh_table->flags & HBorder) ? 8 : 0;
 >  vborder = (vbios_mode->enh_table->flags & VBorder) ? 8 : 0;
 > @@ -419,8 +435,10 @@ static void ast_set_sync_reg(struct drm_device *dev, 
 > struct drm_display_mode *mo
 >  struct ast_private *ast = dev->dev_private;
 >  u8 jreg;
 >  
 > -jreg = ast_io_read8(ast, AST_IO_MISC_PORT_READ);
 > -jreg |= (vbios_mode->enh_table->flags & SyncNN);
 > +jreg  = ast_io_read8(ast, AST_IO_MISC_PORT_READ);
 > +jreg &= 0xC0;

This should be: 
jreg &= ~0xC0U;

 > +if (vbios_mode->enh_table->flags & NVSync) jreg |= 0x80;
 > +if (vbios_mode->enh_table->flags & NHSync) jreg |= 0x40;
 >  ast_io_write8(ast, AST_IO_MISC_PORT_WRITE, jreg);
 >  }
 >  

Cheers,
Egbert.


[Bug 82709] OpenCL not working on radeon hainan

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82709

--- Comment #7 from Tom Stellard  ---
(In reply to comment #5)
> @Tom Stellard: Are you going to fix this problem in llvm/clang/libclc?

Yes, it's fixed in llvm/clang 3.6 and I'll try to backport the patch for
llvm/clang 3.5.1.

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


[PATCH 1/2] drm/ast: Add missing entry to dclk_table[]

2014-08-22 Thread Egbert Eich
Y.C. Chen writes:
 > From: "Y.C. Chen" 
 > 
 > This avoid reading past the end of the list for certain modes
 > 
 > Signed-off-by: Y.C. Chen 
 > ---
 >  drivers/gpu/drm/ast/ast_tables.h | 1 +
 >  1 file changed, 1 insertion(+)
 > 
 > diff --git a/drivers/gpu/drm/ast/ast_tables.h 
 > b/drivers/gpu/drm/ast/ast_tables.h
 > index 4c761dc..05c01ea 100644
 > --- a/drivers/gpu/drm/ast/ast_tables.h
 > +++ b/drivers/gpu/drm/ast/ast_tables.h
 > @@ -99,6 +99,7 @@ static struct ast_vbios_dclk_info dclk_table[] = {
 >  {0x25, 0x65, 0x80}, /* 16: 
 > VCLK88.75*/
 >  {0x77, 0x58, 0x80}, /* 17: VCLK119  
 > */
 >  {0x32, 0x67, 0x80}, /* 18: VCLK85_5 
 > */
 > +{0x6a, 0x6d, 0x80}, /* 19: 
 > VCLK97_75*/
 >  };
 >  
 >  static struct ast_vbios_stdtable vbios_stdtable[] = {
 > -- 
 > 1.8.3.1
 > 

Reviewed-by: Egbert Eich 



[Bug 82717] OpenCL support for mandelbulber-opencl

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82717

--- Comment #6 from Tom Stellard  ---
(In reply to comment #5)
> (In reply to comment #4)
> 
> Thanks, they fixed it upstream:
> https://code.google.com/p/mandelbulber/source/detail?r=451
> 
> That went quicker than I thought.
> 
> "Only" OpenCL 1.2 is missing then I guess.

Does it require any other OpenCL 1.2 features besides the static keyword on
functions?  If not then they should just drop the keyword when using a 1.1
implementation.

Have all the issues with this program been fixed?

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


[Bug 79980] Random radeonsi crashes

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #106 from Alex Deucher  ---
(In reply to comment #105)
> So, is this bug finally fixed? I saw some activity, but was it a real fix or
> only a workaround?

I think thus bug has become largely useless.  It's become a general dumping
ground for any sort of problem with radeonsi.

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


[Bug 79980] Random radeonsi crashes

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #105 from Chernovsky Oleg  ---
So, is this bug finally fixed? I saw some activity, but was it a real fix or
only a workaround?

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


[PATCH] drm: sti: Add missing dependency on RESET_CONTROLLER

2014-08-22 Thread Jingoo Han
Add missing dependency on RESET_CONTROLLER in order to fix
the following build error.

drivers/gpu/drm/sti/sti_hdmi.c: In function 'sti_hdmi_probe'
drivers/gpu/drm/sti/sti_hdmi.c:780:2: error: implicit declaration of function 
'devm_reset_control_get'
[-Werror=implicit-function-declaration]

Signed-off-by: Jingoo Han 
---
 drivers/gpu/drm/sti/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/sti/Kconfig b/drivers/gpu/drm/sti/Kconfig
index 2d9d4252d598..bc7d9347ac89 100644
--- a/drivers/gpu/drm/sti/Kconfig
+++ b/drivers/gpu/drm/sti/Kconfig
@@ -1,6 +1,7 @@
 config DRM_STI
tristate "DRM Support for STMicroelectronics SoC stiH41x Series"
depends on DRM && (SOC_STIH415 || SOC_STIH416 || ARCH_MULTIPLATFORM)
+   depends on RESET_CONTROLLER
select DRM_KMS_HELPER
select DRM_GEM_CMA_HELPER
select DRM_KMS_CMA_HELPER
-- 
2.0.0




[PATCH 2/2] drm/ast: Add reduced/non-reduced mode parsing for wide screen mode

2014-08-22 Thread YC Chen
Hi Egbert,
Thanks for your comment. The modification is great. If possible, could you 
create a new patch to patch my original patch? 

Regards,

Y.C. Chen

"Egbert Eich"  ? 2014/8/22 ??11:29 ???

> 
> Hi YC,
> 
> Y.C. Chen writes:
>> From: "Y.C. Chen" 
>> 
>> Signed-off-by: Y.C. Chen 
>> ---
>> drivers/gpu/drm/ast/ast_mode.c   | 32 +++---
>> drivers/gpu/drm/ast/ast_tables.h | 42 
>> 
>> 2 files changed, 50 insertions(+), 24 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
>> index 5389350..5533920 100644
>> --- a/drivers/gpu/drm/ast/ast_mode.c
>> +++ b/drivers/gpu/drm/ast/ast_mode.c
>> @@ -141,14 +141,30 @@ static bool ast_get_vbios_mode_info(struct drm_crtc 
>> *crtc, struct drm_display_mo
>>}
>> 
>>refresh_rate = drm_mode_vrefresh(mode);
>> -while (vbios_mode->enh_table->refresh_rate < refresh_rate) {
>> -vbios_mode->enh_table++;
>> -if ((vbios_mode->enh_table->refresh_rate > refresh_rate) ||
>> -(vbios_mode->enh_table->refresh_rate == 0xff)) {
>> +do {
>> +if ((vbios_mode->enh_table->flags & WideScreenMode) &&
>> +(((mode->flags & DRM_MODE_FLAG_NVSYNC)  &&
>> +  (vbios_mode->enh_table->flags & PVSync))  ||
>> + ((mode->flags & DRM_MODE_FLAG_PVSYNC)  &&
>> +  (vbios_mode->enh_table->flags & NVSync))  ||
>> + ((mode->flags & DRM_MODE_FLAG_NHSYNC)  &&
>> +  (vbios_mode->enh_table->flags & PHSync))  ||
>> + ((mode->flags & DRM_MODE_FLAG_PHSYNC)  &&
>> +  (vbios_mode->enh_table->flags & NHSync {
>> +vbios_mode->enh_table++;
>> +continue;
>> +}
>> +if (vbios_mode->enh_table->refresh_rate < refresh_rate) {
>> +vbios_mode->enh_table++;
>> +}
>> +if ((vbios_mode->enh_table->refresh_rate_index > 1) &&
>> +(vbios_mode->enh_table->refresh_rate > refresh_rate)) {
>>vbios_mode->enh_table--;
>>break;
>>}
>> -}
>> +} while (vbios_mode->enh_table->refresh_rate != 0xff);
>> +if (vbios_mode->enh_table->refresh_rate == 0xff)
>> +vbios_mode->enh_table--;
> 
> I've tested this and experimented around a bit and came up with code like 
> this:
> 
>bool check_sync;
>struct ast_vbios_enhtable *best = NULL;
>[..]
> 
>refresh_rate = drm_mode_vrefresh(mode);
>check_sync = vbios_mode->enh_table->flags & WideScreenMode;
>do {
>struct ast_vbios_enhtable *loop = best = vbios_mode->enh_table;
> 
>while (loop->refresh_rate != 0xff) {
>if ((check_sync) &&
>(((mode->flags & DRM_MODE_FLAG_NVSYNC)  &&
>  (loop->flags & PVSync))  ||
> ((mode->flags & DRM_MODE_FLAG_PVSYNC)  &&
>  (loop->flags & NVSync))  ||
> ((mode->flags & DRM_MODE_FLAG_NHSYNC)  &&
>  (loop->flags & PHSync))  ||
> ((mode->flags & DRM_MODE_FLAG_PHSYNC)  &&
>  (loop->flags & NHSync {
>loop++;
>continue;
>}
>if (loop->refresh_rate <= refresh_rate
>&& loop->refresh_rate > best->refresh_rate)
>best = loop;
>loop++;
>}
>if (!check_sync)
>break;
>check_sync = 0;
>} while (1);
>if (!best)
>return false;
>vbios_mode->enh_table = best;
> 
> This way the code doesn't make the assumption that the refresh rates
> are in ascending order and we can map the sync polarities for all modes,
> not just the wide screen ones.
> 
>> 
>>hborder = (vbios_mode->enh_table->flags & HBorder) ? 8 : 0;
>>vborder = (vbios_mode->enh_table->flags & VBorder) ? 8 : 0;
>> @@ -419,8 +435,10 @@ static void ast_set_sync_reg(struct drm_device *dev, 
>> struct drm_display_mode *mo
>>struct ast_private *ast = dev->dev_private;
>>u8 jreg;
>> 
>> -jreg = ast_io_read8(ast, AST_IO_MISC_PORT_READ);
>> -jreg |= (vbios_mode->enh_table->flags & SyncNN);
>> +jreg  = ast_io_read8(ast, AST_IO_MISC_PORT_READ);
>> +jreg &= 0xC0;
> 
> This should be: 
>jreg &= ~0xC0U;
> 
>> +if (vbios_mode->enh_table->flags & NVSync) jreg |= 0x80;
>> +if (vbios_mode->enh_table->flags & NHSync) jreg |= 0x40;
>>ast_io_write8(ast, AST_IO_MISC_PORT_WRITE, jreg);
>> }
> 
> Cheers,
>Egbert.


[Bug 79980] Random radeonsi crashes

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #104 from Alex Deucher  ---
(In reply to comment #103)
> I just saw this in dmesg:
> radeon :01:00.0: Packet0 not allowed!

Some userspace component is generating an invalid command stream.  Probably a
bad packet count somewhere.

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


[Bug 79980] Random radeonsi crashes

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #103 from darkbasic  ---
I just saw this in dmesg:
radeon :01:00.0: Packet0 not allowed!

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


[XDC2014] Travel sponsorship

2014-08-22 Thread Martin Peres
Hi everyone,

If you are willing to give a talk at XDC2014 and require travel 
sponsorship, please send an email to board at foundation.x.org (CC: 
martin.peres at free.fr) with an estimate of the travel + accommodation 
cost and the abstract of your talk.

Please send us your applications as soon as possible and do so no later 
than September 5th!

Thanks,
Martin Peres - On behalf of the board of directors


[PATCH] drm/radeon: preallocate mem for UVD create/destroy msg

2014-08-22 Thread Christian König
From: Christian K?nig 

llocating memory for UVD create and destroy messages can fail, which is
rather annoying when this happens in the middle of a GPU reset. Try to
avoid this condition by preallocating a page for those dummy messages.

Signed-off-by: Christian K?nig 
---
 drivers/gpu/drm/radeon/radeon_uvd.c | 101 ++--
 1 file changed, 26 insertions(+), 75 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c 
b/drivers/gpu/drm/radeon/radeon_uvd.c
index d33dacc..1c1e569 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -115,7 +115,8 @@ int radeon_uvd_init(struct radeon_device *rdev)
}

bo_size = RADEON_GPU_PAGE_ALIGN(rdev->uvd_fw->size + 8) +
- RADEON_UVD_STACK_SIZE + RADEON_UVD_HEAP_SIZE;
+ RADEON_UVD_STACK_SIZE + RADEON_UVD_HEAP_SIZE +
+ RADEON_GPU_PAGE_SIZE;
r = radeon_bo_create(rdev, bo_size, PAGE_SIZE, true,
 RADEON_GEM_DOMAIN_VRAM, 0, NULL, 
>uvd.vcpu_bo);
if (r) {
@@ -624,38 +625,16 @@ int radeon_uvd_cs_parse(struct radeon_cs_parser *p)
 }

 static int radeon_uvd_send_msg(struct radeon_device *rdev,
-  int ring, struct radeon_bo *bo,
+  int ring, uint64_t addr,
   struct radeon_fence **fence)
 {
-   struct ttm_validate_buffer tv;
-   struct ww_acquire_ctx ticket;
-   struct list_head head;
struct radeon_ib ib;
-   uint64_t addr;
int i, r;

-   memset(, 0, sizeof(tv));
-   tv.bo = >tbo;
-
-   INIT_LIST_HEAD();
-   list_add(, );
-
-   r = ttm_eu_reserve_buffers(, );
-   if (r)
-   return r;
-
-   radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_VRAM);
-   radeon_uvd_force_into_uvd_segment(bo, RADEON_GEM_DOMAIN_VRAM);
-
-   r = ttm_bo_validate(>tbo, >placement, true, false);
-   if (r) 
-   goto err;
-
r = radeon_ib_get(rdev, ring, , NULL, 64);
if (r)
-   goto err;
+   return r;

-   addr = radeon_bo_gpu_offset(bo);
ib.ptr[0] = PACKET0(UVD_GPCOM_VCPU_DATA0, 0);
ib.ptr[1] = addr;
ib.ptr[2] = PACKET0(UVD_GPCOM_VCPU_DATA1, 0);
@@ -667,19 +646,11 @@ static int radeon_uvd_send_msg(struct radeon_device *rdev,
ib.length_dw = 16;

r = radeon_ib_schedule(rdev, , NULL);
-   if (r)
-   goto err;
-   ttm_eu_fence_buffer_objects(, , ib.fence);

if (fence)
*fence = radeon_fence_ref(ib.fence);

radeon_ib_free(rdev, );
-   radeon_bo_unref();
-   return 0;
-
-err:
-   ttm_eu_backoff_reservation(, );
return r;
 }

@@ -689,27 +660,18 @@ err:
 int radeon_uvd_get_create_msg(struct radeon_device *rdev, int ring,
  uint32_t handle, struct radeon_fence **fence)
 {
-   struct radeon_bo *bo;
-   uint32_t *msg;
-   int r, i;
+   /* we use the last page of the vcpu bo for the UVD message */
+   uint64_t offs = radeon_bo_size(rdev->uvd.vcpu_bo) -
+   RADEON_GPU_PAGE_SIZE;

-   r = radeon_bo_create(rdev, 1024, PAGE_SIZE, true,
-RADEON_GEM_DOMAIN_VRAM, 0, NULL, );
-   if (r)
-   return r;
+   uint32_t *msg = rdev->uvd.cpu_addr + offs;
+   uint64_t addr = rdev->uvd.gpu_addr + offs;

-   r = radeon_bo_reserve(bo, false);
-   if (r) {
-   radeon_bo_unref();
-   return r;
-   }
+   int r, i;

-   r = radeon_bo_kmap(bo, (void **));
-   if (r) {
-   radeon_bo_unreserve(bo);
-   radeon_bo_unref();
+   r = radeon_bo_reserve(rdev->uvd.vcpu_bo, true);
+   if (r)
return r;
-   }

/* stitch together an UVD create msg */
msg[0] = cpu_to_le32(0x0de4);
@@ -726,36 +688,26 @@ int radeon_uvd_get_create_msg(struct radeon_device *rdev, 
int ring,
for (i = 11; i < 1024; ++i)
msg[i] = cpu_to_le32(0x0);

-   radeon_bo_kunmap(bo);
-   radeon_bo_unreserve(bo);
-
-   return radeon_uvd_send_msg(rdev, ring, bo, fence);
+   r = radeon_uvd_send_msg(rdev, ring, addr, fence);
+   radeon_bo_unreserve(rdev->uvd.vcpu_bo);
+   return r;
 }

 int radeon_uvd_get_destroy_msg(struct radeon_device *rdev, int ring,
   uint32_t handle, struct radeon_fence **fence)
 {
-   struct radeon_bo *bo;
-   uint32_t *msg;
-   int r, i;
+   /* we use the last page of the vcpu bo for the UVD message */
+   uint64_t offs = radeon_bo_size(rdev->uvd.vcpu_bo) -
+   RADEON_GPU_PAGE_SIZE;

-   r = radeon_bo_create(rdev, 1024, PAGE_SIZE, true,
-RADEON_GEM_DOMAIN_VRAM, 0, NULL, );
-   if (r)
-   return r;
+   uint32_t *msg = rdev->uvd.cpu_addr + offs;
+  

[Bug 79980] Random radeonsi crashes

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #102 from darkbasic  ---
3.17-rc1 + drm-fixes seems MUCH more stable than ever. I will let you know if
things keeps going on well.

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


[PATCH 2/2] drivers/gpu/drm/vmwgfx/vmwgfx_fence.h: Add missing #define

2014-08-22 Thread Rasmus Villemoes
The name of the macro suggests that the include guard idiom was meant,
but the #define was missing.

Signed-off-by: Rasmus Villemoes 
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fence.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h 
b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h
index faf2e78..1b48a22 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h
@@ -26,6 +26,7 @@
  **/

 #ifndef _VMWGFX_FENCE_H_
+#define _VMWGFX_FENCE_H_

 #define VMW_FENCE_WAIT_TIMEOUT (5*HZ)

-- 
1.9.2



[PATCH 1/2] drivers/gpu/drm/exynos/exynos_drm_fb.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes 
---
 drivers/gpu/drm/exynos/exynos_drm_fb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.h 
b/drivers/gpu/drm/exynos/exynos_drm_fb.h
index 517471b..09ce2bc 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.h
@@ -12,7 +12,7 @@
  */

 #ifndef _EXYNOS_DRM_FB_H_
-#define _EXYNOS_DRM_FB_H
+#define _EXYNOS_DRM_FB_H_

 struct drm_framebuffer *
 exynos_drm_framebuffer_init(struct drm_device *dev,
-- 
1.9.2



[Bug 72785] bfgminer --scrypt on 7xxx+

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=72785

--- Comment #31 from darkbasic  ---
kernel 3.17-rc1 + drm-fixes, llvm git, mesa git

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


[Bug 72785] bfgminer --scrypt on 7xxx+

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=72785

--- Comment #30 from darkbasic  ---
I get no errors but a ridiculous hash rate and a 100% error rate:
 1  68.0C | 442.2/440.0/  0.0kh/s | A:0 R:0+0(none) HW:8/100%

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


[Bug 81444] [drm:radeon_uvd_free_handles] *ERROR* Error destroying UVD (-22)!

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=81444

--- Comment #6 from Christian K?nig  ---
Created attachment 105100
  --> https://bugs.freedesktop.org/attachment.cgi?id=105100=edit
Possible fix.

I've figured out what's going wrong here. You somehow used up all you video
memory and we don't try hard enough on destroying the UVD session to swap
something out to make room for the necessary hardware message.

The attached patch on top of Alex drm-next-3.18-wip branch should fix the
problem.

Only the question how did you managed to do so remains?

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


drm_mode_create_dumb_ioctl: divide error

2014-08-22 Thread David Herrmann
Hi

On Thu, Aug 21, 2014 at 8:18 PM, Tommi Rantala  wrote:
> Hello,
>
> Triggered this while fuzzing v3.17-rc1-51-g372b1db with Trinity.
>
> Tommi
>
>
> [drm:drm_mode_legacy_fb_format] *ERROR* bad bpp, assuming x8r8g8b8 pixel 
> format
> divide error:  [#1] SMP DEBUG_PAGEALLOC
> CPU: 0 PID: 2854 Comm: trinity-c7 Not tainted 3.17.0-rc1+ #14
> Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
> task: 88003926cac0 ti: 8800356b4000 task.ti: 8800356b4000
> RIP: 0010:[]  []
> drm_mode_create_dumb_ioctl+0x53/0xa0
> RSP: 0018:8800356b7dc0  EFLAGS: 00010246
> RAX:  RBX: 88003545da68 RCX: 
> RDX:  RSI: 8800356b7e18 RDI: 88003d5c67b0
> RBP: 8800356b7dc8 R08:  R09: 
> R10:  R11: 817f6d30 R12: 00b2
> R13: fff2 R14: 88003d5c67b0 R15: 88003545da68
> FS:  7f06208fa700() GS:88003fa0() knlGS:
> CS:  0010 DS:  ES:  CR0: 80050033
> CR2: 01903108 CR3: 36efa000 CR4: 06f0
> Stack:
>  8800356b7e18 8800356b7ec8 8165ac60 8800356b7df8
>  8800356b7e18 8800356b7e18 824e1440 00d52000
>  0020 c02064b2 fff2 
> Call Trace:
>  [] drm_ioctl+0x3b0/0x640
>  [] ? avc_has_perm+0x218/0x2f0
>  [] ? avc_has_perm+0x20/0x2f0
>  [] ? sched_clock_cpu+0xa8/0xf0
>  [] do_vfs_ioctl+0x4d0/0x510
>  [] ? selinux_file_ioctl+0xf5/0x100
>  [] SyS_ioctl+0x4e/0x80
>  [] system_call_fastpath+0x16/0x1b
> Code: 55 41 b9 ff ff ff ff 41 83 c0 07 44 89 c8 41 c1 e8 03 48 89 e5
> 53 48 89 d3 31 d2 f7 f1 41 39 c0 77 46 41 0f af c8 31 d2 44 89 c8 
> f1 41 39 c2 77 36 41 0f af ca b8 ea ff ff ff 81 c1 ff 0f 00
> RIP  [] drm_mode_create_dumb_ioctl+0x53/0xa0
>  RSP 
> ---[ end trace 6919129b71d9bf98 ]---
> [drm:drm_mode_legacy_fb_format] *ERROR* bad bpp, assuming x8r8g8b8 pixel 
> format
>
>
>
> (gdb) list *0x816688e3
> 0x816688e3 is in drm_mode_create_dumb_ioctl
> (drivers/gpu/drm/drm_crtc.c:4703).
> 4698/* overflow checks for 32bit size calculations */
> 4699cpp = DIV_ROUND_UP(args->bpp, 8);
> 4700if (cpp > 0xU / args->width)
> 4701return -EINVAL;
> 4702stride = cpp * args->width;
> 4703if (args->height > 0xU / stride)
> 4704return -EINVAL;

Hm, this doesn't make sense to me. args->bpp/width/height are
guaranteed to be non-zero and 32bit. Therefore, DIV_ROUND_UP() cannot
return 0 and "cpp" is thus non-zero. The overflow check makes sure
"cpp * args->width" cannot overflow, both are non-zero so "stride" is
non-zero and valid.

I cannot make much sense out of the x86 assembly below, so help welcome.

Thanks
David

> 4705
> 4706/* test for wrap-around */
> 4707size = args->height * stride;
> (gdb) disassemble drm_mode_create_dumb_ioctl
> Dump of assembler code for function drm_mode_create_dumb_ioctl:
>0x81668890 <+0>: mov0x20(%rdi),%rax
>0x81668894 <+4>: mov0x160(%rax),%r11
>0x8166889b <+11>:test   %r11,%r11
>0x8166889e <+14>:je 0x8166890f
> 
>0x816688a0 <+16>:mov0x4(%rsi),%ecx
>0x816688a3 <+19>:test   %ecx,%ecx
>0x816688a5 <+21>:je 0x81668918
> 
>0x816688a7 <+23>:mov(%rsi),%r10d
>0x816688aa <+26>:test   %r10d,%r10d
>0x816688ad <+29>:je 0x81668918
> 
>0x816688af <+31>:mov0x8(%rsi),%r8d
>0x816688b3 <+35>:test   %r8d,%r8d
>0x816688b6 <+38>:je 0x81668918
> 
>0x816688b8 <+40>:push   %rbp
>0x816688b9 <+41>:mov$0x,%r9d
>0x816688bf <+47>:add$0x7,%r8d
>0x816688c3 <+51>:mov%r9d,%eax
>0x816688c6 <+54>:shr$0x3,%r8d
>0x816688ca <+58>:mov%rsp,%rbp
>0x816688cd <+61>:push   %rbx
>0x816688ce <+62>:mov%rdx,%rbx
>0x816688d1 <+65>:xor%edx,%edx
>0x816688d3 <+67>:div%ecx
>0x816688d5 <+69>:cmp%eax,%r8d
>0x816688d8 <+72>:ja 0x81668920
> 
>0x816688da <+74>:imul   %r8d,%ecx
>0x816688de <+78>:xor%edx,%edx
>0x816688e0 <+80>:mov%r9d,%eax
>0x816688e3 <+83>:div%ecx
>0x816688e5 <+85>:cmp%eax,%r10d
>0x816688e8 <+88>:ja 0x81668920
> 
>0x816688ea <+90>:imul   %r10d,%ecx
>

[Bug 82709] OpenCL not working on radeon hainan

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82709

--- Comment #6 from Alex Deucher  ---
(In reply to comment #5)
> @Tom Stellard: Are you going to fix this problem in llvm/clang/libclc?

IIRC, it's already working with newer versions of clang.

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


[Bug 82920] Invalid read during geometry program build

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82920

Alex Deucher  changed:

   What|Removed |Added

 Attachment #105095|text/plain  |application/x-gzip
  mime type||

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


[Bug 79980] Random radeonsi crashes

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=79980

--- Comment #101 from Maximilian B?hm  ---
Hey, my system is running nearly crash free for three days now with Linux 3.17
RC1. The crashes were related to VLC and VDPAU and something got stuck but my
system feels pretty stable now. If you are on Arch Linux compile linux-mainline
from AUR and try for yourself (don't forget updating GRUB).

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


[Bug 82920] Invalid read during geometry program build

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82920

--- Comment #2 from pavol at klacansky.com ---
I have tested new version on nvidia driver and test it on mesa when I get home.
In original version there was a bug where UBOs were not binded (I am not sure
if KHR_debug should report this).

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


[Bug 82920] Invalid read during geometry program build

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82920

--- Comment #1 from pavol at klacansky.com ---
Created attachment 105095
  --> https://bugs.freedesktop.org/attachment.cgi?id=105095=edit
fixed mc

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


[PATCH 2/2] drm/ast: Add reduced/non-reduced mode parsing for wide screen mode

2014-08-22 Thread Y.C. Chen
From: "Y.C. Chen" 

Signed-off-by: Y.C. Chen 
---
 drivers/gpu/drm/ast/ast_mode.c   | 32 +++---
 drivers/gpu/drm/ast/ast_tables.h | 42 
 2 files changed, 50 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 5389350..5533920 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -141,14 +141,30 @@ static bool ast_get_vbios_mode_info(struct drm_crtc 
*crtc, struct drm_display_mo
}

refresh_rate = drm_mode_vrefresh(mode);
-   while (vbios_mode->enh_table->refresh_rate < refresh_rate) {
-   vbios_mode->enh_table++;
-   if ((vbios_mode->enh_table->refresh_rate > refresh_rate) ||
-   (vbios_mode->enh_table->refresh_rate == 0xff)) {
+   do {
+   if ((vbios_mode->enh_table->flags & WideScreenMode) &&
+   (((mode->flags & DRM_MODE_FLAG_NVSYNC)  &&
+ (vbios_mode->enh_table->flags & PVSync))  ||
+((mode->flags & DRM_MODE_FLAG_PVSYNC)  &&
+ (vbios_mode->enh_table->flags & NVSync))  ||
+((mode->flags & DRM_MODE_FLAG_NHSYNC)  &&
+ (vbios_mode->enh_table->flags & PHSync))  ||
+((mode->flags & DRM_MODE_FLAG_PHSYNC)  &&
+ (vbios_mode->enh_table->flags & NHSync {
+   vbios_mode->enh_table++;
+   continue;
+   }
+   if (vbios_mode->enh_table->refresh_rate < refresh_rate) {
+   vbios_mode->enh_table++;
+   }
+   if ((vbios_mode->enh_table->refresh_rate_index > 1) &&
+   (vbios_mode->enh_table->refresh_rate > refresh_rate)) {
vbios_mode->enh_table--;
break;
}
-   }
+   } while (vbios_mode->enh_table->refresh_rate != 0xff);
+   if (vbios_mode->enh_table->refresh_rate == 0xff)
+   vbios_mode->enh_table--;

hborder = (vbios_mode->enh_table->flags & HBorder) ? 8 : 0;
vborder = (vbios_mode->enh_table->flags & VBorder) ? 8 : 0;
@@ -419,8 +435,10 @@ static void ast_set_sync_reg(struct drm_device *dev, 
struct drm_display_mode *mo
struct ast_private *ast = dev->dev_private;
u8 jreg;

-   jreg = ast_io_read8(ast, AST_IO_MISC_PORT_READ);
-   jreg |= (vbios_mode->enh_table->flags & SyncNN);
+   jreg  = ast_io_read8(ast, AST_IO_MISC_PORT_READ);
+   jreg &= 0xC0;
+   if (vbios_mode->enh_table->flags & NVSync) jreg |= 0x80;
+   if (vbios_mode->enh_table->flags & NHSync) jreg |= 0x40;
ast_io_write8(ast, AST_IO_MISC_PORT_WRITE, jreg);
 }

diff --git a/drivers/gpu/drm/ast/ast_tables.h b/drivers/gpu/drm/ast/ast_tables.h
index 05c01ea..28ce659 100644
--- a/drivers/gpu/drm/ast/ast_tables.h
+++ b/drivers/gpu/drm/ast/ast_tables.h
@@ -35,14 +35,18 @@
 #define HalfDCLK0x0002
 #define DoubleScanMode  0x0004
 #define LineCompareOff  0x0008
-#define SyncPP  0x
-#define SyncPN  0x0040
-#define SyncNP  0x0080
-#define SyncNN  0x00C0
 #define HBorder 0x0020
 #define VBorder 0x0010
-#define WideScreenMode 0x0100
-#define NewModeInfo0x0200
+#define WideScreenMode 0x0100
+#define NewModeInfo0x0200
+#define NHSync 0x0400
+#define PHSync 0x0800
+#define NVSync 0x1000
+#define PVSync 0x2000
+#defineSyncPP  (PVSync | PHSync)
+#defineSyncPN  (PVSync | NHSync)
+#defineSyncNP  (NVSync | PHSync)
+#defineSyncNN  (NVSync | NHSync)

 /* DCLK Index */
 #define VCLK25_175 0x00
@@ -72,6 +76,7 @@
 #define VCLK1190x17
 #define VCLK85_5   0x18
 #define VCLK97_75  0x19
+#define VCLK118_25 0x1A

 static struct ast_vbios_dclk_info dclk_table[] = {
{0x2C, 0xE7, 0x03}, /* 00: 
VCLK25_175   */
@@ -100,6 +105,7 @@ static struct ast_vbios_dclk_info dclk_table[] = {
{0x77, 0x58, 0x80}, /* 17: VCLK119  
*/
{0x32, 0x67, 0x80}, /* 18: VCLK85_5 
*/
{0x6a, 0x6d, 0x80}, /* 19: 
VCLK97_75*/
+   {0x3b, 0x2c, 0x81}, /* 1A: 
VCLK118_25   */
 };

 static struct 

[PATCH 1/2] drm/ast: Add missing entry to dclk_table[]

2014-08-22 Thread Y.C. Chen
From: "Y.C. Chen" 

This avoid reading past the end of the list for certain modes

Signed-off-by: Y.C. Chen 
---
 drivers/gpu/drm/ast/ast_tables.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/ast/ast_tables.h b/drivers/gpu/drm/ast/ast_tables.h
index 4c761dc..05c01ea 100644
--- a/drivers/gpu/drm/ast/ast_tables.h
+++ b/drivers/gpu/drm/ast/ast_tables.h
@@ -99,6 +99,7 @@ static struct ast_vbios_dclk_info dclk_table[] = {
{0x25, 0x65, 0x80}, /* 16: 
VCLK88.75*/
{0x77, 0x58, 0x80}, /* 17: VCLK119  
*/
{0x32, 0x67, 0x80}, /* 18: VCLK85_5 
*/
+   {0x6a, 0x6d, 0x80}, /* 19: 
VCLK97_75*/
 };

 static struct ast_vbios_stdtable vbios_stdtable[] = {
-- 
1.8.3.1



[pull] radeon drm-fixes-3.17

2014-08-22 Thread Alex Deucher
Hi Dave,

This pull just contains some new pci ids.

The following changes since commit 20a984c2a51d379bce08ee1031b32020f273e532:

  Merge tag 'drm-intel-fixes-2014-08-21' of 
git://anongit.freedesktop.org/drm-intel (2014-08-22 07:29:52 +1000)

are available in the git repository at:


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

for you to fetch changes up to 37dbeab788a8f23fd946c0be083e5484d6f929a1:

  drm/radeon: add additional SI pci ids (2014-08-22 10:47:59 -0400)


Alex Deucher (3):
  drm/radeon: add new KV pci id
  drm/radeon: add new bonaire pci ids
  drm/radeon: add additional SI pci ids

 drivers/gpu/drm/radeon/cik.c | 1 +
 include/drm/drm_pciids.h | 7 +++
 2 files changed, 8 insertions(+)


[PATCH 2/2] drm/radeon: allow UVD to use a second 256MB segment

2014-08-22 Thread Christian König
From: Christian K?nig 

This improves concurrent stream decoding.

Signed-off-by: Christian K?nig 
---
 drivers/gpu/drm/radeon/radeon.h|  3 ++-
 drivers/gpu/drm/radeon/radeon_object.c |  5 +++--
 drivers/gpu/drm/radeon/radeon_uvd.c| 20 ++--
 3 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index cae3adc..f2dba50 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1640,7 +1640,8 @@ int radeon_uvd_get_create_msg(struct radeon_device *rdev, 
int ring,
  uint32_t handle, struct radeon_fence **fence);
 int radeon_uvd_get_destroy_msg(struct radeon_device *rdev, int ring,
   uint32_t handle, struct radeon_fence **fence);
-void radeon_uvd_force_into_uvd_segment(struct radeon_bo *rbo);
+void radeon_uvd_force_into_uvd_segment(struct radeon_bo *rbo,
+  uint32_t allowed_domains);
 void radeon_uvd_free_handles(struct radeon_device *rdev,
 struct drm_file *filp);
 int radeon_uvd_cs_parse(struct radeon_cs_parser *parser);
diff --git a/drivers/gpu/drm/radeon/radeon_object.c 
b/drivers/gpu/drm/radeon/radeon_object.c
index 0129c7e..c97a424 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -491,6 +491,7 @@ int radeon_bo_list_validate(struct radeon_device *rdev,
bo = lobj->robj;
if (!bo->pin_count) {
u32 domain = lobj->prefered_domains;
+   u32 allowed = lobj->allowed_domains;
u32 current_domain =
radeon_mem_type_to_domain(bo->tbo.mem.mem_type);

@@ -502,7 +503,7 @@ int radeon_bo_list_validate(struct radeon_device *rdev,
 * into account. We don't want to disallow buffer moves
 * completely.
 */
-   if ((lobj->allowed_domains & current_domain) != 0 &&
+   if ((allowed & current_domain) != 0 &&
(domain & current_domain) == 0 && /* will be moved 
*/
bytes_moved > bytes_moved_threshold) {
/* don't move it */
@@ -512,7 +513,7 @@ int radeon_bo_list_validate(struct radeon_device *rdev,
retry:
radeon_ttm_placement_from_domain(bo, domain);
if (ring == R600_RING_TYPE_UVD_INDEX)
-   radeon_uvd_force_into_uvd_segment(bo);
+   radeon_uvd_force_into_uvd_segment(bo, allowed);

initial_bytes_moved = 
atomic64_read(>num_bytes_moved);
r = ttm_bo_validate(>tbo, >placement, true, 
false);
diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c 
b/drivers/gpu/drm/radeon/radeon_uvd.c
index 1168de7..d33dacc 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -231,7 +231,8 @@ int radeon_uvd_resume(struct radeon_device *rdev)
return 0;
 }

-void radeon_uvd_force_into_uvd_segment(struct radeon_bo *rbo)
+void radeon_uvd_force_into_uvd_segment(struct radeon_bo *rbo,
+  uint32_t allowed_domains)
 {
int i;

@@ -239,6 +240,21 @@ void radeon_uvd_force_into_uvd_segment(struct radeon_bo 
*rbo)
rbo->placements[i].fpfn = 0 >> PAGE_SHIFT;
rbo->placements[i].lpfn = (256 * 1024 * 1024) >> PAGE_SHIFT;
}
+
+   /* If it must be in VRAM it must be in the first segment as well */
+   if (allowed_domains == RADEON_GEM_DOMAIN_VRAM)
+   return;
+
+   /* abort if we already have more than one placement */
+   if (rbo->placement.num_placement > 1)
+   return;
+
+   /* add another 256MB segment */
+   rbo->placements[1] = rbo->placements[0];
+   rbo->placements[1].fpfn += (256 * 1024 * 1024) >> PAGE_SHIFT;
+   rbo->placements[1].lpfn += (256 * 1024 * 1024) >> PAGE_SHIFT;
+   rbo->placement.num_placement++;
+   rbo->placement.num_busy_placement++;
 }

 void radeon_uvd_free_handles(struct radeon_device *rdev, struct drm_file *filp)
@@ -629,7 +645,7 @@ static int radeon_uvd_send_msg(struct radeon_device *rdev,
return r;

radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_VRAM);
-   radeon_uvd_force_into_uvd_segment(bo);
+   radeon_uvd_force_into_uvd_segment(bo, RADEON_GEM_DOMAIN_VRAM);

r = ttm_bo_validate(>tbo, >placement, true, false);
if (r) 
-- 
1.9.1



[PATCH 1/2] drm/ttm: move fpfn and lpfn into each placement

2014-08-22 Thread Christian König
From: Christian K?nig 

This allows us to more fine grained specify where to place the buffer object.

Signed-off-by: Christian K?nig 
---
 drivers/gpu/drm/ast/ast_drv.h |   2 +-
 drivers/gpu/drm/ast/ast_ttm.c |  20 ++--
 drivers/gpu/drm/cirrus/cirrus_drv.h   |   2 +-
 drivers/gpu/drm/cirrus/cirrus_ttm.c   |  17 ++--
 drivers/gpu/drm/mgag200/mgag200_drv.h |   2 +-
 drivers/gpu/drm/mgag200/mgag200_ttm.c |  20 ++--
 drivers/gpu/drm/nouveau/nouveau_bo.c  |  52 +++---
 drivers/gpu/drm/nouveau/nouveau_bo.h  |   4 +-
 drivers/gpu/drm/nouveau/nouveau_ttm.c |   9 +-
 drivers/gpu/drm/qxl/qxl_drv.h |   2 +-
 drivers/gpu/drm/qxl/qxl_object.c  |  17 ++--
 drivers/gpu/drm/qxl/qxl_ttm.c |   8 +-
 drivers/gpu/drm/radeon/radeon.h   |   2 +-
 drivers/gpu/drm/radeon/radeon_object.c|  71 +-
 drivers/gpu/drm/radeon/radeon_ttm.c   |  25 ++---
 drivers/gpu/drm/radeon/radeon_uvd.c   |   8 +-
 drivers/gpu/drm/ttm/ttm_bo.c  |  93 --
 drivers/gpu/drm/ttm/ttm_bo_manager.c  |   9 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c| 136 --
 drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c|  22 +++--
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c|  10 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c |   3 +-
 include/drm/ttm/ttm_bo_api.h  |  40 
 include/drm/ttm/ttm_bo_driver.h   |   3 +-
 24 files changed, 332 insertions(+), 245 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 957d4fa..cb91c2a 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -316,7 +316,7 @@ struct ast_bo {
struct ttm_placement placement;
struct ttm_bo_kmap_obj kmap;
struct drm_gem_object gem;
-   u32 placements[3];
+   struct ttm_place placements[3];
int pin_count;
 };
 #define gem_to_ast_bo(gobj) container_of((gobj), struct ast_bo, gem)
diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c
index b824622..8008ea0 100644
--- a/drivers/gpu/drm/ast/ast_ttm.c
+++ b/drivers/gpu/drm/ast/ast_ttm.c
@@ -293,18 +293,22 @@ void ast_mm_fini(struct ast_private *ast)
 void ast_ttm_placement(struct ast_bo *bo, int domain)
 {
u32 c = 0;
-   bo->placement.fpfn = 0;
-   bo->placement.lpfn = 0;
+   unsigned i;
+
bo->placement.placement = bo->placements;
bo->placement.busy_placement = bo->placements;
if (domain & TTM_PL_FLAG_VRAM)
-   bo->placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | 
TTM_PL_FLAG_VRAM;
+   bo->placements[c++].flags = TTM_PL_FLAG_WC | 
TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM;
if (domain & TTM_PL_FLAG_SYSTEM)
-   bo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
+   bo->placements[c++].flags = TTM_PL_MASK_CACHING | 
TTM_PL_FLAG_SYSTEM;
if (!c)
-   bo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
+   bo->placements[c++].flags = TTM_PL_MASK_CACHING | 
TTM_PL_FLAG_SYSTEM;
bo->placement.num_placement = c;
bo->placement.num_busy_placement = c;
+   for (i = 0; i < c; ++i) {
+   bo->placements[i].fpfn = 0;
+   bo->placements[i].lpfn = 0;
+   }
 }

 int ast_bo_create(struct drm_device *dev, int size, int align,
@@ -360,7 +364,7 @@ int ast_bo_pin(struct ast_bo *bo, u32 pl_flag, u64 
*gpu_addr)

ast_ttm_placement(bo, pl_flag);
for (i = 0; i < bo->placement.num_placement; i++)
-   bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
+   bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
ret = ttm_bo_validate(>bo, >placement, false, false);
if (ret)
return ret;
@@ -383,7 +387,7 @@ int ast_bo_unpin(struct ast_bo *bo)
return 0;

for (i = 0; i < bo->placement.num_placement ; i++)
-   bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT;
+   bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
ret = ttm_bo_validate(>bo, >placement, false, false);
if (ret)
return ret;
@@ -407,7 +411,7 @@ int ast_bo_push_sysram(struct ast_bo *bo)

ast_ttm_placement(bo, TTM_PL_FLAG_SYSTEM);
for (i = 0; i < bo->placement.num_placement ; i++)
-   bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
+   bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;

ret = ttm_bo_validate(>bo, >placement, false, false);
if (ret) {
diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h 
b/drivers/gpu/drm/cirrus/cirrus_drv.h
index 401c890..dd2cfc9 100644
--- a/drivers/gpu/drm/cirrus/cirrus_drv.h
+++ b/drivers/gpu/drm/cirrus/cirrus_drv.h
@@ -163,7 +163,7 @@ struct cirrus_bo {
struct ttm_placement 

[PATCH 15/15] drm/exynos/fimc: fix source buffer registers

2014-08-22 Thread Andrzej Hajda
FIMC in default mode of operation uses only one input buffer,
but the driver used also second buffer, as a result only the
first frame was processed correctly. The patch fixes it.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_fimc.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index b20078e..e985253 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -720,24 +720,24 @@ static int fimc_src_set_addr(struct device *dev,
case IPP_BUF_ENQUEUE:
config = >config[EXYNOS_DRM_OPS_SRC];
fimc_write(ctx, buf_info->base[EXYNOS_DRM_PLANAR_Y],
-   EXYNOS_CIIYSA(buf_id));
+   EXYNOS_CIIYSA0);

if (config->fmt == DRM_FORMAT_YVU420) {
fimc_write(ctx, buf_info->base[EXYNOS_DRM_PLANAR_CR],
-   EXYNOS_CIICBSA(buf_id));
+   EXYNOS_CIICBSA0);
fimc_write(ctx, buf_info->base[EXYNOS_DRM_PLANAR_CB],
-   EXYNOS_CIICRSA(buf_id));
+   EXYNOS_CIICRSA0);
} else {
fimc_write(ctx, buf_info->base[EXYNOS_DRM_PLANAR_CB],
-   EXYNOS_CIICBSA(buf_id));
+   EXYNOS_CIICBSA0);
fimc_write(ctx, buf_info->base[EXYNOS_DRM_PLANAR_CR],
-   EXYNOS_CIICRSA(buf_id));
+   EXYNOS_CIICRSA0);
}
break;
case IPP_BUF_DEQUEUE:
-   fimc_write(ctx, 0x0, EXYNOS_CIIYSA(buf_id));
-   fimc_write(ctx, 0x0, EXYNOS_CIICBSA(buf_id));
-   fimc_write(ctx, 0x0, EXYNOS_CIICRSA(buf_id));
+   fimc_write(ctx, 0x0, EXYNOS_CIIYSA0);
+   fimc_write(ctx, 0x0, EXYNOS_CIICBSA0);
+   fimc_write(ctx, 0x0, EXYNOS_CIICRSA0);
break;
default:
/* bypass */
-- 
1.9.1



[PATCH 14/15] drm/exynos/fimc: simplify buffer queuing

2014-08-22 Thread Andrzej Hajda
The patch removes redundant checks, redundant HW reads
and simplifies code.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_fimc.c | 64 
 1 file changed, 15 insertions(+), 49 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index bd6628d..b20078e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -1124,67 +1124,34 @@ static int fimc_dst_set_size(struct device *dev, int 
swap,
return 0;
 }

-static int fimc_dst_get_buf_count(struct fimc_context *ctx)
-{
-   u32 cfg, buf_num;
-
-   cfg = fimc_read(ctx, EXYNOS_CIFCNTSEQ);
-
-   buf_num = hweight32(cfg);
-
-   DRM_DEBUG_KMS("buf_num[%d]\n", buf_num);
-
-   return buf_num;
-}
-
-static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id,
+static void fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id,
enum drm_exynos_ipp_buf_type buf_type)
 {
-   struct exynos_drm_ippdrv *ippdrv = >ippdrv;
-   bool enable;
-   u32 cfg;
-   u32 mask = 0x0001 << buf_id;
-   int ret = 0;
unsigned long flags;
+   u32 buf_num;
+   u32 cfg;

DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);

spin_lock_irqsave(>lock, flags);

-   /* mask register set */
cfg = fimc_read(ctx, EXYNOS_CIFCNTSEQ);

-   switch (buf_type) {
-   case IPP_BUF_ENQUEUE:
-   enable = true;
-   break;
-   case IPP_BUF_DEQUEUE:
-   enable = false;
-   break;
-   default:
-   dev_err(ippdrv->dev, "invalid buf ctrl parameter.\n");
-   ret =  -EINVAL;
-   goto err_unlock;
-   }
+   if (buf_type == IPP_BUF_ENQUEUE)
+   cfg |= (1 << buf_id);
+   else
+   cfg &= (1 << buf_id);

-   /* sequence id */
-   cfg &= ~mask;
-   cfg |= (enable << buf_id);
fimc_write(ctx, cfg, EXYNOS_CIFCNTSEQ);

-   /* interrupt enable */
-   if (buf_type == IPP_BUF_ENQUEUE &&
-   fimc_dst_get_buf_count(ctx) >= FIMC_BUF_START)
-   fimc_mask_irq(ctx, true);
+   buf_num = hweight32(cfg);

-   /* interrupt disable */
-   if (buf_type == IPP_BUF_DEQUEUE &&
-   fimc_dst_get_buf_count(ctx) <= FIMC_BUF_STOP)
+   if (buf_type == IPP_BUF_ENQUEUE && buf_num >= FIMC_BUF_START)
+   fimc_mask_irq(ctx, true);
+   else if (buf_type == IPP_BUF_DEQUEUE && buf_num <= FIMC_BUF_STOP)
fimc_mask_irq(ctx, false);

-err_unlock:
spin_unlock_irqrestore(>lock, flags);
-   return ret;
 }

 static int fimc_dst_set_addr(struct device *dev,
@@ -1242,7 +1209,9 @@ static int fimc_dst_set_addr(struct device *dev,
break;
}

-   return fimc_dst_set_buf_seq(ctx, buf_id, buf_type);
+   fimc_dst_set_buf_seq(ctx, buf_id, buf_type);
+
+   return 0;
 }

 static struct exynos_drm_ipp_ops fimc_dst_ops = {
@@ -1297,10 +1266,7 @@ static irqreturn_t fimc_irq_handler(int irq, void 
*dev_id)

DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);

-   if (fimc_dst_set_buf_seq(ctx, buf_id, IPP_BUF_DEQUEUE) < 0) {
-   DRM_ERROR("failed to dequeue.\n");
-   return IRQ_HANDLED;
-   }
+   fimc_dst_set_buf_seq(ctx, buf_id, IPP_BUF_DEQUEUE);

event_work->ippdrv = ippdrv;
event_work->buf_id[EXYNOS_DRM_OPS_DST] = buf_id;
-- 
1.9.1



[PATCH 13/15] drm/exynos/fimc: do not enable fimc twice

2014-08-22 Thread Andrzej Hajda
The patch removes redundant H/W activation.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_fimc.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index bbaf4f9..bd6628d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -1596,12 +1596,9 @@ static int fimc_ippdrv_start(struct device *dev, enum 
drm_exynos_ipp_cmd cmd)

fimc_clear_bits(ctx, EXYNOS_CIOCTRL, EXYNOS_CIOCTRL_WEAVE_MASK);

-   if (cmd == IPP_CMD_M2M) {
+   if (cmd == IPP_CMD_M2M)
fimc_set_bits(ctx, EXYNOS_MSCTRL, EXYNOS_MSCTRL_ENVID);

-   fimc_set_bits(ctx, EXYNOS_MSCTRL, EXYNOS_MSCTRL_ENVID);
-   }
-
return 0;
 }

-- 
1.9.1



[PATCH 12/15] drm/exynos/fimc: avoid clearing overflow bits

2014-08-22 Thread Andrzej Hajda
Overflow bits shall be cleared by H/W.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_fimc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index 3264ed3..bbaf4f9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -341,9 +341,6 @@ static bool fimc_check_ovf(struct fimc_context *ctx)
fimc_set_bits(ctx, EXYNOS_CIWDOFST,
EXYNOS_CIWDOFST_CLROVFIY | EXYNOS_CIWDOFST_CLROVFICB |
EXYNOS_CIWDOFST_CLROVFICR);
-   fimc_clear_bits(ctx, EXYNOS_CIWDOFST,
-   EXYNOS_CIWDOFST_CLROVFIY | EXYNOS_CIWDOFST_CLROVFICB |
-   EXYNOS_CIWDOFST_CLROVFICR);

dev_err(ippdrv->dev, "occurred overflow at %d, status 0x%x.\n",
ctx->id, status);
-- 
1.9.1



[PATCH 11/15] drm/exynos/ipp: remove events during command cleaning

2014-08-22 Thread Andrzej Hajda
Events were removed only during stop command, as a result
there were memory leaks if program prematurely exited.
This patch fixes it.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 155 
 1 file changed, 78 insertions(+), 77 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 6de75aa..ec88393 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -601,6 +601,81 @@ static void ipp_clean_mem_nodes(struct drm_device *drm_dev,
mutex_unlock(_node->mem_lock);
 }

+static void ipp_free_event(struct drm_pending_event *event)
+{
+   kfree(event);
+}
+
+static int ipp_get_event(struct drm_device *drm_dev,
+   struct drm_file *file,
+   struct drm_exynos_ipp_cmd_node *c_node,
+   struct drm_exynos_ipp_queue_buf *qbuf)
+{
+   struct drm_exynos_ipp_send_event *e;
+   unsigned long flags;
+
+   DRM_DEBUG_KMS("ops_id[%d]buf_id[%d]\n", qbuf->ops_id, qbuf->buf_id);
+
+   e = kzalloc(sizeof(*e), GFP_KERNEL);
+   if (!e) {
+   spin_lock_irqsave(_dev->event_lock, flags);
+   file->event_space += sizeof(e->event);
+   spin_unlock_irqrestore(_dev->event_lock, flags);
+   return -ENOMEM;
+   }
+
+   /* make event */
+   e->event.base.type = DRM_EXYNOS_IPP_EVENT;
+   e->event.base.length = sizeof(e->event);
+   e->event.user_data = qbuf->user_data;
+   e->event.prop_id = qbuf->prop_id;
+   e->event.buf_id[EXYNOS_DRM_OPS_DST] = qbuf->buf_id;
+   e->base.event = >event.base;
+   e->base.file_priv = file;
+   e->base.destroy = ipp_free_event;
+   mutex_lock(_node->event_lock);
+   list_add_tail(>base.link, _node->event_list);
+   mutex_unlock(_node->event_lock);
+
+   return 0;
+}
+
+static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node,
+   struct drm_exynos_ipp_queue_buf *qbuf)
+{
+   struct drm_exynos_ipp_send_event *e, *te;
+   int count = 0;
+
+   mutex_lock(_node->event_lock);
+   list_for_each_entry_safe(e, te, _node->event_list, base.link) {
+   DRM_DEBUG_KMS("count[%d]e[0x%x]\n", count++, (int)e);
+
+   /*
+* qbuf == NULL condition means all event deletion.
+* stop operations want to delete all event list.
+* another case delete only same buf id.
+*/
+   if (!qbuf) {
+   /* delete list */
+   list_del(>base.link);
+   kfree(e);
+   }
+
+   /* compare buffer id */
+   if (qbuf && (qbuf->buf_id ==
+   e->event.buf_id[EXYNOS_DRM_OPS_DST])) {
+   /* delete list */
+   list_del(>base.link);
+   kfree(e);
+   goto out_unlock;
+   }
+   }
+
+out_unlock:
+   mutex_unlock(_node->event_lock);
+   return;
+}
+
 static void ipp_clean_cmd_node(struct ipp_context *ctx,
struct drm_exynos_ipp_cmd_node *c_node)
 {
@@ -611,6 +686,9 @@ static void ipp_clean_cmd_node(struct ipp_context *ctx,
cancel_work_sync(_node->stop_work->work);
cancel_work_sync(_node->event_work->work);

+   /* put event */
+   ipp_put_event(c_node, NULL);
+
for_each_ipp_ops(i)
ipp_clean_mem_nodes(ctx->subdrv.drm_dev, c_node, i);

@@ -707,81 +785,6 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv 
*ippdrv,
return ret;
 }

-static void ipp_free_event(struct drm_pending_event *event)
-{
-   kfree(event);
-}
-
-static int ipp_get_event(struct drm_device *drm_dev,
-   struct drm_file *file,
-   struct drm_exynos_ipp_cmd_node *c_node,
-   struct drm_exynos_ipp_queue_buf *qbuf)
-{
-   struct drm_exynos_ipp_send_event *e;
-   unsigned long flags;
-
-   DRM_DEBUG_KMS("ops_id[%d]buf_id[%d]\n", qbuf->ops_id, qbuf->buf_id);
-
-   e = kzalloc(sizeof(*e), GFP_KERNEL);
-   if (!e) {
-   spin_lock_irqsave(_dev->event_lock, flags);
-   file->event_space += sizeof(e->event);
-   spin_unlock_irqrestore(_dev->event_lock, flags);
-   return -ENOMEM;
-   }
-
-   /* make event */
-   e->event.base.type = DRM_EXYNOS_IPP_EVENT;
-   e->event.base.length = sizeof(e->event);
-   e->event.user_data = qbuf->user_data;
-   e->event.prop_id = qbuf->prop_id;
-   e->event.buf_id[EXYNOS_DRM_OPS_DST] = qbuf->buf_id;
-   e->base.event = >event.base;
-   e->base.file_priv = file;
-   e->base.destroy = ipp_free_event;
-   mutex_lock(_node->event_lock);
-   list_add_tail(>base.link, _node->event_list);
-   mutex_unlock(_node->event_lock);
-
-   return 0;
-}
-
-static 

[PATCH 10/15] drm/exynos/ipp: stop hardware before freeing memory

2014-08-22 Thread Andrzej Hajda
Memory shouldn't be freed when hardware is still running.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index c72d8d1..6de75aa 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -1283,12 +1283,15 @@ static int ipp_stop_property(struct drm_device *drm_dev,
struct drm_exynos_ipp_cmd_node *c_node)
 {
struct drm_exynos_ipp_property *property = _node->property;
-   int ret = 0, i;
+   int i;

DRM_DEBUG_KMS("prop_id[%d]\n", property->prop_id);

/* put event */
ipp_put_event(c_node, NULL);
+   /* stop operations */
+   if (ippdrv->stop)
+   ippdrv->stop(ippdrv->dev, property->cmd);

/* check command */
switch (property->cmd) {
@@ -1304,16 +1307,10 @@ static int ipp_stop_property(struct drm_device *drm_dev,
break;
default:
DRM_ERROR("invalid operations.\n");
-   ret = -EINVAL;
-   goto err_clear;
+   return -EINVAL;
}

-err_clear:
-   /* stop operations */
-   if (ippdrv->stop)
-   ippdrv->stop(ippdrv->dev, property->cmd);
-
-   return ret;
+   return 0;
 }

 void ipp_sched_cmd(struct work_struct *work)
-- 
1.9.1



[PATCH 09/15] drm/exynos/ipp: replace work_struct casting with better constructs

2014-08-22 Thread Andrzej Hajda
Type casting should be avoided if possible. In case of
work_struct it can be simply replaced by reference to member field.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_fimc.c| 2 +-
 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 3 +--
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 6 +++---
 drivers/gpu/drm/exynos/exynos_drm_rotator.c | 3 +--
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index 35db665..3264ed3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -1307,7 +1307,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)

event_work->ippdrv = ippdrv;
event_work->buf_id[EXYNOS_DRM_OPS_DST] = buf_id;
-   queue_work(ippdrv->event_workq, (struct work_struct *)event_work);
+   queue_work(ippdrv->event_workq, _work->work);

return IRQ_HANDLED;
 }
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c 
b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
index 9e3ff16..c6a013f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
@@ -1326,8 +1326,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
buf_id[EXYNOS_DRM_OPS_SRC];
event_work->buf_id[EXYNOS_DRM_OPS_DST] =
buf_id[EXYNOS_DRM_OPS_DST];
-   queue_work(ippdrv->event_workq,
-   (struct work_struct *)event_work);
+   queue_work(ippdrv->event_workq, _work->work);
}

return IRQ_HANDLED;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 6ab6190..c72d8d1 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -791,7 +791,7 @@ static void ipp_handle_cmd_work(struct device *dev,

cmd_work->ippdrv = ippdrv;
cmd_work->c_node = c_node;
-   queue_work(ctx->cmd_workq, (struct work_struct *)cmd_work);
+   queue_work(ctx->cmd_workq, _work->work);
 }

 static int ipp_queue_buf_with_run(struct device *dev,
@@ -1319,7 +1319,7 @@ err_clear:
 void ipp_sched_cmd(struct work_struct *work)
 {
struct drm_exynos_ipp_cmd_work *cmd_work =
-   (struct drm_exynos_ipp_cmd_work *)work;
+   container_of(work, struct drm_exynos_ipp_cmd_work, work);
struct exynos_drm_ippdrv *ippdrv;
struct drm_exynos_ipp_cmd_node *c_node;
struct drm_exynos_ipp_property *property;
@@ -1532,7 +1532,7 @@ err_event_unlock:
 void ipp_sched_event(struct work_struct *work)
 {
struct drm_exynos_ipp_event_work *event_work =
-   (struct drm_exynos_ipp_event_work *)work;
+   container_of(work, struct drm_exynos_ipp_event_work, work);
struct exynos_drm_ippdrv *ippdrv;
struct drm_exynos_ipp_cmd_node *c_node;
int ret;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c 
b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
index 55af6b4..b6a37d4 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
@@ -156,8 +156,7 @@ static irqreturn_t rotator_irq_handler(int irq, void *arg)
event_work->ippdrv = ippdrv;
event_work->buf_id[EXYNOS_DRM_OPS_DST] =
rot->cur_buf_id[EXYNOS_DRM_OPS_DST];
-   queue_work(ippdrv->event_workq,
-   (struct work_struct *)event_work);
+   queue_work(ippdrv->event_workq, _work->work);
} else {
DRM_ERROR("the SFR is set illegally\n");
}
-- 
1.9.1



[PATCH 08/15] drm/exynos/ipp: clean memory nodes on command node cleaning

2014-08-22 Thread Andrzej Hajda
The nodes should be removed before removing command node.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 22bd551..6ab6190 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -604,11 +604,16 @@ static void ipp_clean_mem_nodes(struct drm_device 
*drm_dev,
 static void ipp_clean_cmd_node(struct ipp_context *ctx,
struct drm_exynos_ipp_cmd_node *c_node)
 {
+   int i;
+
/* cancel works */
cancel_work_sync(_node->start_work->work);
cancel_work_sync(_node->stop_work->work);
cancel_work_sync(_node->event_work->work);

+   for_each_ipp_ops(i)
+   ipp_clean_mem_nodes(ctx->subdrv.drm_dev, c_node, i);
+
/* delete list */
list_del(_node->list);

-- 
1.9.1



[PATCH 07/15] drm/exynos/ipp: move nodes cleaning to separate function

2014-08-22 Thread Andrzej Hajda
The patch introduces ipp_clean_mem_nodes function which replaces
redundant code. Additionally memory node function definitions
are moved up to increase its visibility.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 231 +++-
 1 file changed, 107 insertions(+), 124 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 728f3b9..22bd551 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -498,6 +498,109 @@ err_clear:
return ret;
 }

+static int ipp_put_mem_node(struct drm_device *drm_dev,
+   struct drm_exynos_ipp_cmd_node *c_node,
+   struct drm_exynos_ipp_mem_node *m_node)
+{
+   int i;
+
+   DRM_DEBUG_KMS("node[0x%x]\n", (int)m_node);
+
+   if (!m_node) {
+   DRM_ERROR("invalid dequeue node.\n");
+   return -EFAULT;
+   }
+
+   DRM_DEBUG_KMS("ops_id[%d]\n", m_node->ops_id);
+
+   /* put gem buffer */
+   for_each_ipp_planar(i) {
+   unsigned long handle = m_node->buf_info.handles[i];
+   if (handle)
+   exynos_drm_gem_put_dma_addr(drm_dev, handle,
+   c_node->filp);
+   }
+
+   /* conditionally remove from queue */
+   if (m_node->list.next)
+   list_del(_node->list);
+   kfree(m_node);
+
+   return 0;
+}
+
+static struct drm_exynos_ipp_mem_node
+   *ipp_get_mem_node(struct drm_device *drm_dev,
+   struct drm_file *file,
+   struct drm_exynos_ipp_cmd_node *c_node,
+   struct drm_exynos_ipp_queue_buf *qbuf)
+{
+   struct drm_exynos_ipp_mem_node *m_node;
+   struct drm_exynos_ipp_buf_info *buf_info;
+   int i;
+
+   m_node = kzalloc(sizeof(*m_node), GFP_KERNEL);
+   if (!m_node)
+   return ERR_PTR(-ENOMEM);
+
+   buf_info = _node->buf_info;
+
+   /* operations, buffer id */
+   m_node->ops_id = qbuf->ops_id;
+   m_node->prop_id = qbuf->prop_id;
+   m_node->buf_id = qbuf->buf_id;
+
+   DRM_DEBUG_KMS("m_node[0x%x]ops_id[%d]\n", (int)m_node, qbuf->ops_id);
+   DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]\n", qbuf->prop_id, m_node->buf_id);
+
+   for_each_ipp_planar(i) {
+   DRM_DEBUG_KMS("i[%d]handle[0x%x]\n", i, qbuf->handle[i]);
+
+   /* get dma address by handle */
+   if (qbuf->handle[i]) {
+   dma_addr_t *addr;
+
+   addr = exynos_drm_gem_get_dma_addr(drm_dev,
+   qbuf->handle[i], file);
+   if (IS_ERR(addr)) {
+   DRM_ERROR("failed to get addr.\n");
+   ipp_put_mem_node(drm_dev, c_node, m_node);
+   return ERR_PTR(-EFAULT);
+   }
+
+   buf_info->handles[i] = qbuf->handle[i];
+   buf_info->base[i] = *addr;
+   DRM_DEBUG_KMS("i[%d]base[0x%x]hd[0x%lx]\n", i,
+ buf_info->base[i], buf_info->handles[i]);
+   }
+   }
+
+   mutex_lock(_node->mem_lock);
+   list_add_tail(_node->list, _node->mem_list[qbuf->ops_id]);
+   mutex_unlock(_node->mem_lock);
+
+   return m_node;
+}
+
+static void ipp_clean_mem_nodes(struct drm_device *drm_dev,
+  struct drm_exynos_ipp_cmd_node *c_node, int ops)
+{
+   struct drm_exynos_ipp_mem_node *m_node, *tm_node;
+   struct list_head *head = _node->mem_list[ops];
+
+   mutex_lock(_node->mem_lock);
+
+   list_for_each_entry_safe(m_node, tm_node, head, list) {
+   int ret;
+
+   ret = ipp_put_mem_node(drm_dev, c_node, m_node);
+   if (ret)
+   DRM_ERROR("failed to put m_node.\n");
+   }
+
+   mutex_unlock(_node->mem_lock);
+}
+
 static void ipp_clean_cmd_node(struct ipp_context *ctx,
struct drm_exynos_ipp_cmd_node *c_node)
 {
@@ -599,90 +702,6 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv 
*ippdrv,
return ret;
 }

-static int ipp_put_mem_node(struct drm_device *drm_dev,
-   struct drm_exynos_ipp_cmd_node *c_node,
-   struct drm_exynos_ipp_mem_node *m_node)
-{
-   int i;
-
-   DRM_DEBUG_KMS("node[0x%x]\n", (int)m_node);
-
-   if (!m_node) {
-   DRM_ERROR("invalid dequeue node.\n");
-   return -EFAULT;
-   }
-
-   DRM_DEBUG_KMS("ops_id[%d]\n", m_node->ops_id);
-
-   /* put gem buffer */
-   for_each_ipp_planar(i) {
-   unsigned long handle = m_node->buf_info.handles[i];
-   if (handle)
-   exynos_drm_gem_put_dma_addr(drm_dev, handle,
- 

[PATCH 06/15] drm/exynos/ipp: free partially allocated resources on error

2014-08-22 Thread Andrzej Hajda
In case of allocation errors some already allocated buffers
were not freed. The patch fixes it.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 68 -
 1 file changed, 33 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 060a198..728f3b9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -599,6 +599,37 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv 
*ippdrv,
return ret;
 }

+static int ipp_put_mem_node(struct drm_device *drm_dev,
+   struct drm_exynos_ipp_cmd_node *c_node,
+   struct drm_exynos_ipp_mem_node *m_node)
+{
+   int i;
+
+   DRM_DEBUG_KMS("node[0x%x]\n", (int)m_node);
+
+   if (!m_node) {
+   DRM_ERROR("invalid dequeue node.\n");
+   return -EFAULT;
+   }
+
+   DRM_DEBUG_KMS("ops_id[%d]\n", m_node->ops_id);
+
+   /* put gem buffer */
+   for_each_ipp_planar(i) {
+   unsigned long handle = m_node->buf_info.handles[i];
+   if (handle)
+   exynos_drm_gem_put_dma_addr(drm_dev, handle,
+   c_node->filp);
+   }
+
+   /* conditionally remove from queue */
+   if (m_node->list.next)
+   list_del(_node->list);
+   kfree(m_node);
+
+   return 0;
+}
+
 static struct drm_exynos_ipp_mem_node
*ipp_get_mem_node(struct drm_device *drm_dev,
struct drm_file *file,
@@ -634,7 +665,8 @@ static struct drm_exynos_ipp_mem_node
qbuf->handle[i], file);
if (IS_ERR(addr)) {
DRM_ERROR("failed to get addr.\n");
-   goto err_clear;
+   ipp_put_mem_node(drm_dev, c_node, m_node);
+   return ERR_PTR(-EFAULT);
}

buf_info->handles[i] = qbuf->handle[i];
@@ -649,40 +681,6 @@ static struct drm_exynos_ipp_mem_node
mutex_unlock(_node->mem_lock);

return m_node;
-
-err_clear:
-   kfree(m_node);
-   return ERR_PTR(-EFAULT);
-}
-
-static int ipp_put_mem_node(struct drm_device *drm_dev,
-   struct drm_exynos_ipp_cmd_node *c_node,
-   struct drm_exynos_ipp_mem_node *m_node)
-{
-   int i;
-
-   DRM_DEBUG_KMS("node[0x%x]\n", (int)m_node);
-
-   if (!m_node) {
-   DRM_ERROR("invalid dequeue node.\n");
-   return -EFAULT;
-   }
-
-   DRM_DEBUG_KMS("ops_id[%d]\n", m_node->ops_id);
-
-   /* put gem buffer */
-   for_each_ipp_planar(i) {
-   unsigned long handle = m_node->buf_info.handles[i];
-   if (handle)
-   exynos_drm_gem_put_dma_addr(drm_dev, handle,
-   c_node->filp);
-   }
-
-   /* delete list in queue */
-   list_del(_node->list);
-   kfree(m_node);
-
-   return 0;
 }

 static void ipp_free_event(struct drm_pending_event *event)
-- 
1.9.1



[PATCH 05/15] drm/exynos/ipp: remove unused field in command node

2014-08-22 Thread Andrzej Hajda
Since command node have file pointer dev field became useless.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 1 -
 drivers/gpu/drm/exynos/exynos_drm_ipp.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 81f780e..060a198 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -444,7 +444,6 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, 
void *data,
property->prop_id, property->cmd, (int)ippdrv);

/* stored property information and ippdrv in private data */
-   c_node->dev = dev;
c_node->property = *property;
c_node->state = IPP_STATE_IDLE;
c_node->filp = file;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.h 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.h
index 0311035..2a61547 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.h
@@ -48,7 +48,6 @@ struct drm_exynos_ipp_cmd_work {
 /*
  * A structure of command node.
  *
- * @dev: IPP device.
  * @list: list head to command queue information.
  * @event_list: list head of event.
  * @mem_list: list head to source,destination memory queue information.
@@ -65,7 +64,6 @@ struct drm_exynos_ipp_cmd_work {
  * @filp: associated file pointer.
  */
 struct drm_exynos_ipp_cmd_node {
-   struct device   *dev;
struct list_headlist;
struct list_headevent_list;
struct list_headmem_list[EXYNOS_DRM_OPS_MAX];
-- 
1.9.1



[PATCH 04/15] drm/exynos/ipp: remove only related commands on file close

2014-08-22 Thread Andrzej Hajda
On file close driver should remove only command nodes created
via this file.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index bbe9968..81f780e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -1681,14 +1681,11 @@ static int ipp_subdrv_open(struct drm_device *drm_dev, 
struct device *dev,
 static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev,
struct drm_file *file)
 {
-   struct drm_exynos_file_private *file_priv = file->driver_priv;
struct exynos_drm_ippdrv *ippdrv = NULL;
struct ipp_context *ctx = get_ipp_context(dev);
struct drm_exynos_ipp_cmd_node *c_node, *tc_node;
int count = 0;

-   DRM_DEBUG_KMS("for priv[0x%x]\n", (int)file_priv->ipp_dev);
-
list_for_each_entry(ippdrv, _drm_ippdrv_list, drv_list) {
mutex_lock(>cmd_lock);
list_for_each_entry_safe(c_node, tc_node,
@@ -1696,7 +1693,7 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, 
struct device *dev,
DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n",
count++, (int)ippdrv);

-   if (c_node->dev == file_priv->ipp_dev) {
+   if (c_node->filp == file) {
/*
 * userland goto unnormal state. process killed.
 * and close the file.
-- 
1.9.1



[PATCH 03/15] drm/exynos/ipp: move file reference from memory to command node

2014-08-22 Thread Andrzej Hajda
Command node should contain file reference to distinguish commands
created by different processes.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 5 ++---
 drivers/gpu/drm/exynos/exynos_drm_ipp.h | 2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 9770966..bbe9968 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -75,7 +75,6 @@ struct drm_exynos_ipp_mem_node {
u32 prop_id;
u32 buf_id;
struct drm_exynos_ipp_buf_info  buf_info;
-   struct drm_file *filp;
 };

 /*
@@ -448,6 +447,7 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, 
void *data,
c_node->dev = dev;
c_node->property = *property;
c_node->state = IPP_STATE_IDLE;
+   c_node->filp = file;

c_node->start_work = ipp_create_cmd_work();
if (IS_ERR(c_node->start_work)) {
@@ -645,7 +645,6 @@ static struct drm_exynos_ipp_mem_node
}
}

-   m_node->filp = file;
mutex_lock(_node->mem_lock);
list_add_tail(_node->list, _node->mem_list[qbuf->ops_id]);
mutex_unlock(_node->mem_lock);
@@ -677,7 +676,7 @@ static int ipp_put_mem_node(struct drm_device *drm_dev,
unsigned long handle = m_node->buf_info.handles[i];
if (handle)
exynos_drm_gem_put_dma_addr(drm_dev, handle,
-   m_node->filp);
+   c_node->filp);
}

/* delete list in queue */
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.h 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.h
index 6f48d62..0311035 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.h
@@ -62,6 +62,7 @@ struct drm_exynos_ipp_cmd_work {
  * @stop_work: stop command work structure.
  * @event_work: event work structure.
  * @state: state of command node.
+ * @filp: associated file pointer.
  */
 struct drm_exynos_ipp_cmd_node {
struct device   *dev;
@@ -78,6 +79,7 @@ struct drm_exynos_ipp_cmd_node {
struct drm_exynos_ipp_cmd_work *stop_work;
struct drm_exynos_ipp_event_work *event_work;
enum drm_exynos_ipp_state   state;
+   struct drm_file *filp;
 };

 /*
-- 
1.9.1



[PATCH 02/15] drm/exynos/ipp: cancel works before command node clean

2014-08-22 Thread Andrzej Hajda
All pending works should be canceled prior to its removal.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index da917ca..9770966 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -502,6 +502,11 @@ err_clear:
 static void ipp_clean_cmd_node(struct ipp_context *ctx,
struct drm_exynos_ipp_cmd_node *c_node)
 {
+   /* cancel works */
+   cancel_work_sync(_node->start_work->work);
+   cancel_work_sync(_node->stop_work->work);
+   cancel_work_sync(_node->event_work->work);
+
/* delete list */
list_del(_node->list);

-- 
1.9.1



[PATCH 01/15] drm/exynos/ipp: remove fake pm callbacks

2014-08-22 Thread Andrzej Hajda
PM callbacks in ipp core do nothing, so the patch removes it.

Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 51 -
 1 file changed, 51 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c 
b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index c411399..da917ca 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -1808,63 +1808,12 @@ static int ipp_remove(struct platform_device *pdev)
return 0;
 }

-static int ipp_power_ctrl(struct ipp_context *ctx, bool enable)
-{
-   DRM_DEBUG_KMS("enable[%d]\n", enable);
-
-   return 0;
-}
-
-#ifdef CONFIG_PM_SLEEP
-static int ipp_suspend(struct device *dev)
-{
-   struct ipp_context *ctx = get_ipp_context(dev);
-
-   if (pm_runtime_suspended(dev))
-   return 0;
-
-   return ipp_power_ctrl(ctx, false);
-}
-
-static int ipp_resume(struct device *dev)
-{
-   struct ipp_context *ctx = get_ipp_context(dev);
-
-   if (!pm_runtime_suspended(dev))
-   return ipp_power_ctrl(ctx, true);
-
-   return 0;
-}
-#endif
-
-#ifdef CONFIG_PM_RUNTIME
-static int ipp_runtime_suspend(struct device *dev)
-{
-   struct ipp_context *ctx = get_ipp_context(dev);
-
-   return ipp_power_ctrl(ctx, false);
-}
-
-static int ipp_runtime_resume(struct device *dev)
-{
-   struct ipp_context *ctx = get_ipp_context(dev);
-
-   return ipp_power_ctrl(ctx, true);
-}
-#endif
-
-static const struct dev_pm_ops ipp_pm_ops = {
-   SET_SYSTEM_SLEEP_PM_OPS(ipp_suspend, ipp_resume)
-   SET_RUNTIME_PM_OPS(ipp_runtime_suspend, ipp_runtime_resume, NULL)
-};
-
 struct platform_driver ipp_driver = {
.probe  = ipp_probe,
.remove = ipp_remove,
.driver = {
.name   = "exynos-drm-ipp",
.owner  = THIS_MODULE,
-   .pm = _pm_ops,
},
 };

-- 
1.9.1



[PATCH 00/15] drm/exynos/ipp: image post processing fixes and improvements, part four

2014-08-22 Thread Andrzej Hajda
This set of patches contains various improvement and fixes
for exynos_drm ipp framework.
The patchset is based on exynos-drm-next branch.

IPP framework was tested for regressions on exynos4210-trats target.

Regards
Andrzej


Andrzej Hajda (15):
  drm/exynos/ipp: remove fake pm callbacks
  drm/exynos/ipp: cancel works before command node clean
  drm/exynos/ipp: move file reference from memory to command node
  drm/exynos/ipp: remove only related commands on file close
  drm/exynos/ipp: remove unused field in command node
  drm/exynos/ipp: free partially allocated resources on error
  drm/exynos/ipp: move nodes cleaning to separate function
  drm/exynos/ipp: clean memory nodes on command node cleaning
  drm/exynos/ipp: replace work_struct casting with better constructs
  drm/exynos/ipp: stop hardware before freeing memory
  drm/exynos/ipp: remove events during command cleaning
  drm/exynos/fimc: avoid clearing overflow bits
  drm/exynos/fimc: do not enable fimc twice
  drm/exynos/fimc: simplify buffer queuing
  drm/exynos/fimc: fix source buffer registers

 drivers/gpu/drm/exynos/exynos_drm_fimc.c|  90 ++-
 drivers/gpu/drm/exynos/exynos_drm_gsc.c |   3 +-
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 369 
 drivers/gpu/drm/exynos/exynos_drm_ipp.h |   4 +-
 drivers/gpu/drm/exynos/exynos_drm_rotator.c |   3 +-
 5 files changed, 180 insertions(+), 289 deletions(-)

-- 
1.9.1



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

2014-08-22 Thread Bruno Prémont
On Thu, 21 Aug 2014 23:39:31 -0500 Bjorn Helgaas wrote:
> On Thu, Aug 21, 2014 at 4:34 PM, Bruno Pr?mont wrote:
> 
> > A second step would then be to tune vgaarb's initial selection.
> > Bjorn, is it possible to verify which I/O ports are decoded by a PCI
> > device at the time of adding it to vgaarb? If so, how? I would like to
> > check for legacy VGA I/O range (0x03B0-0x03DF) and only let vgaarb set
> > a device as default if that I/O range is decoded by the device.
> 
> I don't know of a way.  I'm pretty sure VGA devices are allowed to
> respond to those legacy addresses even if there's no BAR for them, but
> I haven't found a spec reference for this.  There is the VGA Enable
> bit in bridges, of course (PCI Bridge spec, sec 12.1.1.  If the VGA
> device is behind a bridge that doesn't have the VGA Enable bit set, it
> probably isn't the default device.

Those VGA devices behind bridges are the easy ones that vgaarb selects
properly.
It's the ones not behind a bridge (integrated graphics) like the intel
one that cause problems.

For Andreas's system the discrete nvidia GPU has no I/O enabled
according to PCI_COMMAND flags while the integrated intel one does have
them (that's why the Intel GPU is chosen).

Unfortunately I don't know what makes his system choke at boot time as
he did not provide logs for the failing case.


If there is no better way to detect the proper legacy VGA device the
only remaining option would be to perform the screen_info testing in 
vga_arb_device_init() enclosed in arch #ifdef...

Bruno


[Bug 82709] OpenCL not working on radeon hainan

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82709

--- Comment #5 from Pali Roh?r  ---
@Tom Stellard: Are you going to fix this problem in llvm/clang/libclc?

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


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

2014-08-22 Thread Bjorn Helgaas
On Thu, Aug 21, 2014 at 4:34 PM, Bruno Pr?mont
 wrote:

> A second step would then be to tune vgaarb's initial selection.
> Bjorn, is it possible to verify which I/O ports are decoded by a PCI
> device at the time of adding it to vgaarb? If so, how? I would like to
> check for legacy VGA I/O range (0x03B0-0x03DF) and only let vgaarb set
> a device as default if that I/O range is decoded by the device.

I don't know of a way.  I'm pretty sure VGA devices are allowed to
respond to those legacy addresses even if there's no BAR for them, but
I haven't found a spec reference for this.  There is the VGA Enable
bit in bridges, of course (PCI Bridge spec, sec 12.1.1.  If the VGA
device is behind a bridge that doesn't have the VGA Enable bit set, it
probably isn't the default device.

Bjorn


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

2014-08-22 Thread Bruno Prémont
On Thu, 21 August 2014 Andreas Noever  wrote:
> dmesg with your patches and vga_set_default_device commented out
> (after "vgaarb: Boot video device...") as otherwise the system won't
> boot.

Do you know more precisely where your system hangs when it does not boot?
That's the part I can't find in this thread.
Is it dead-locking/freezing or just booting without displaying anything
(though network coming up if connected, keyboard working (e.g. caps key).

Try blacklisting both i915 and nouveau modules (and each one individually)
an see how far your system gets. Also make sure your network comes up
automatically, so that even if display remains black you can check via
network if your system is alive and what it complains about.

> dmesg | grep vgaarb
> [1.340118] vgaarb: PCI::00:02.0 PCI_COMMAND=0007
> [1.340119] vgaarb: Boot video device: PCI::00:02.0
> [1.340120] vgaarb: device added:
> PCI::00:02.0,decodes=io+mem,owns=io+mem,locks=none
> [1.340130] vgaarb: PCI::01:00.0 PCI_COMMAND=0006
> [1.340132] vgaarb: PCI::01:00.0, bridge PCI::00:01.0
> PCI_BRIDGE_CONTROL=
> [1.340133] vgaarb: device added:
> PCI::01:00.0,decodes=io+mem,owns=none,locks=none
> [1.340135] vgaarb: loaded
> [1.340136] vgaarb: bridge control possible :01:00.0
> [1.340136] vgaarb: no bridge control possible :00:02.0
> [3.798430] vgaarb: device changed decodes:
> PCI::00:02.0,olddecodes=io+mem,decodes=none:owns=io+mem
> 
> 
> If the line is not commented out then vgaarb simply declares the first
> (enabled) device to be the default one, which is incorrect. And the
> overwrite logic in pci_fixup_video is not triggered, since a default
> device has already been set.

The initial selection I am doing does match the PCI_COMMAND flags
as set for the devices (or masked by parent bridge), but probably none
of them has active legacy VGA I/O ports.
So the question would rather be how to determine which I/O port is active
for the Intel graphics and adjust vgaarb's "decodes"/owns interpretation
on that basis (there is no I/O active for the nvidia one).
I'm thinking about selecting only device that decodes the legacy VGA I/O
range and not those with any some other I/O range.

The short-term fix probably is to just unconditionally perform the
screen_info check in pci_fixup_video() while leaving vgaarb's initial
card selection alone for legacy hardware. Thus replicating efifb's
original behavior (and also get back incorrect ROM_SHADOW flagging).
Corresponding patch below (on top of both patches in this series, but
should apply without them as well). As mentioned in the patch this
papers over the real issue.


A second step would then be to tune vgaarb's initial selection.
Bjorn, is it possible to verify which I/O ports are decoded by a PCI
device at the time of adding it to vgaarb? If so, how? I would like to
check for legacy VGA I/O range (0x03B0-0x03DF) and only let vgaarb set
a device as default if that I/O range is decoded by the device.

Bruno



> On Wed, Aug 20, 2014 at 9:11 AM, Bruno Pr?mont wrote:
> > On Wed, 20 Aug 2014 07:55:08 +0200 Bruno Pr?mont wrote:
> >> On Tue, 19 Aug 2014 17:45:00 +0200 Andreas Noever wrote:
> >> > On Sat, Aug 16, 2014 at 7:21 PM, Bruno Pr?mont wrote:
> >> > > This series improves on commit 20cde694027e (x86, ia64: Move EFI_FB
> >> > > vga_default_device() initialization to pci_vga_fixup()):
> >> > > - cleanup remaining but always-true #ifndefs
> >> > > - fix boot regression on dual-GPU Macs
> >> > >
> >> > > Andreas, can you please test this series? It is a modification from
> >> > > previous testing patch that should still work fine for you.
> >> > > That testing patch would have been failing X startup on old BIOS 
> >> > > systems
> >> > > booted with vga=normal (or otherwise in VGA text mode).
> >> > >
> >> > >
> >> > > Greg, in case you have scheduled above-mentioned commit for your next
> >> > > stable iteration, please hold it back in the queue until this follow-up
> >> > > has landed and can be included within the same stable update as alone
> >> > > that patch regresses for Macs with dual-GPU and using efifb.
> >> > >
> >> > > Bruno
> >> >
> >> > Fails again (with and without efifb).
> >> >
> >> > The vga_set_default_device in vga_arbiter_add_pci_device is at fault.
> >> > It sets the boot video device to intel. Removing it makes the system
> >> > bootable again.
> >>
> >> Could you provide your whole kernel log? I would like to understand
> >> how your vga devices are setup and why it starts the wrong way.
> >>
> >> If you can grab kernel log from both working and failing setups it
> >> would be even better. The failing one is interesting for where exactly it
> >> starts failing at boot.
> >
> > While collecting debug logs, please apply following patch to get
> > PCI command and bridge control registers as configured when vgaarb looks
> > at them.

From: Bruno Pr?mont 
Subject: [PATCH] x86: Force 

[Bug 82791] GPU lock when using "Death Dance" in Tales of Maj'Eyal

2014-08-22 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=82791

--- Comment #5 from TheLetterN  ---
Comment on attachment 104851
  --> https://bugs.freedesktop.org/attachment.cgi?id=104851
glxinfo

Update: This bug is still present in mesa 10.2.6

-- 
You are receiving this mail because:
You are the assignee for the bug.
-- next part --
An HTML attachment was scrubbed...
URL: