[Bug 97886] radeon r300 vdpau broken

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97886

Christian König  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|NEEDINFO|RESOLVED

--- Comment #6 from Christian König  ---
We no longer support the VDPAU backend for r300.

It never was anything more than pure display and shader based MPEG2 decoding,
so not really useful except for testing.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [GIT PULL] drm/tegra: Changes for v4.16-rc1

2018-01-07 Thread Thierry Reding
On Fri, Jan 05, 2018 at 05:58:17PM +0300, Dmitry Osipenko wrote:
> On 05.01.2018 17:17, Thierry Reding wrote:
> > Hi Dave,
> > 
> > The following changes since commit 9428088c90b6f7d5edd2a1b0d742c75339b36f6e:
> > 
> >   drm/qxl: reapply cursor after resetting primary (2017-12-08 13:37:02 
> > +1000)
> > 
> > are available in the Git repository at:
> > 
> >   git://anongit.freedesktop.org/tegra/linux tags/drm/tegra/for-4.16-rc1
> > 
> > for you to fetch changes up to ebae8d07435ae91314f4a28d69b530d09c625815:
> > 
> >   drm/tegra: dc: Implement legacy blending (2017-12-21 14:55:55 +0100)
> > 
> > Thanks,
> > Thierry
> > 
> > 
> > drm/tegra: Changes for v4.16-rc1
> > 
> > The bulk of these changes are preparation work and addition of support
> > for Tegra186. Currently only HDMI output (the primary output on Jetson
> > TX2) is supported, but the hardware is also capable of doing DSI and
> > DisplayPort.
> > 
> > Tegra DRM now also uses the atomic commit helpers instead of the open-
> > coded variant that was only doing half its job. As a bit of a byproduct
> > of the Tegra186 support the driver also gained HDMI 2.0 as well as zpos
> > property support.
> > 
> > Along the way there are also a few patches to clean up a few things and
> > fix minor issues.
> > 
> > 
> > Arnd Bergmann (2):
> >   drm/tegra: Mark Tegra186 display hub PM functions __maybe_unused
> >   drm/tegra: Fix non-debugfs builds
> > 
> > Dmitry Osipenko (3):
> >   drm/tegra: dc: Link DC1 to DC0 on Tegra20
> >   drm/tegra: gem: Correct iommu_map_sg() error checking
> >   drm/tegra: Correct timeout in tegra_syncpt_wait
> > 
> > Thierry Reding (43):
> >   drm/fourcc: Fix fourcc_mod_code() definition
> >   drm/tegra: Sanitize format modifiers
> >   gpu: host1x: Rewrite conditional for better readability
> >   gpu: host1x: Cleanup on initialization failure
> >   dt-bindings: display: tegra: Update SOR for Tegra186
> >   drm/tegra: dc: Move register definitions into a table
> >   drm/tegra: dsi: Move register definitions into a table
> >   drm/tegra: hdmi: Move register definitions into a table
> >   drm/tegra: sor: Move register definitions into a table
> >   drm/tegra: dc: Reshuffle some code
> >   drm/tegra: dc: Register debugfs in ->late_register()
> >   drm/tegra: dsi: Register debugfs in ->late_register()
> >   drm/tegra: hdmi: Register debugfs in ->late_register()
> >   drm/tegra: sor: Root debugfs files at the connector
> >   drm/tegra: sor: Register debugfs in ->late_register()
> >   drm/tegra: Do not wrap lines unnecessarily
> >   drm/tegra: vic: Properly align arguments
> >   drm/tegra: dc: Support background color
> >   drm/tegra: Use atomic commit helpers
> >   drm/tegra: Remove custom page-flip handler
> >   drm/tegra: dc: Remove tegra_primary_plane_destroy()
> >   drm/tegra: dc: Remove duplicate plane funcs
> >   drm/tegra: dc: Remove tegra_overlay_plane_destroy()
> >   drm/tegra: dc: Remove duplicate plane funcs
> >   drm/tegra: dc: Move state definition to header
> >   drm/tegra: Move common plane code to separate file
> >   drm/tegra: Add Tegra186 display hub support
> >   drm/tegra: dc: Add Tegra186 support
> >   drm/tegra: Support ARGB and ABGR formats
> >   drm/tegra: sor: Parameterize register offsets
> >   drm/tegra: sor: Add Tegra186 support
> >   drm/tegra: sor: Support HDMI 2.0 modes
> >   drm/tegra: dpaux: Implement runtime PM
> >   drm/tegra: dpaux: Add Tegra186 support
> >   drm/tegra: fb: Force alpha formats
> >   drm/tegra: dc: Support more formats
> >   drm/tegra: dc: Use direct offset to plane registers
> >   drm/tegra: dc: Remove redundant spinlock
> >   drm/tegra: Implement zpos property
> >   gpu: host1x: Use IOMMU groups
> >   drm/tegra: Use IOMMU groups
> >   drm/tegra: dpaux: Keep reset defaults for hybrid pad parameters
> 
> 
> >   drm/tegra: dc: Implement legacy blending
> 
> Please hold on this patch. First of all it doesn't work correctly, see my last
> reply to the patch. Secondly, it introduces bug that breaks YUV plane.

I thought we had already concluded that this version doesn't cause any
regressions. And since this is new functionality I'm not too worried if
it doesn't work in all cases, we've got plenty of time to fix those up.

As for the YUV plane bug, can you point me at a test case, or describe
what exactly you're trying to do so that I can reproduce and fix it?

I'd like to make forward progress on this rather than hold back on
patches out of fear that they may break existing functionality. In order
to do that we need tests that can be run to validate existing
functionality.

Thierry


signature.asc
Description: PGP signature
___
dri-deve

[Bug 104534] Dying Light Black Screen with Mesa 17.3.1 and AMD OLAND

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104534

siyia  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|NEW |RESOLVED

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104534] Dying Light Black Screen with Mesa 17.3.1 and AMD OLAND

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104534

--- Comment #1 from siyia  ---
after further investigation and reading some posts at
https://www.gamingonlinux.com/forum/topic/2766/page=7 the bug appears to be
arch-steam related, closing...

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104527] Amdgpu locks up occasionally when running 3d applications

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104527

--- Comment #2 from Michal Suchanek  ---
ok, AFAICT this problem only happens with Wine when it uses an "optimization"
(default on) that does not guarantee correct rendering order. In extrema cases
(like when creating new scene with many objects) this probably means that some
objects/buffers are used before they are created/uploaded resulting in bogus
code and crashing the card.

Of course it should not crash whatever the user does but given the silicone is
not impeccable it might be difficult to avoid in practice, even on the more
recent cards.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104534] Dying Light Black Screen with Mesa 17.3.1 and AMD OLAND

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104534

Bug ID: 104534
   Summary: Dying Light Black Screen with Mesa 17.3.1 and AMD
OLAND
   Product: Mesa
   Version: 17.3
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: major
  Priority: medium
 Component: Drivers/Gallium/radeonsi
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: eutychio...@gmail.com
QA Contact: dri-devel@lists.freedesktop.org

Created attachment 136607
  --> https://bugs.freedesktop.org/attachment.cgi?id=136607&action=edit
what i see when the game loads before exiting to desktop

Hello, when loading dying light from steam i get opengl erros that my gpu does
not support opengl 3.3., then i set MESA_GL_VERSION_OVERRIDE=4.5
MESA_GLSL_VERSION_OVERRIDE=450 %command% in steam as it is recommended, in
steam launch options and the game loads with no warnings but the screen is all
black and all i can see is a white loading line,after the loading completes the
game exits to desktop and i cannot play.

os: Arch Linux
gpu: r7 240
driver: Mesa 17.3.1
kernel: 4.14.12
kernel module: amdgpu

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104492] Compute Shader: Wrong alignment when assigning struct value to structured SSBO

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104492

Timothy Arceri  changed:

   What|Removed |Added

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

--- Comment #6 from Timothy Arceri  ---
Fixed by:

commit 7e025def6d7d3d6bf94facd6ec6d956f40cbb31e
Author: Florian Will 
Date:   Fri Jan 5 15:33:31 2018 +0100

glsl: Respect std430 layout in lower_buffer_access

Respect the std430 rules for determining offset and size of struct
members when using a std430 buffer. std140 rules lead to wrong buffer
offsets in that case.

Fixes my test case attached in Bugzilla. No piglit changes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104492
Reviewed-by: Timothy Arceri 

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 102905] [R600] Miscompilation of TGSI to VLIW causes artifacts in Gallium Nine with Crysis2 bump mapping

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=102905

--- Comment #1 from i...@yahoo.com ---
This is how the modified (working) shader looks like when compiled.
---
FRAG
PROPERTY FS_COORD_ORIGIN UPPER_LEFT
PROPERTY MUL_ZERO_WINS 1
DCL IN[0], GENERIC[0], PERSPECTIVE, CENTROID
DCL IN[1], GENERIC[1], PERSPECTIVE
DCL IN[2], GENERIC[2], PERSPECTIVE
DCL IN[3], GENERIC[3], PERSPECTIVE
DCL IN[4], GENERIC[4], PERSPECTIVE
DCL OUT[0], COLOR[1]
DCL OUT[1], COLOR
DCL SAMP[1]
DCL SAMP[2]
DCL SAMP[3]
DCL SAMP[4]
DCL CONST[0..20]
DCL TEMP[0..1]
DCL TEMP[2], LOCAL
DCL TEMP[3..4]
IMM[0] FLT32 {2.,-1., 1., 0.5000}
IMM[1] FLT32 {0.0039, 0.,
340282346638528859811704183484516925440., 0.}
  0: MOV TEMP[0].x, IMM[1].
  1: MUL OUT[0].w, TEMP[0]., CONST[13].
  2: TEX TEMP[0], IN[4], SAMP[4], 2D
  3: MUL TEMP[0].x, TEMP[0]., IN[4].
  4: POW_SAT TEMP[1].x, |TEMP[0].|, CONST[20].
  5: TEX TEMP[0], IN[1], SAMP[1], 2D
  6: MAD TEMP[0].xy, TEMP[0], IMM[0]., IMM[0].
  7: DP2 TEMP[2].x, TEMP[0], -TEMP[0]
  8: ADD_SAT TEMP[0].w, IMM[0]., TEMP[2].
  9: RSQ TEMP[2], |TEMP[0].|
 10: MIN TEMP[0].w, IMM[1]., TEMP[2]
 11: RCP TEMP[0].z, TEMP[0].
 12: TEX TEMP[3], IN[1], SAMP[3], 2D
 13: MAD TEMP[1].yz, TEMP[3].xxyw, IMM[0]., IMM[0].
 14: DP2 TEMP[2].x, TEMP[1].yzzw, -TEMP[1].yzzw
 15: ADD_SAT TEMP[0].w, IMM[0]., TEMP[2].
 16: RSQ TEMP[2], |TEMP[0].|
 17: MIN TEMP[0].w, IMM[1]., TEMP[2]
 18: RCP TEMP[1].w, TEMP[0].
 19: LRP TEMP[3].xyz, TEMP[1]., TEMP[1].yzww, TEMP[0]
 20: MUL TEMP[0].xyz, TEMP[3]., IN[3]
 21: MAD TEMP[0].xyz, TEMP[3]., IN[2], TEMP[0]
 22: MOV TEMP[1].xyz, IN[2]
 23: MUL TEMP[3].xyw, TEMP[1].zxzy, IN[3].yzzx
 24: MAD TEMP[1].xyz, TEMP[1].yzxw, IN[3].zxyw, -TEMP[3].xyww
 25: MUL TEMP[1].xyz, TEMP[1], IN[2].
 26: MAD TEMP[0].xyz, TEMP[3]., TEMP[1], TEMP[0]
 27: MAD TEMP[0].xyz, TEMP[0], IMM[0]., IMM[0].
 28: MAD TEMP[0].xyz, TEMP[0], IMM[0]., IMM[0].
 29: DP3 TEMP[2].x, TEMP[0], TEMP[0]
 30: RSQ TEMP[2].x, TEMP[2].
 31: MIN TEMP[2].x, IMM[1]., TEMP[2].
 32: MUL TEMP[1].xyz, TEMP[0], TEMP[2].
 33: MAX TEMP[0].x, |TEMP[1].|, |TEMP[1].|
 34: MAX TEMP[3].x, |TEMP[1].|, TEMP[0].
 35: ADD TEMP[0].xy, |TEMP[1].zyzw|, -TEMP[3].
 36: RCP TEMP[0].z, TEMP[3].
 37: CMP TEMP[0].yw, TEMP[0]., |TEMP[1].xyzz|, |TEMP[1].xxzz|
 38: MOV TEMP[4], TEMP[0]
 39: CMP TEMP[0].xy, TEMP[4]., TEMP[0].ywzw, |TEMP[1]|
 40: MUL TEMP[1].xyz, TEMP[1], TEMP[0].
 41: ADD TEMP[0].z, -TEMP[0]., TEMP[0].
 42: CMP TEMP[0].xy, TEMP[0]., TEMP[0].yxzw, TEMP[0]
 43: RCP TEMP[1].w, TEMP[0].
 44: MUL TEMP[0].z, TEMP[0]., TEMP[1].
 45: MOV TEMP[0].w, IMM[1].
 46: TXL TEMP[0], TEMP[0].xzww, SAMP[2], 2D
 47: MUL TEMP[0].xyz, TEMP[1], TEMP[0].
 48: MAD OUT[0].xyz, TEMP[0], IMM[0]., IMM[0].
 49: MOV OUT[1], IN[0].
 50: END

= SHADER #81  PS/REDWOOD/EVERGREEN
=
= 416 dw = 19 gprs = 0 stack
===
  400b a0a8 ALU 43 @22 KC0[CB0:0-15]
 0022  00380c00 00146b80 1  x: INTERP_ZW  __.x,  R0.w, Param0.x
VEC_210
 0024  00380800 20146b80y: INTERP_ZW  __.y,  R0.z, Param0.x
VEC_210
 0026  00380c00 40346b90z: INTERP_ZW  R1.z,  R0.w, Param0.x
VEC_210
 0028  80380800 60346b90w: INTERP_ZW  R1.w,  R0.z, Param0.x
VEC_210
 0030  00380c00 00346b10 2  x: INTERP_XY  R1.x,  R0.w, Param0.x
VEC_210
 0032  00380800 20346b10y: INTERP_XY  R1.y,  R0.z, Param0.x
VEC_210
 0034  00380c00 40146b00z: INTERP_XY  __.z,  R0.w, Param0.x
VEC_210
 0036  80380800 60146b00w: INTERP_XY  __.w,  R0.z, Param0.x
VEC_210
 0038  00382400 00146b80 3  x: INTERP_ZW  __.x,  R0.y, Param1.x
VEC_210
 0040  00382000 20146b80y: INTERP_ZW  __.y,  R0.x, Param1.x
VEC_210
 0042  00382400 40546b90z: INTERP_ZW  R2.z,  R0.y, Param1.x
VEC_210
 0044  80382000 60546b90w: INTERP_ZW  R2.w,  R0.x, Param1.x
VEC_210
 0046  00382400 00546b10 4  x: INTERP_XY  R2.x,  R0.y, Param1.x
VEC_210
 0048  00382000 20546b10y: INTERP_XY  R2.y,  R0.x, Param1.x
VEC_210
 0050  00382400 40146b00z: INTERP_XY  __.z,  R0.y, Param1.x
VEC_210
 0052  80382000 60146b00w: INTERP_XY  __.w,  R0.x, Param1.x
VEC_210
 0054  00384400 00146b80 5  x: INTERP_ZW  __.x,  R0.y, Param2.x
VEC_210
 0056  00384000 20146b80y: INTERP_ZW  __.y,  R0.x, Param2.x
VEC_210
 0058  00384400 40746b90z: INTERP_ZW  R3.z,  R0.y, Param2.x
VEC_210

[Bug 97886] radeon r300 vdpau broken

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97886

--- Comment #5 from GHPS  ---
I can confirm this bug and can see that it exists at least up to Mesa 17.2.4.

Background: Switching from Kubuntu 14.04 to 16.04 I had the problem that
DVD playback in VLC was broken (see screenshot of the Dreamworks Logo "Boy on
Moon"). After digging a bit deeper I was able to locate the bug in 
libvdpau, precisely its MPEG1/MPEG2* decoder capabilities 
[full background story with hardware/software specs:1]. 
This results in the blocky artifacts of vdpau in Mesa 12.0.6 
on a Radeon of the r300 family.

Upgrading my Kubuntu 16.04 system to Mesa 17.2.4 didn't fix the problem.

Tests with Kubuntu 17.10 (released with Mesa 17.2.2) show that here the same
problem is present.

1:
https://ubuntuforums.org/showthread.php?t=2312060&page=2&p=13520479#post13520479

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 97886] radeon r300 vdpau broken

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97886

--- Comment #4 from GHPS  ---
Created attachment 136605
  --> https://bugs.freedesktop.org/attachment.cgi?id=136605&action=edit
Screenshot Dreamworks Logo "Boy on Moon"

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 3/3] drm/omap: Make omapdss API more generic

2018-01-07 Thread Jyri Sarha
On 01/04/18 13:17, Tomi Valkeinen wrote:
> Hi,
> 
> On 01/01/18 13:55, Jyri Sarha wrote:
>> The new omapdss API is HW independent and cleans up some of the DSS5
>> specific hacks from the omapdrm side and gets rid off the DSS5 IRQ
>> register bits and replace them with HW independent generic u64 based
>> macros. This new macros make it more straight forward to implement the
>> IRQ code for the future DSS versions that do not share the same
>> register structure as DSS2 to DSS5 has.
>>
>> Signed-off-by: Jyri Sarha 
>> ---
>>  drivers/gpu/drm/omapdrm/dss/dispc.c   | 148 
>> --
>>  drivers/gpu/drm/omapdrm/dss/dispc.h   |  33 
>>  drivers/gpu/drm/omapdrm/dss/omapdss.h |  64 +++
>>  drivers/gpu/drm/omapdrm/omap_crtc.c   |  16 ++--
>>  drivers/gpu/drm/omapdrm/omap_crtc.h   |   2 +-
>>  drivers/gpu/drm/omapdrm/omap_drv.h|   3 +-
>>  drivers/gpu/drm/omapdrm/omap_irq.c| 136 +++
>>  drivers/gpu/drm/omapdrm/omap_irq.h|   2 +-
>>  drivers/gpu/drm/omapdrm/omap_plane.c  |   7 ++
>>  drivers/gpu/drm/omapdrm/omap_plane.h  |   1 +
>>  10 files changed, 267 insertions(+), 145 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c 
>> b/drivers/gpu/drm/omapdrm/dss/dispc.c
>> index 070053f..a80ebe1 100644
>> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
>> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
>> @@ -698,27 +698,12 @@ static const char *dispc_get_mgr_name(enum 
>> omap_channel channel)
>>  return mgr_desc[channel].name;
>>  }
>>  
>> -static u32 dispc_mgr_get_vsync_irq(enum omap_channel channel)
>> -{
>> -return mgr_desc[channel].vsync_irq;
>> -}
>> -
>> -static u32 dispc_mgr_get_framedone_irq(enum omap_channel channel)
>> +static bool dispc_mgr_has_framedone(enum omap_channel channel)
>>  {
>>  if (channel == OMAP_DSS_CHANNEL_DIGIT && dispc.feat->no_framedone_tv)
>> -return 0;
>> -
>> -return mgr_desc[channel].framedone_irq;
>> -}
>> -
>> -static u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel)
>> -{
>> -return mgr_desc[channel].sync_lost_irq;
>> -}
>> +return false;
>>  
>> -u32 dispc_wb_get_framedone_irq(void)
>> -{
>> -return DISPC_IRQ_FRAMEDONEWB;
>> +return true;
>>  }
> 
> You can just do
> 
> return channel != OMAP_DSS_CHANNEL_DIGIT || !dispc.feat->no_framedone_tv;
> 

Sure, I'll change that.

>>  
>>  static void dispc_mgr_enable(enum omap_channel channel, bool enable)
>> @@ -3604,6 +3589,121 @@ static void dispc_write_irqenable(u32 mask)
>>  dispc_read_reg(DISPC_IRQENABLE);
>>  }
>>  
>> +static u64 dispc_hw_to_api_irq(u32 hw)
>> +{
>> +u64 api = 0;
>> +
>> +if (hw & DISPC_IRQ_OCP_ERR)
>> +api |= DSS_IRQ_DEVICE_OCP_ERR;
>> +
>> +if (hw & DISPC_IRQ_FRAMEDONE)
>> +api |= DSS_IRQ_MGR_FRAME_DONE(0);
>> +if (hw & DISPC_IRQ_VSYNC)
>> +api |= DSS_IRQ_MGR_VSYNC_EVEN(0);
>> +if (hw & DISPC_IRQ_SYNC_LOST)
>> +api |= DSS_IRQ_MGR_SYNC_LOST(0);
>> +
>> +if (hw & DISPC_IRQ_EVSYNC_EVEN)
>> +api |= DSS_IRQ_MGR_VSYNC_EVEN(1);
>> +if (hw & DISPC_IRQ_EVSYNC_ODD)
>> +api |= DSS_IRQ_MGR_VSYNC_ODD(1);
>> +if (hw & DISPC_IRQ_SYNC_LOST_DIGIT)
>> +api |= DSS_IRQ_MGR_SYNC_LOST(1);
>> +if (hw & DISPC_IRQ_FRAMEDONETV)
>> +api |= DSS_IRQ_MGR_FRAME_DONE(1);
>> +
>> +if (hw & DISPC_IRQ_SYNC_LOST2)
>> +api |= DSS_IRQ_MGR_SYNC_LOST(2);
>> +if (hw & DISPC_IRQ_VSYNC2)
>> +api |= DSS_IRQ_MGR_VSYNC_EVEN(2);
>> +if (hw & DISPC_IRQ_FRAMEDONE2)
>> +api |= DSS_IRQ_MGR_FRAME_DONE(2);
>> +
>> +if (hw & DISPC_IRQ_SYNC_LOST3)
>> +api |= DSS_IRQ_MGR_SYNC_LOST(3);
>> +if (hw & DISPC_IRQ_VSYNC3)
>> +api |= DSS_IRQ_MGR_VSYNC_EVEN(3);
>> +if (hw & DISPC_IRQ_FRAMEDONE3)
>> +api |= DSS_IRQ_MGR_FRAME_DONE(3);
>> +
>> +if (hw & DISPC_IRQ_GFX_FIFO_UNDERFLOW)
>> +api |= DSS_IRQ_OVL_FIFO_UNDERFLOW(0);
>> +if (hw & DISPC_IRQ_VID1_FIFO_UNDERFLOW)
>> +api |= DSS_IRQ_OVL_FIFO_UNDERFLOW(1);
>> +if (hw & DISPC_IRQ_VID2_FIFO_UNDERFLOW)
>> +api |= DSS_IRQ_OVL_FIFO_UNDERFLOW(2);
>> +if (hw & DISPC_IRQ_VID3_FIFO_UNDERFLOW)
>> +api |= DSS_IRQ_OVL_FIFO_UNDERFLOW(3);
>> +
>> +return api;
>> +}
>> +
>> +static u32 dispc_api_to_hw_irq(u64 api)
>> +{
>> +u32 hw = 0;
>> +
>> +if (api & DSS_IRQ_DEVICE_OCP_ERR)
>> +hw |= DISPC_IRQ_OCP_ERR;
>> +
>> +if (api & DSS_IRQ_MGR_FRAME_DONE(0))
>> +hw |= DISPC_IRQ_FRAMEDONE;
>> +if (api & DSS_IRQ_MGR_VSYNC_EVEN(0))
>> +hw |= DISPC_IRQ_VSYNC;
>> +if (api & DSS_IRQ_MGR_SYNC_LOST(0))
>> +hw |= DISPC_IRQ_SYNC_LOST;
>> +
>> +if (api & DSS_IRQ_MGR_VSYNC_EVEN(1))
>> +hw |= DISPC_IRQ_EVSYNC_EVEN;
>> +if (api & DSS_IRQ_MGR_VSYNC_ODD(1))
>> +hw |= DISPC_IRQ_EVSYNC_ODD;
>> +if (api & DSS_IRQ_MGR_SYNC_

Re: [PATCH v2 4/6] drm/tinydrm/mipi-dbi: Add poweron-reset functions

2018-01-07 Thread Noralf Trønnes


Den 07.01.2018 18.44, skrev Noralf Trønnes:

Split out common poweron-reset functionality.

Signed-off-by: Noralf Trønnes 
---
  drivers/gpu/drm/tinydrm/mi0283qt.c | 20 ++--
  drivers/gpu/drm/tinydrm/mipi-dbi.c | 63 ++
  drivers/gpu/drm/tinydrm/st7586.c   |  9 ++
  drivers/gpu/drm/tinydrm/st7735r.c  |  8 ++---
  include/drm/tinydrm/mipi-dbi.h |  2 ++
  5 files changed, 73 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c 
b/drivers/gpu/drm/tinydrm/mi0283qt.c
index c69a4d958f24..2a78bcd35045 100644
--- a/drivers/gpu/drm/tinydrm/mi0283qt.c
+++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
@@ -49,31 +49,17 @@
  
  static int mi0283qt_init(struct mipi_dbi *mipi)

  {
-   struct tinydrm_device *tdev = &mipi->tinydrm;
-   struct device *dev = tdev->drm->dev;
u8 addr_mode;
int ret;
  
  	DRM_DEBUG_KMS("\n");
  
-	ret = regulator_enable(mipi->regulator);

-   if (ret) {
-   DRM_DEV_ERROR(dev, "Failed to enable regulator %d\n", ret);
+   ret = mipi_dbi_poweron_conditional_reset(mipi);
+   if (ret < 0)
return ret;
-   }
-
-   /* Avoid flicker by skipping setup if the bootloader has done it */
-   if (mipi_dbi_display_is_on(mipi))
+   if (ret > 0)
return 0;
  
-	mipi_dbi_hw_reset(mipi);

-   ret = mipi_dbi_command(mipi, MIPI_DCS_SOFT_RESET);
-   if (ret) {
-   DRM_DEV_ERROR(dev, "Error sending command %d\n", ret);
-   regulator_disable(mipi->regulator);
-   return ret;
-   }
-
msleep(20);
  
  	mipi_dbi_command(mipi, MIPI_DCS_SET_DISPLAY_OFF);

diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c 
b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index ecc5c81a93ac..eea6803ff223 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -463,6 +463,7 @@ bool mipi_dbi_display_is_on(struct mipi_dbi *mipi)
  
  	val &= ~DCS_POWER_MODE_RESERVED_MASK;
  
+	/* The poweron/reset value is 08h DCS_POWER_MODE_DISPLAY_NORMAL_MODE */

if (val != (DCS_POWER_MODE_DISPLAY |
DCS_POWER_MODE_DISPLAY_NORMAL_MODE | DCS_POWER_MODE_SLEEP_MODE))
return false;
@@ -473,6 +474,68 @@ bool mipi_dbi_display_is_on(struct mipi_dbi *mipi)
  }
  EXPORT_SYMBOL(mipi_dbi_display_is_on);
  
+static int mipi_dbi_por_conditional(struct mipi_dbi *mipi, bool cond)

+{
+   struct device *dev = mipi->tinydrm.drm->dev;
+   int ret;
+
+   if (mipi->regulator) {
+   ret = regulator_enable(mipi->regulator);
+   if (ret) {
+   DRM_DEV_ERROR(dev, "Failed to enable regulator (%d)\n", 
ret);
+   return ret;
+   }
+   }
+
+   if (cond && mipi_dbi_display_is_on(mipi))
+   return 1;
+
+   mipi_dbi_hw_reset(mipi);
+   ret = mipi_dbi_command(mipi, MIPI_DCS_SOFT_RESET);
+   if (ret) {
+   DRM_DEV_ERROR(dev, "Failed to send reset command (%d)\n", ret);
+   if (mipi->regulator)
+   regulator_disable(mipi->regulator);
+   return ret;
+   }


I forgot about the case where we don't have hw reset:

    /*
     * If we did a hw reset, we know the controller is in Sleep mode and
     * per MIPI DSC spec should wait 5ms after soft reset. If we didn't,
     * we assume worst case and wait 120ms.
     */
    if (mipi->reset)
        usleep_range(5000, 2);
    else
        msleep(120);

Noralf.


+
+   return 0;
+}
+
+/**
+ * mipi_dbi_poweron_reset - MIPI DBI poweron and reset
+ * @mipi: MIPI DBI structure
+ *
+ * This function enables the regulator if used and does a hardware and software
+ * reset.
+ *
+ * Returns:
+ * Zero on success, or a negative error code.
+ */
+int mipi_dbi_poweron_reset(struct mipi_dbi *mipi)
+{
+   return mipi_dbi_por_conditional(mipi, false);
+}
+EXPORT_SYMBOL(mipi_dbi_poweron_reset);
+
+/**
+ * mipi_dbi_poweron_conditional_reset - MIPI DBI poweron and conditional reset
+ * @mipi: MIPI DBI structure
+ *
+ * This function enables the regulator if used and if the display is off, it
+ * does a hardware and software reset. If mipi_dbi_display_is_on() determines
+ * that the display is on, no reset is performed.
+ *
+ * Returns:
+ * Zero if the controller was reset, 1 if the display was already on, or a
+ * negative error code.
+ */
+int mipi_dbi_poweron_conditional_reset(struct mipi_dbi *mipi)
+{
+   return mipi_dbi_por_conditional(mipi, true);
+}
+EXPORT_SYMBOL(mipi_dbi_poweron_conditional_reset);
+
  #if IS_ENABLED(CONFIG_SPI)
  
  /**

diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c
index 9fd4423c8e70..a6396ef9cc4a 100644
--- a/drivers/gpu/drm/tinydrm/st7586.c
+++ b/drivers/gpu/drm/tinydrm/st7586.c
@@ -179,19 +179,16 @@ static void st7586_pipe_enable(struct 
drm_simple_display_pipe *pipe,
  {
struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);

[PATCH v2] video: ssd1307fb: Improve a size determination in ssd1307fb_probe()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 19:27:28 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---

v2:
This update suggestion was rebased on source files from the software
"Linux next-20180105".

 drivers/video/fbdev/ssd1307fb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index f599520374dd..6439231f2db2 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -628,7 +628,8 @@ static int ssd1307fb_probe(struct i2c_client *client,
goto fb_alloc_error;
}
 
-   ssd1307fb_defio = devm_kzalloc(&client->dev, sizeof(struct 
fb_deferred_io), GFP_KERNEL);
+   ssd1307fb_defio = devm_kzalloc(&client->dev, sizeof(*ssd1307fb_defio),
+  GFP_KERNEL);
if (!ssd1307fb_defio) {
dev_err(&client->dev, "Couldn't allocate deferred io.\n");
ret = -ENOMEM;
-- 
2.15.1

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


[Bug 104289] [regression][vega10] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring sdma0 timeout on exiting certain Steam games

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104289

--- Comment #12 from Vedran Miletić  ---
(In reply to Michel Dänzer from comment #7)
> (In reply to Vedran Miletić from comment #5)
> > I'm sorry, but I will not be able to bisect this. Checkouts of relevant
> > commits don't boot and simple reverts do apply cleanly, but don't compile.
> 
> FWIW, you may still be able to at least narrow things down with git bisect.
> If you can't test a selected commit, run "git bisect skip". That will select
> another commit to test. You can also manually check out another commit to
> test. In the worst case, the bisection process will end with identifying the
> minimal set of candidates instead of a single commit.

Thanks for the suggestion. Tried that and didn't get anywhere (all the relevant
commits were broken in one way or another).

(In reply to Christian König from comment #11)
> Code fix is now in amd-staging-drm-next

Verified as fixed. (Would have checked earlier, but was away from the computer
with Vega.)

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 3/6] drm/tinydrm/mipi-dbi: Add mipi_dbi_enable_flush()

2018-01-07 Thread Noralf Trønnes
Add and use a function for enabling, flushing and turning on backlight.

Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/tinydrm/ili9225.c  |  6 +-
 drivers/gpu/drm/tinydrm/mipi-dbi.c | 20 
 drivers/gpu/drm/tinydrm/st7586.c   |  6 +-
 drivers/gpu/drm/tinydrm/st7735r.c  |  2 +-
 include/drm/tinydrm/mipi-dbi.h |  1 +
 5 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/ili9225.c 
b/drivers/gpu/drm/tinydrm/ili9225.c
index c0cf49849302..a0759502b81a 100644
--- a/drivers/gpu/drm/tinydrm/ili9225.c
+++ b/drivers/gpu/drm/tinydrm/ili9225.c
@@ -180,7 +180,6 @@ static void ili9225_pipe_enable(struct 
drm_simple_display_pipe *pipe,
 {
struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
-   struct drm_framebuffer *fb = pipe->plane.fb;
struct device *dev = tdev->drm->dev;
int ret;
u8 am_id;
@@ -269,10 +268,7 @@ static void ili9225_pipe_enable(struct 
drm_simple_display_pipe *pipe,
 
ili9225_command(mipi, ILI9225_DISPLAY_CONTROL_1, 0x1017);
 
-   mipi->enabled = true;
-
-   if (fb)
-   fb->funcs->dirty(fb, NULL, 0, 0, NULL, 0);
+   mipi_dbi_enable_flush(mipi);
 }
 
 static void ili9225_pipe_disable(struct drm_simple_display_pipe *pipe)
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c 
b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index aa6b6ce56891..ecc5c81a93ac 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -270,6 +270,26 @@ static const struct drm_framebuffer_funcs 
mipi_dbi_fb_funcs = {
.dirty  = mipi_dbi_fb_dirty,
 };
 
+/**
+ * mipi_dbi_enable_flush - MIPI DBI enable helper
+ * @mipi: MIPI DBI structure
+ *
+ * This function sets &mipi_dbi->enabled, flushes the whole framebuffer and
+ * enables the backlight. Drivers can use this in their
+ * &drm_simple_display_pipe_funcs->enable callback.
+ */
+void mipi_dbi_enable_flush(struct mipi_dbi *mipi)
+{
+struct drm_framebuffer *fb = mipi->tinydrm.pipe.plane.fb;
+
+mipi->enabled = true;
+if (fb)
+fb->funcs->dirty(fb, NULL, 0, 0, NULL, 0);
+
+tinydrm_enable_backlight(mipi->backlight);
+}
+EXPORT_SYMBOL(mipi_dbi_enable_flush);
+
 /**
  * mipi_dbi_pipe_enable - MIPI DBI pipe enable helper
  * @pipe: Display pipe
diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c
index 5aebfceb740e..9fd4423c8e70 100644
--- a/drivers/gpu/drm/tinydrm/st7586.c
+++ b/drivers/gpu/drm/tinydrm/st7586.c
@@ -179,7 +179,6 @@ static void st7586_pipe_enable(struct 
drm_simple_display_pipe *pipe,
 {
struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
-   struct drm_framebuffer *fb = pipe->plane.fb;
struct device *dev = tdev->drm->dev;
int ret;
u8 addr_mode;
@@ -241,10 +240,7 @@ static void st7586_pipe_enable(struct 
drm_simple_display_pipe *pipe,
 
mipi_dbi_command(mipi, MIPI_DCS_SET_DISPLAY_ON);
 
-   mipi->enabled = true;
-
-   if (fb)
-   fb->funcs->dirty(fb, NULL, 0, 0, NULL, 0);
+   mipi_dbi_enable_flush(mipi);
 }
 
 static void st7586_pipe_disable(struct drm_simple_display_pipe *pipe)
diff --git a/drivers/gpu/drm/tinydrm/st7735r.c 
b/drivers/gpu/drm/tinydrm/st7735r.c
index 98ff447f40b4..1f38e15da676 100644
--- a/drivers/gpu/drm/tinydrm/st7735r.c
+++ b/drivers/gpu/drm/tinydrm/st7735r.c
@@ -102,7 +102,7 @@ static void jd_t18003_t01_pipe_enable(struct 
drm_simple_display_pipe *pipe,
 
msleep(20);
 
-   mipi_dbi_pipe_enable(pipe, crtc_state);
+   mipi_dbi_enable_flush(mipi);
 }
 
 static const struct drm_simple_display_pipe_funcs jd_t18003_t01_pipe_funcs = {
diff --git a/include/drm/tinydrm/mipi-dbi.h b/include/drm/tinydrm/mipi-dbi.h
index 5d0e82b36eaf..6441d9a9161a 100644
--- a/include/drm/tinydrm/mipi-dbi.h
+++ b/include/drm/tinydrm/mipi-dbi.h
@@ -67,6 +67,7 @@ int mipi_dbi_init(struct device *dev, struct mipi_dbi *mipi,
  const struct drm_simple_display_pipe_funcs *pipe_funcs,
  struct drm_driver *driver,
  const struct drm_display_mode *mode, unsigned int rotation);
+void mipi_dbi_enable_flush(struct mipi_dbi *mipi);
 void mipi_dbi_pipe_enable(struct drm_simple_display_pipe *pipe,
  struct drm_crtc_state *crtc_state);
 void mipi_dbi_pipe_disable(struct drm_simple_display_pipe *pipe);
-- 
2.14.2

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


[PATCH v2 2/6] drm/tinydrm/mi0283qt: Remove ili9341.h

2018-01-07 Thread Noralf Trønnes
No need for a public header file for the command macros.
Just include the necessary ones in the driver.

Also use the MIPI_DCS_PIXEL_FMT_16BIT macro.

Signed-off-by: Noralf Trønnes 
Reviewed-by: David Lechner 
---
 drivers/gpu/drm/tinydrm/mi0283qt.c | 28 ++--
 include/drm/tinydrm/ili9341.h  | 54 --
 2 files changed, 26 insertions(+), 56 deletions(-)
 delete mode 100644 include/drm/tinydrm/ili9341.h

diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c 
b/drivers/gpu/drm/tinydrm/mi0283qt.c
index 45f02b6052b1..c69a4d958f24 100644
--- a/drivers/gpu/drm/tinydrm/mi0283qt.c
+++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
@@ -18,11 +18,35 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 
+#define ILI9341_FRMCTR10xb1
+#define ILI9341_DISCTRL0xb6
+#define ILI9341_ETMOD  0xb7
+
+#define ILI9341_PWCTRL10xc0
+#define ILI9341_PWCTRL20xc1
+#define ILI9341_VMCTRL10xc5
+#define ILI9341_VMCTRL20xc7
+#define ILI9341_PWCTRLA0xcb
+#define ILI9341_PWCTRLB0xcf
+
+#define ILI9341_PGAMCTRL   0xe0
+#define ILI9341_NGAMCTRL   0xe1
+#define ILI9341_DTCTRLA0xe8
+#define ILI9341_DTCTRLB0xea
+#define ILI9341_PWRSEQ 0xed
+
+#define ILI9341_EN3GAM 0xf2
+#define ILI9341_PUMPCTRL   0xf7
+
+#define ILI9341_MADCTL_BGR BIT(3)
+#define ILI9341_MADCTL_MV  BIT(5)
+#define ILI9341_MADCTL_MX  BIT(6)
+#define ILI9341_MADCTL_MY  BIT(7)
+
 static int mi0283qt_init(struct mipi_dbi *mipi)
 {
struct tinydrm_device *tdev = &mipi->tinydrm;
@@ -69,7 +93,7 @@ static int mi0283qt_init(struct mipi_dbi *mipi)
mipi_dbi_command(mipi, ILI9341_VMCTRL2, 0xbe);
 
/* Memory Access Control */
-   mipi_dbi_command(mipi, MIPI_DCS_SET_PIXEL_FORMAT, 0x55);
+   mipi_dbi_command(mipi, MIPI_DCS_SET_PIXEL_FORMAT, 
MIPI_DCS_PIXEL_FMT_16BIT);
 
switch (mipi->rotation) {
default:
diff --git a/include/drm/tinydrm/ili9341.h b/include/drm/tinydrm/ili9341.h
deleted file mode 100644
index 807a09f43cad..
--- a/include/drm/tinydrm/ili9341.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * ILI9341 LCD controller
- *
- * Copyright 2016 Noralf Trønnes
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef __LINUX_ILI9341_H
-#define __LINUX_ILI9341_H
-
-#define ILI9341_FRMCTR10xb1
-#define ILI9341_FRMCTR20xb2
-#define ILI9341_FRMCTR30xb3
-#define ILI9341_INVTR  0xb4
-#define ILI9341_PRCTR  0xb5
-#define ILI9341_DISCTRL0xb6
-#define ILI9341_ETMOD  0xb7
-
-#define ILI9341_PWCTRL10xc0
-#define ILI9341_PWCTRL20xc1
-#define ILI9341_VMCTRL10xc5
-#define ILI9341_VMCTRL20xc7
-#define ILI9341_PWCTRLA0xcb
-#define ILI9341_PWCTRLB0xcf
-
-#define ILI9341_RDID1  0xda
-#define ILI9341_RDID2  0xdb
-#define ILI9341_RDID3  0xdc
-#define ILI9341_RDID4  0xd3
-
-#define ILI9341_PGAMCTRL   0xe0
-#define ILI9341_NGAMCTRL   0xe1
-#define ILI9341_DGAMCTRL1  0xe2
-#define ILI9341_DGAMCTRL2  0xe3
-#define ILI9341_DTCTRLA0xe8
-#define ILI9341_DTCTRLB0xea
-#define ILI9341_PWRSEQ 0xed
-
-#define ILI9341_EN3GAM 0xf2
-#define ILI9341_IFCTRL 0xf6
-#define ILI9341_PUMPCTRL   0xf7
-
-#define ILI9341_MADCTL_MH  BIT(2)
-#define ILI9341_MADCTL_BGR BIT(3)
-#define ILI9341_MADCTL_ML  BIT(4)
-#define ILI9341_MADCTL_MV  BIT(5)
-#define ILI9341_MADCTL_MX  BIT(6)
-#define ILI9341_MADCTL_MY  BIT(7)
-
-#endif /* __LINUX_ILI9341_H */
-- 
2.14.2

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


[PATCH v2 5/6] drm/tinydrm/mi0283qt: Let the display pipe handle power

2018-01-07 Thread Noralf Trønnes
It's better to leave power handling and controller init to the
modesetting machinery using the simple pipe .enable and .disable
callbacks. Remove unused mipi_dbi_pipe_enable().

Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/tinydrm/mi0283qt.c | 47 --
 drivers/gpu/drm/tinydrm/mipi-dbi.c | 32 --
 include/drm/tinydrm/mipi-dbi.h |  2 --
 3 files changed, 15 insertions(+), 66 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c 
b/drivers/gpu/drm/tinydrm/mi0283qt.c
index 2a78bcd35045..35b8b7c421b0 100644
--- a/drivers/gpu/drm/tinydrm/mi0283qt.c
+++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
@@ -47,8 +47,11 @@
 #define ILI9341_MADCTL_MX  BIT(6)
 #define ILI9341_MADCTL_MY  BIT(7)
 
-static int mi0283qt_init(struct mipi_dbi *mipi)
+static void mi0283qt_enable(struct drm_simple_display_pipe *pipe,
+   struct drm_crtc_state *crtc_state)
 {
+   struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
+   struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
u8 addr_mode;
int ret;
 
@@ -56,9 +59,9 @@ static int mi0283qt_init(struct mipi_dbi *mipi)
 
ret = mipi_dbi_poweron_conditional_reset(mipi);
if (ret < 0)
-   return ret;
+   return;
if (ret > 0)
-   return 0;
+   goto out_enable;
 
msleep(20);
 
@@ -123,19 +126,12 @@ static int mi0283qt_init(struct mipi_dbi *mipi)
mipi_dbi_command(mipi, MIPI_DCS_SET_DISPLAY_ON);
msleep(100);
 
-   return 0;
-}
-
-static void mi0283qt_fini(void *data)
-{
-   struct mipi_dbi *mipi = data;
-
-   DRM_DEBUG_KMS("\n");
-   regulator_disable(mipi->regulator);
+out_enable:
+   mipi_dbi_enable_flush(mipi);
 }
 
 static const struct drm_simple_display_pipe_funcs mi0283qt_pipe_funcs = {
-   .enable = mipi_dbi_pipe_enable,
+   .enable = mi0283qt_enable,
.disable = mipi_dbi_pipe_disable,
.update = tinydrm_display_pipe_update,
.prepare_fb = tinydrm_display_pipe_prepare_fb,
@@ -216,17 +212,6 @@ static int mi0283qt_probe(struct spi_device *spi)
if (ret)
return ret;
 
-   ret = mi0283qt_init(mipi);
-   if (ret)
-   return ret;
-
-   /* use devres to fini after drm unregister (drv->remove is before) */
-   ret = devm_add_action(dev, mi0283qt_fini, mipi);
-   if (ret) {
-   mi0283qt_fini(mipi);
-   return ret;
-   }
-
spi_set_drvdata(spi, mipi);
 
return devm_tinydrm_register(&mipi->tinydrm);
@@ -242,25 +227,13 @@ static void mi0283qt_shutdown(struct spi_device *spi)
 static int __maybe_unused mi0283qt_pm_suspend(struct device *dev)
 {
struct mipi_dbi *mipi = dev_get_drvdata(dev);
-   int ret;
 
-   ret = drm_mode_config_helper_suspend(mipi->tinydrm.drm);
-   if (ret)
-   return ret;
-
-   mi0283qt_fini(mipi);
-
-   return 0;
+   return drm_mode_config_helper_suspend(mipi->tinydrm.drm);
 }
 
 static int __maybe_unused mi0283qt_pm_resume(struct device *dev)
 {
struct mipi_dbi *mipi = dev_get_drvdata(dev);
-   int ret;
-
-   ret = mi0283qt_init(mipi);
-   if (ret)
-   return ret;
 
drm_mode_config_helper_resume(mipi->tinydrm.drm);
 
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c 
b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index eea6803ff223..5cafbe16bb43 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -290,31 +290,6 @@ void mipi_dbi_enable_flush(struct mipi_dbi *mipi)
 }
 EXPORT_SYMBOL(mipi_dbi_enable_flush);
 
-/**
- * mipi_dbi_pipe_enable - MIPI DBI pipe enable helper
- * @pipe: Display pipe
- * @crtc_state: CRTC state
- *
- * This function enables backlight. Drivers can use this as their
- * &drm_simple_display_pipe_funcs->enable callback.
- */
-void mipi_dbi_pipe_enable(struct drm_simple_display_pipe *pipe,
- struct drm_crtc_state *crtc_state)
-{
-   struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
-   struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
-   struct drm_framebuffer *fb = pipe->plane.fb;
-
-   DRM_DEBUG_KMS("\n");
-
-   mipi->enabled = true;
-   if (fb)
-   fb->funcs->dirty(fb, NULL, 0, 0, NULL, 0);
-
-   tinydrm_enable_backlight(mipi->backlight);
-}
-EXPORT_SYMBOL(mipi_dbi_pipe_enable);
-
 static void mipi_dbi_blank(struct mipi_dbi *mipi)
 {
struct drm_device *drm = mipi->tinydrm.drm;
@@ -336,8 +311,8 @@ static void mipi_dbi_blank(struct mipi_dbi *mipi)
  * mipi_dbi_pipe_disable - MIPI DBI pipe disable helper
  * @pipe: Display pipe
  *
- * This function disables backlight if present or if not the
- * display memory is blanked. Drivers can use this as their
+ * This function disables backlight if present, if not the display memory is
+ * blanked. The regulator is disabled if in use. Drivers can use this as their
  * &drm_

[PATCH v2 4/6] drm/tinydrm/mipi-dbi: Add poweron-reset functions

2018-01-07 Thread Noralf Trønnes
Split out common poweron-reset functionality.

Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/tinydrm/mi0283qt.c | 20 ++--
 drivers/gpu/drm/tinydrm/mipi-dbi.c | 63 ++
 drivers/gpu/drm/tinydrm/st7586.c   |  9 ++
 drivers/gpu/drm/tinydrm/st7735r.c  |  8 ++---
 include/drm/tinydrm/mipi-dbi.h |  2 ++
 5 files changed, 73 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c 
b/drivers/gpu/drm/tinydrm/mi0283qt.c
index c69a4d958f24..2a78bcd35045 100644
--- a/drivers/gpu/drm/tinydrm/mi0283qt.c
+++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
@@ -49,31 +49,17 @@
 
 static int mi0283qt_init(struct mipi_dbi *mipi)
 {
-   struct tinydrm_device *tdev = &mipi->tinydrm;
-   struct device *dev = tdev->drm->dev;
u8 addr_mode;
int ret;
 
DRM_DEBUG_KMS("\n");
 
-   ret = regulator_enable(mipi->regulator);
-   if (ret) {
-   DRM_DEV_ERROR(dev, "Failed to enable regulator %d\n", ret);
+   ret = mipi_dbi_poweron_conditional_reset(mipi);
+   if (ret < 0)
return ret;
-   }
-
-   /* Avoid flicker by skipping setup if the bootloader has done it */
-   if (mipi_dbi_display_is_on(mipi))
+   if (ret > 0)
return 0;
 
-   mipi_dbi_hw_reset(mipi);
-   ret = mipi_dbi_command(mipi, MIPI_DCS_SOFT_RESET);
-   if (ret) {
-   DRM_DEV_ERROR(dev, "Error sending command %d\n", ret);
-   regulator_disable(mipi->regulator);
-   return ret;
-   }
-
msleep(20);
 
mipi_dbi_command(mipi, MIPI_DCS_SET_DISPLAY_OFF);
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c 
b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index ecc5c81a93ac..eea6803ff223 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -463,6 +463,7 @@ bool mipi_dbi_display_is_on(struct mipi_dbi *mipi)
 
val &= ~DCS_POWER_MODE_RESERVED_MASK;
 
+   /* The poweron/reset value is 08h DCS_POWER_MODE_DISPLAY_NORMAL_MODE */
if (val != (DCS_POWER_MODE_DISPLAY |
DCS_POWER_MODE_DISPLAY_NORMAL_MODE | DCS_POWER_MODE_SLEEP_MODE))
return false;
@@ -473,6 +474,68 @@ bool mipi_dbi_display_is_on(struct mipi_dbi *mipi)
 }
 EXPORT_SYMBOL(mipi_dbi_display_is_on);
 
+static int mipi_dbi_por_conditional(struct mipi_dbi *mipi, bool cond)
+{
+   struct device *dev = mipi->tinydrm.drm->dev;
+   int ret;
+
+   if (mipi->regulator) {
+   ret = regulator_enable(mipi->regulator);
+   if (ret) {
+   DRM_DEV_ERROR(dev, "Failed to enable regulator (%d)\n", 
ret);
+   return ret;
+   }
+   }
+
+   if (cond && mipi_dbi_display_is_on(mipi))
+   return 1;
+
+   mipi_dbi_hw_reset(mipi);
+   ret = mipi_dbi_command(mipi, MIPI_DCS_SOFT_RESET);
+   if (ret) {
+   DRM_DEV_ERROR(dev, "Failed to send reset command (%d)\n", ret);
+   if (mipi->regulator)
+   regulator_disable(mipi->regulator);
+   return ret;
+   }
+
+   return 0;
+}
+
+/**
+ * mipi_dbi_poweron_reset - MIPI DBI poweron and reset
+ * @mipi: MIPI DBI structure
+ *
+ * This function enables the regulator if used and does a hardware and software
+ * reset.
+ *
+ * Returns:
+ * Zero on success, or a negative error code.
+ */
+int mipi_dbi_poweron_reset(struct mipi_dbi *mipi)
+{
+   return mipi_dbi_por_conditional(mipi, false);
+}
+EXPORT_SYMBOL(mipi_dbi_poweron_reset);
+
+/**
+ * mipi_dbi_poweron_conditional_reset - MIPI DBI poweron and conditional reset
+ * @mipi: MIPI DBI structure
+ *
+ * This function enables the regulator if used and if the display is off, it
+ * does a hardware and software reset. If mipi_dbi_display_is_on() determines
+ * that the display is on, no reset is performed.
+ *
+ * Returns:
+ * Zero if the controller was reset, 1 if the display was already on, or a
+ * negative error code.
+ */
+int mipi_dbi_poweron_conditional_reset(struct mipi_dbi *mipi)
+{
+   return mipi_dbi_por_conditional(mipi, true);
+}
+EXPORT_SYMBOL(mipi_dbi_poweron_conditional_reset);
+
 #if IS_ENABLED(CONFIG_SPI)
 
 /**
diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c
index 9fd4423c8e70..a6396ef9cc4a 100644
--- a/drivers/gpu/drm/tinydrm/st7586.c
+++ b/drivers/gpu/drm/tinydrm/st7586.c
@@ -179,19 +179,16 @@ static void st7586_pipe_enable(struct 
drm_simple_display_pipe *pipe,
 {
struct tinydrm_device *tdev = pipe_to_tinydrm(pipe);
struct mipi_dbi *mipi = mipi_dbi_from_tinydrm(tdev);
-   struct device *dev = tdev->drm->dev;
int ret;
u8 addr_mode;
 
DRM_DEBUG_KMS("\n");
 
-   mipi_dbi_hw_reset(mipi);
-   ret = mipi_dbi_command(mipi, ST7586_AUTO_READ_CTRL, 0x9f);
-   if (ret) {
-   DRM_DEV_ERROR(dev, "Error sending command %d\n", ret);
+   ret = mipi_dbi_poweron_reset(mipi)

[PATCH v2 6/6] drm/tinydrm: Embed the mode in tinydrm_connector

2018-01-07 Thread Noralf Trønnes
Embed the mode in tinydrm_connector instead of doing an devm_ allocation.
Remove unnecessary use of ret variable at the end of
tinydrm_display_pipe_init().

Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 34 +++--
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c 
b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
index f41fc506ff87..11ae950b0fc9 100644
--- a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
+++ b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
@@ -15,7 +15,7 @@
 
 struct tinydrm_connector {
struct drm_connector base;
-   const struct drm_display_mode *mode;
+   struct drm_display_mode mode;
 };
 
 static inline struct tinydrm_connector *
@@ -29,7 +29,7 @@ static int tinydrm_connector_get_modes(struct drm_connector 
*connector)
struct tinydrm_connector *tconn = to_tinydrm_connector(connector);
struct drm_display_mode *mode;
 
-   mode = drm_mode_duplicate(connector->dev, tconn->mode);
+   mode = drm_mode_duplicate(connector->dev, &tconn->mode);
if (!mode) {
DRM_ERROR("Failed to duplicate mode\n");
return 0;
@@ -92,7 +92,7 @@ tinydrm_connector_create(struct drm_device *drm,
if (!tconn)
return ERR_PTR(-ENOMEM);
 
-   tconn->mode = mode;
+   drm_mode_copy(&tconn->mode, mode);
connector = &tconn->base;
 
drm_connector_helper_add(connector, &tinydrm_connector_hfuncs);
@@ -199,35 +199,27 @@ tinydrm_display_pipe_init(struct tinydrm_device *tdev,
  unsigned int rotation)
 {
struct drm_device *drm = tdev->drm;
-   struct drm_display_mode *mode_copy;
+   struct drm_display_mode mode_copy;
struct drm_connector *connector;
int ret;
 
-   mode_copy = devm_kmalloc(drm->dev, sizeof(*mode_copy), GFP_KERNEL);
-   if (!mode_copy)
-   return -ENOMEM;
-
-   *mode_copy = *mode;
-   ret = tinydrm_rotate_mode(mode_copy, rotation);
+   drm_mode_copy(&mode_copy, mode);
+   ret = tinydrm_rotate_mode(&mode_copy, rotation);
if (ret) {
DRM_ERROR("Illegal rotation value %u\n", rotation);
return -EINVAL;
}
 
-   drm->mode_config.min_width = mode_copy->hdisplay;
-   drm->mode_config.max_width = mode_copy->hdisplay;
-   drm->mode_config.min_height = mode_copy->vdisplay;
-   drm->mode_config.max_height = mode_copy->vdisplay;
+   drm->mode_config.min_width = mode_copy.hdisplay;
+   drm->mode_config.max_width = mode_copy.hdisplay;
+   drm->mode_config.min_height = mode_copy.vdisplay;
+   drm->mode_config.max_height = mode_copy.vdisplay;
 
-   connector = tinydrm_connector_create(drm, mode_copy, connector_type);
+   connector = tinydrm_connector_create(drm, &mode_copy, connector_type);
if (IS_ERR(connector))
return PTR_ERR(connector);
 
-   ret = drm_simple_display_pipe_init(drm, &tdev->pipe, funcs, formats,
-  format_count, NULL, connector);
-   if (ret)
-   return ret;
-
-   return 0;
+   return drm_simple_display_pipe_init(drm, &tdev->pipe, funcs, formats,
+   format_count, NULL, connector);
 }
 EXPORT_SYMBOL(tinydrm_display_pipe_init);
-- 
2.14.2

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


[PATCH v2 1/6] drm/tinydrm/mi0283qt: Use common include order

2018-01-07 Thread Noralf Trønnes
Include linux headers before drm headers as it's commonly done.

Signed-off-by: Noralf Trønnes 
Reviewed-by: David Lechner 
---
 drivers/gpu/drm/tinydrm/mi0283qt.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c 
b/drivers/gpu/drm/tinydrm/mi0283qt.c
index 674d407640be..45f02b6052b1 100644
--- a/drivers/gpu/drm/tinydrm/mi0283qt.c
+++ b/drivers/gpu/drm/tinydrm/mi0283qt.c
@@ -9,17 +9,18 @@
  * (at your option) any later version.
  */
 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 
 static int mi0283qt_init(struct mipi_dbi *mipi)
-- 
2.14.2

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


[PATCH v2 0/6] drm/tinydrm: Cleanup

2018-01-07 Thread Noralf Trønnes
Fix a few things that came up during the tinydrm review but wasn't
addressed at the time.

Noralf.

Changes since version 1:
- Add mipi_dbi_enable_flush() instead of the pipe enable helper
  mipi_dbi_pipe_enable() that doesn't really fit anymore.
- Add common poweron-reset functionality.
- Use drm_mode_copy() instead of direct assignment

Noralf Trønnes (6):
  drm/tinydrm/mi0283qt: Use common include order
  drm/tinydrm/mi0283qt: Remove ili9341.h
  drm/tinydrm/mipi-dbi: Add mipi_dbi_enable_flush()
  drm/tinydrm/mipi-dbi: Add poweron-reset functions
  drm/tinydrm/mi0283qt: Let the display pipe handle power
  drm/tinydrm: Embed the mode in tinydrm_connector

 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c |  34 -
 drivers/gpu/drm/tinydrm/ili9225.c   |   6 +-
 drivers/gpu/drm/tinydrm/mi0283qt.c  | 104 
 drivers/gpu/drm/tinydrm/mipi-dbi.c  |  97 +-
 drivers/gpu/drm/tinydrm/st7586.c|  15 ++--
 drivers/gpu/drm/tinydrm/st7735r.c   |  10 +--
 include/drm/tinydrm/ili9341.h   |  54 ---
 include/drm/tinydrm/mipi-dbi.h  |   5 +-
 8 files changed, 147 insertions(+), 178 deletions(-)
 delete mode 100644 include/drm/tinydrm/ili9341.h

-- 
2.14.2

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


[Bug 104439] intel_do_flush_locked failed: Invalid argument

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104439

--- Comment #4 from Urs Fleisch  ---
I have probably the same problem with a HP Compaq dc7800p Small Form Factor
having Intel Corporation 82Q35 Express Integrated Graphics Controller (Intel
GMA 3100 graphics, Mesa DRI Intel(R) Q35, OpenGL 2.1, DRI driver: i915).

The problem appeared since Arch Linux switched to kernel 4.14 (but not with the
4.9 LTS kernel), I have also reproduced it on Ubuntu using mainline kernels
(http://kernel.ubuntu.com/~kernel-ppa/mainline). The problems do not appear
with 4.13.16-041316, but starting with 4.14.0-041400rc1, 4.14.0-041400-generic,
4.14.12-041412-generic, and also with the latest kernel available there
4.15.0-041500rc6-generic the problem still exists.

The easiest way to reproduce the problem is starting Chromium and going to
maps.google.com. On Arch Linux (both with KDE and LxQt) the address bar
disappears and the map tiles are totally distorted. On Ubuntu 17.10 (Gnome),
the address bar disappears as soon as I start Chromium, but the contents of
Google Maps is not distorted. On both distributions, I can see 

(EE) intel(0): Failed to submit rendering commands (Invalid argument),
disabling acceleration.

in /var/log/Xorg.0.log (Arch) or in journalctl (Ubuntu). In journalctl, there
is also the following log entry

intel_do_flush_locked failed: Invalid argument

I have looked into the kernel source of the current Arch Linux kernel
(4.14.12-1-ARCH), the commit 1d033b mentioned above is included.

With chrome://gpu, some messages are displayed

GpuProcessHostUIShim: The GPU process exited with code 256.
[970:970:0107/073806.982205:ERROR:gles2_cmd_decoder.cc(17977)]
[.DisplayCompositor-0x10da87b96000]GL ERROR :GL_INVALID_OPERATION :
glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[970:970:0107/073806.982610:ERROR:gles2_cmd_decoder.cc(9881)]
[.DisplayCompositor-0x10da87b96000]RENDER WARNING: texture bound to texture
unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture
filtering.
[970:970:0107/073807.029877:ERROR:gles2_cmd_decoder.cc(9881)]
[.DisplayCompositor-0x10da87b96000]RENDER WARNING: texture bound to texture
unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture
filtering.
...a lot more of these

Please let me know if I can provide more information.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104001] GPU driver hung when start steam client while playback video on Youtube (it occurs on latest staging kernel)

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104001

--- Comment #15 from mikhail.v.gavri...@gmail.com ---
Created attachment 136599
  --> https://bugs.freedesktop.org/attachment.cgi?id=136599&action=edit
dmesg with 4.15.0-rc2 amd-staging-drm-next with SysRq : Show State

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 3/3] video: smscufx: Delete an error message for a failed memory allocation in ufx_realloc_framebuffer()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 16:12:40 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---

v3:
This update suggestion was rebased on source files from the software
"Linux next-20180105".

 drivers/video/fbdev/smscufx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c
index abbded605d68..22b606af0a87 100644
--- a/drivers/video/fbdev/smscufx.c
+++ b/drivers/video/fbdev/smscufx.c
@@ -1307,10 +1307,8 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, 
struct fb_info *info)
 * Alloc system memory for virtual framebuffer
 */
new_fb = vmalloc(new_len);
-   if (!new_fb) {
-   pr_err("Virtual framebuffer alloc failed");
+   if (!new_fb)
return -ENOMEM;
-   }
 
if (info->screen_base) {
memcpy(new_fb, old_fb, old_len);
-- 
2.15.1

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


[PATCH v3 2/3] video: smscufx: Return an error code only as a constant in ufx_realloc_framebuffer()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 16:07:11 +0100

* Return an error code without storing it in an intermediate variable.

* Delete the label "error" and local variable "retval"
  which became unnecessary with this refactoring.

Signed-off-by: Markus Elfring 
---

v3:
This update suggestion was rebased on source files from the software
"Linux next-20180105".

 drivers/video/fbdev/smscufx.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c
index 893daeb1ffd9..abbded605d68 100644
--- a/drivers/video/fbdev/smscufx.c
+++ b/drivers/video/fbdev/smscufx.c
@@ -1293,7 +1293,6 @@ static struct fb_ops ufx_ops = {
  * Assumes no active clients have framebuffer open */
 static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info)
 {
-   int retval = -ENOMEM;
int old_len = info->fix.smem_len;
int new_len;
unsigned char *old_fb = info->screen_base;
@@ -1310,7 +1309,7 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, 
struct fb_info *info)
new_fb = vmalloc(new_len);
if (!new_fb) {
pr_err("Virtual framebuffer alloc failed");
-   goto error;
+   return -ENOMEM;
}
 
if (info->screen_base) {
@@ -1323,11 +1322,7 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, 
struct fb_info *info)
info->fix.smem_start = (unsigned long) new_fb;
info->flags = smscufx_info_flags;
}
-
-   retval = 0;
-
-error:
-   return retval;
+   return 0;
 }
 
 /* sets up I2C Controller for 100 Kbps, std. speed, 7-bit addr, master,
-- 
2.15.1

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


[PATCH v3 1/3] video: smscufx: Less checks in ufx_usb_probe() after error detection

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 15:56:11 +0100

Up to four checks could be repeated by the ufx_usb_probe() function
during error handling even if the relevant properties can be determined
for the involved variables before by source code analysis.

* Return directly after a call of the function "kzalloc" failed
  at the beginning.

* Adjust jump targets so that extra checks can be omitted at the end.

* Delete initialisations for the variables "info" and "retval"
  which became unnecessary with this refactoring.

Signed-off-by: Markus Elfring 
---

v3:
This update suggestion was rebased on source files from the software
"Linux next-20180105".

v2:
A call of the function "fb_dealloc_cmap" was preserved for the exception
handling at the end.

 drivers/video/fbdev/smscufx.c | 46 ++-
 1 file changed, 19 insertions(+), 27 deletions(-)

diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c
index 8db7085e5d1a..893daeb1ffd9 100644
--- a/drivers/video/fbdev/smscufx.c
+++ b/drivers/video/fbdev/smscufx.c
@@ -1620,8 +1620,8 @@ static int ufx_usb_probe(struct usb_interface *interface,
 {
struct usb_device *usbdev;
struct ufx_data *dev;
-   struct fb_info *info = NULL;
-   int retval = -ENOMEM;
+   struct fb_info *info;
+   int retval;
u32 id_rev, fpga_rev;
 
/* usb initialization */
@@ -1631,7 +1631,7 @@ static int ufx_usb_probe(struct usb_interface *interface,
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (dev == NULL) {
dev_err(&usbdev->dev, "ufx_usb_probe: failed alloc of dev 
struct\n");
-   goto error;
+   return -ENOMEM;
}
 
/* we need to wait for both usb and fbdev to spin down on disconnect */
@@ -1652,9 +1652,8 @@ static int ufx_usb_probe(struct usb_interface *interface,
dev_dbg(dev->gdev, "fb_defio enable=%d\n", fb_defio);
 
if (!ufx_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) {
-   retval = -ENOMEM;
dev_err(dev->gdev, "ufx_alloc_urb_list failed\n");
-   goto error;
+   goto e_nomem;
}
 
/* We don't register a new USB class. Our client interface is fbdev */
@@ -1662,9 +1661,8 @@ static int ufx_usb_probe(struct usb_interface *interface,
/* allocates framebuffer driver structure, not framebuffer memory */
info = framebuffer_alloc(0, &usbdev->dev);
if (!info) {
-   retval = -ENOMEM;
dev_err(dev->gdev, "framebuffer_alloc failed\n");
-   goto error;
+   goto e_nomem;
}
 
dev->info = info;
@@ -1675,7 +1673,7 @@ static int ufx_usb_probe(struct usb_interface *interface,
retval = fb_alloc_cmap(&info->cmap, 256, 0);
if (retval < 0) {
dev_err(dev->gdev, "fb_alloc_cmap failed %x\n", retval);
-   goto error;
+   goto destroy_modedb;
}
 
INIT_DELAYED_WORK(&dev->free_framebuffer_work,
@@ -1736,26 +1734,20 @@ static int ufx_usb_probe(struct usb_interface 
*interface,
return 0;
 
 error:
-   if (dev) {
-   if (info) {
-   if (info->cmap.len != 0)
-   fb_dealloc_cmap(&info->cmap);
-   if (info->monspecs.modedb)
-   fb_destroy_modedb(info->monspecs.modedb);
-   vfree(info->screen_base);
-
-   fb_destroy_modelist(&info->modelist);
-
-   framebuffer_release(info);
-   }
-
-   kref_put(&dev->kref, ufx_free); /* ref for framebuffer */
-   kref_put(&dev->kref, ufx_free); /* last ref from kref_init */
-
-   /* dev has been deallocated. Do not dereference */
-   }
-
+   fb_dealloc_cmap(&info->cmap);
+destroy_modedb:
+   fb_destroy_modedb(info->monspecs.modedb);
+   vfree(info->screen_base);
+   fb_destroy_modelist(&info->modelist);
+   framebuffer_release(info);
+put_ref:
+   kref_put(&dev->kref, ufx_free); /* ref for framebuffer */
+   kref_put(&dev->kref, ufx_free); /* last ref from kref_init */
return retval;
+
+e_nomem:
+   retval = -ENOMEM;
+   goto put_ref;
 }
 
 static void ufx_usb_disconnect(struct usb_interface *interface)
-- 
2.15.1

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


[PATCH v3 0/3] video-SMSC UFX: Adjustments for two function implementations

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 16:54:32 +0100

Three update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Less checks in ufx_usb_probe() after error detection
  Return an error code only as a constant
in ufx_realloc_framebuffer()
  Delete an error message for a failed memory allocation
in ufx_realloc_framebuffer()

---

v3:
Rebased on Linux next-20180105.

 drivers/video/fbdev/smscufx.c | 59 ---
 1 file changed, 22 insertions(+), 37 deletions(-)

-- 
2.15.1

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


[Bug 104527] Amdgpu locks up occasionally when running 3d applications

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104527

--- Comment #1 from Michal Suchanek  ---
Created attachment 136598
  --> https://bugs.freedesktop.org/attachment.cgi?id=136598&action=edit
X log with "BUG: triggered 'if (in_input_thread())'" traces removed

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104285] Euro Truck Simulator 2 and American Truck Simulator artifacts (Mesa 17.3, AMD R9 280X)

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104285

--- Comment #3 from Vladimir Usikov  ---
I can confirm this bug.

Radeon HD 7950 (amdgpu kernel module)

kernel 4.14.0-4.14.11
mesa 17.3.0-17.3.0
LLVM 5.0.0-5.0.1

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104527] Amdgpu locks up occasionally when running 3d applications

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104527

Bug ID: 104527
   Summary: Amdgpu locks up occasionally when running 3d
applications
   Product: DRI
   Version: unspecified
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: hramr...@gmail.com

Created attachment 136597
  --> https://bugs.freedesktop.org/attachment.cgi?id=136597&action=edit
kernel messages

Linux 4.14.0 libdrm 2.4.89 mesa 17.3.1 on Debian

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc.
[AMD/ATI] Baffin [Radeon RX 460] [1002:67ef] (rev cf)

After lockup I see this message:

[150509.194713] amdgpu :01:00.0: GPU fault detected: 147 0x4802
[150509.194718] amdgpu :01:00.0:   VM_CONTEXT1_PROTECTION_FAULT_ADDR  
0x
[150509.194720] amdgpu :01:00.0:   VM_CONTEXT1_PROTECTION_FAULT_STATUS
0x0A048002
[150509.194722] amdgpu :01:00.0: VM fault (0x02, vmid 5) at page 0, read
from 'TC0' (0x54433000) (72)

but similar message earlier did not cause lockup

[112552.659698] amdgpu :01:00.0: GPU fault detected: 147 0x07f04802
[112552.659702] amdgpu :01:00.0:   VM_CONTEXT1_PROTECTION_FAULT_ADDR  
0x0003F8FE
[112552.659704] amdgpu :01:00.0:   VM_CONTEXT1_PROTECTION_FAULT_STATUS
0x0A048002
[112552.659706] amdgpu :01:00.0: VM fault (0x02, vmid 5) at page 260350,
read from 'TC0' (0x54433000) (72)

Earlier versions of kernel+mesa would occasionally lock up displaying garbage
randomly at any time. I have not seen that for a while but the card still
occasionally locks up when running a 3D application. After lock up the card
keeps showing static screen of something the application rendered and movable
cursor. It *seems* to happen most often when there is some setup in progress
like loading a new scene.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104526] 0x00007fce563644fb in update_buffers (dri2_surf=dri2_surf@entry=0x55b5be7fc690) at drivers/dri2/platform_wayland.c:541

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104526

Frank  changed:

   What|Removed |Added

 QA Contact|intel-3d-bugs@lists.freedes |dri-devel@lists.freedesktop
   |ktop.org|.org
   Assignee|intel-3d-bugs@lists.freedes |dri-devel@lists.freedesktop
   |ktop.org|.org
  Component|Drivers/DRI/i965|Drivers/DRI/i915

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/etnaviv: add missing major features field to debugfs

2018-01-07 Thread Lucas Stach
This can be useful when dealing with a new GPU core.

Signed-off-by: Lucas Stach 
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index febbd1e5bbc7..bab6a8286520 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -811,6 +811,8 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct 
seq_file *m)
verify_dma(gpu, &debug);
 
seq_puts(m, "\tfeatures\n");
+   seq_printf(m, "\t major_features: 0x%08x\n",
+  gpu->identity.features);
seq_printf(m, "\t minor_features0: 0x%08x\n",
   gpu->identity.minor_features0);
seq_printf(m, "\t minor_features1: 0x%08x\n",
-- 
2.11.0

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


[PATCH] drm/etnaviv: don't fail to build on arches without PHYS_OFFSET

2018-01-07 Thread Lucas Stach
Some architecture ports like ARC don't provide the PHYS_OFFSET symbol.
Define it to 0 in that case, which is the most conservative default in
the usage context of the etnaviv driver.

Signed-off-by: Lucas Stach 
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 935d99be748e..febbd1e5bbc7 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -31,6 +31,10 @@
 #include "state_hi.xml.h"
 #include "cmdstream.xml.h"
 
+#ifndef PHYS_OFFSET
+#define PHYS_OFFSET 0
+#endif
+
 static const struct platform_device_id gpu_ids[] = {
{ .name = "etnaviv-gpu,2d" },
{ },
-- 
2.11.0

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


[PATCH v2 4/5] drm/etnaviv: lock BOs after all other submit work is done

2018-01-07 Thread Lucas Stach
Populating objects, adding them to the GPU VM and patching/validating
the command stream might take a lot of CPU time. There is no reason to
hold all object reservations during that time.

Signed-off-by: Lucas Stach 
---
 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index 2e278a69f3f0..83339e0335ff 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -514,10 +514,6 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void 
*data,
if (ret)
goto err_submit_objects;
 
-   ret = submit_lock_objects(submit, &ticket);
-   if (ret)
-   goto err_submit_objects;
-
if (!etnaviv_cmd_validate_one(gpu, stream, args->stream_size / 4,
  relocs, args->nr_relocs)) {
ret = -EINVAL;
@@ -532,10 +528,6 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void 
*data,
}
}
 
-   ret = submit_fence_sync(submit);
-   if (ret)
-   goto err_submit_objects;
-
ret = submit_pin_objects(submit);
if (ret)
goto err_submit_objects;
@@ -552,6 +544,14 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void 
*data,
memcpy(submit->cmdbuf.vaddr, stream, args->stream_size);
submit->cmdbuf.user_size = ALIGN(args->stream_size, 8);
 
+   ret = submit_lock_objects(submit, &ticket);
+   if (ret)
+   goto err_submit_objects;
+
+   ret = submit_fence_sync(submit);
+   if (ret)
+   goto err_submit_objects;
+
ret = etnaviv_sched_push_job(&ctx->sched_entity[args->pipe], submit);
if (ret)
goto err_submit_objects;
-- 
2.11.0

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


[PATCH v2 3/5] drm/etnaviv: move dependency handling to scheduler

2018-01-07 Thread Lucas Stach
Move the fence dependency handling to the scheduler where it belongs.
Jobs with unsignaled dependencies just get to sit in the scheduler queue
without holding any locks.

Signed-off-by: Lucas Stach 
---
 drivers/gpu/drm/etnaviv/etnaviv_gem.h|  3 ++
 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 38 --
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c| 48 
 drivers/gpu/drm/etnaviv/etnaviv_gpu.h|  3 --
 drivers/gpu/drm/etnaviv/etnaviv_sched.c  | 45 ++
 5 files changed, 69 insertions(+), 68 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.h 
b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
index ae352f2a77f9..93e696fcc14f 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
@@ -94,6 +94,9 @@ struct etnaviv_gem_submit_bo {
u32 flags;
struct etnaviv_gem_object *obj;
struct etnaviv_vram_mapping *mapping;
+   struct dma_fence *excl;
+   unsigned int nr_shared;
+   struct dma_fence **shared;
 };
 
 /* Created per submit-ioctl, to track bo's and cmdstream bufs, etc,
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index 0bc89e4daade..2e278a69f3f0 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -170,29 +170,33 @@ static int submit_lock_objects(struct etnaviv_gem_submit 
*submit,
return ret;
 }
 
-static int submit_fence_sync(const struct etnaviv_gem_submit *submit)
+static int submit_fence_sync(struct etnaviv_gem_submit *submit)
 {
-   unsigned int context = submit->gpu->fence_context;
int i, ret = 0;
 
for (i = 0; i < submit->nr_bos; i++) {
-   struct etnaviv_gem_object *etnaviv_obj = submit->bos[i].obj;
-   bool write = submit->bos[i].flags & ETNA_SUBMIT_BO_WRITE;
-   bool explicit = !!(submit->flags & ETNA_SUBMIT_NO_IMPLICIT);
+   struct etnaviv_gem_submit_bo *bo = &submit->bos[i];
+   struct reservation_object *robj = bo->obj->resv;
 
-   ret = etnaviv_gpu_fence_sync_obj(etnaviv_obj, context, write,
-explicit);
-   if (ret)
-   break;
-   }
+   if (!(bo->flags & ETNA_SUBMIT_BO_WRITE)) {
+   ret = reservation_object_reserve_shared(robj);
+   if (ret)
+   return ret;
+   }
+
+   if (submit->flags & ETNA_SUBMIT_NO_IMPLICIT)
+   continue;
+
+   if (bo->flags & ETNA_SUBMIT_BO_WRITE) {
+   ret = reservation_object_get_fences_rcu(robj, &bo->excl,
+   &bo->nr_shared,
+   &bo->shared);
+   if (ret)
+   return ret;
+   } else {
+   bo->excl = reservation_object_get_excl_rcu(robj);
+   }
 
-   if (submit->flags & ETNA_SUBMIT_FENCE_FD_IN) {
-   /*
-* Wait if the fence is from a foreign context, or if the fence
-* array contains any fence from a foreign context.
-*/
-   if (!dma_fence_match_context(submit->in_fence, context))
-   ret = dma_fence_wait(submit->in_fence, true);
}
 
return ret;
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 16f3518591ce..832950f22629 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1078,54 +1078,6 @@ static struct dma_fence *etnaviv_gpu_fence_alloc(struct 
etnaviv_gpu *gpu)
return &f->base;
 }
 
-int etnaviv_gpu_fence_sync_obj(struct etnaviv_gem_object *etnaviv_obj,
-   unsigned int context, bool exclusive, bool explicit)
-{
-   struct reservation_object *robj = etnaviv_obj->resv;
-   struct reservation_object_list *fobj;
-   struct dma_fence *fence;
-   int i, ret;
-
-   if (!exclusive) {
-   ret = reservation_object_reserve_shared(robj);
-   if (ret)
-   return ret;
-   }
-
-   if (explicit)
-   return 0;
-
-   /*
-* If we have any shared fences, then the exclusive fence
-* should be ignored as it will already have been signalled.
-*/
-   fobj = reservation_object_get_list(robj);
-   if (!fobj || fobj->shared_count == 0) {
-   /* Wait on any existing exclusive fence which isn't our own */
-   fence = reservation_object_get_excl(robj);
-   if (fence && fence->context != context) {
-   ret = dma_fence_wait(fence, true);
-   if (ret)
-

[PATCH v2 1/5] drm/etnaviv: track fences by IDR instead of seqno

2018-01-07 Thread Lucas Stach
This moves away from using the internal seqno as the userspace fence
reference. By moving to a generic ID, we can later replace the internal
fence by something different than the etnaviv seqno fence.

Signed-off-by: Lucas Stach 
---
 drivers/gpu/drm/etnaviv/etnaviv_gem.h|  1 +
 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c |  2 +-
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c| 56 +++-
 drivers/gpu/drm/etnaviv/etnaviv_gpu.h|  1 +
 4 files changed, 42 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.h 
b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
index be72a9833f2b..c30964152381 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
@@ -104,6 +104,7 @@ struct etnaviv_gem_submit {
struct kref refcount;
struct etnaviv_gpu *gpu;
struct dma_fence *out_fence, *in_fence;
+   int out_fence_id;
struct list_head node; /* GPU active submit list */
struct etnaviv_cmdbuf cmdbuf;
bool runtime_resumed;
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index 1f8202bca061..919c8dc39f32 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -563,7 +563,7 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void 
*data,
}
 
args->fence_fd = out_fence_fd;
-   args->fence = submit->out_fence->seqno;
+   args->fence = submit->out_fence_id;
 
 err_submit_objects:
etnaviv_submit_put(submit);
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 21d0d22f1168..935d99be748e 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1010,6 +1010,7 @@ static void hangcheck_disable(struct etnaviv_gpu *gpu)
 /* fence object management */
 struct etnaviv_fence {
struct etnaviv_gpu *gpu;
+   int id;
struct dma_fence base;
 };
 
@@ -1046,6 +1047,11 @@ static void etnaviv_fence_release(struct dma_fence 
*fence)
 {
struct etnaviv_fence *f = to_etnaviv_fence(fence);
 
+   /* first remove from IDR, so fence can not be looked up anymore */
+   mutex_lock(&f->gpu->lock);
+   idr_remove(&f->gpu->fence_idr, f->id);
+   mutex_unlock(&f->gpu->lock);
+
kfree_rcu(f, base.rcu);
 }
 
@@ -1072,6 +1078,11 @@ static struct dma_fence *etnaviv_gpu_fence_alloc(struct 
etnaviv_gpu *gpu)
if (!f)
return NULL;
 
+   f->id = idr_alloc_cyclic(&gpu->fence_idr, &f->base, 0, INT_MAX, 
GFP_KERNEL);
+   if (f->id < 0) {
+   kfree(f);
+   return NULL;
+   }
f->gpu = gpu;
 
dma_fence_init(&f->base, &etnaviv_fence_ops, &gpu->fence_spinlock,
@@ -1220,35 +1231,43 @@ static void retire_worker(struct work_struct *work)
 }
 
 int etnaviv_gpu_wait_fence_interruptible(struct etnaviv_gpu *gpu,
-   u32 fence, struct timespec *timeout)
+   u32 id, struct timespec *timeout)
 {
+   struct dma_fence *fence;
int ret;
 
-   if (fence_after(fence, gpu->next_fence)) {
-   DRM_ERROR("waiting on invalid fence: %u (of %u)\n",
-   fence, gpu->next_fence);
-   return -EINVAL;
-   }
+   /*
+* Look up the fence and take a reference. The mutex only synchronizes
+* the IDR lookup with the fence release. We might still find a fence
+* whose refcount has already dropped to zero. dma_fence_get_rcu
+* pretends we didn't find a fence in that case.
+*/
+   ret = mutex_lock_interruptible(&gpu->lock);
+   if (ret)
+   return ret;
+   fence = idr_find(&gpu->fence_idr, id);
+   if (fence)
+   fence = dma_fence_get_rcu(fence);
+   mutex_unlock(&gpu->lock);
+
+   if (!fence)
+   return 0;
 
if (!timeout) {
/* No timeout was requested: just test for completion */
-   ret = fence_completed(gpu, fence) ? 0 : -EBUSY;
+   ret = dma_fence_is_signaled(fence) ? 0 : -EBUSY;
} else {
unsigned long remaining = etnaviv_timeout_to_jiffies(timeout);
 
-   ret = wait_event_interruptible_timeout(gpu->fence_event,
-   fence_completed(gpu, fence),
-   remaining);
-   if (ret == 0) {
-   DBG("timeout waiting for fence: %u (retired: %u 
completed: %u)",
-   fence, gpu->retired_fence,
-   gpu->completed_fence);
+   ret = dma_fence_wait_timeout(fence, true, remaining);
+   if (ret == 0)
ret = -ETIMEDOUT;
-   } else if (ret != -ERESTARTSYS) {
+   else if (ret != -ERESTARTSYS)
ret = 0;
- 

[PATCH v2 5/5] drm/etnaviv: replace hangcheck with scheduler timeout

2018-01-07 Thread Lucas Stach
This replaces the etnaviv internal hangcheck logic with the job timeout
handling provided by the DRM scheduler. This simplifies the driver further
and allows to replay jobs after a GPU reset, so only minimal state is lost.

This introduces a user-visible change in that we don't allow jobs to run
indefinitely as long as they make progress anymore, as this introduces
quality of service issues when multiple processes are using the GPU.
Userspace is now responsible to flush jobs in a way that they finish in a
reasonable time, where reasonable is currently defined as less than 500ms.

Signed-off-by: Lucas Stach 
---
 drivers/gpu/drm/etnaviv/etnaviv_dump.c   | 21 ++-
 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c |  1 -
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c| 89 
 drivers/gpu/drm/etnaviv/etnaviv_gpu.h| 11 +---
 drivers/gpu/drm/etnaviv/etnaviv_sched.c  | 43 +++---
 drivers/gpu/drm/etnaviv/etnaviv_sched.h  | 12 
 6 files changed, 63 insertions(+), 114 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_dump.c 
b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
index 6d0909c589d1..48aef6cf6a42 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_dump.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
@@ -20,9 +20,13 @@
 #include "etnaviv_gem.h"
 #include "etnaviv_gpu.h"
 #include "etnaviv_mmu.h"
+#include "etnaviv_sched.h"
 #include "state.xml.h"
 #include "state_hi.xml.h"
 
+static bool etnaviv_dump_core = true;
+module_param_named(dump_core, etnaviv_dump_core, bool, 0600);
+
 struct core_dump_iterator {
void *start;
struct etnaviv_dump_object_header *hdr;
@@ -121,10 +125,16 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
struct etnaviv_vram_mapping *vram;
struct etnaviv_gem_object *obj;
struct etnaviv_gem_submit *submit;
+   struct drm_sched_job *s_job;
unsigned int n_obj, n_bomap_pages;
size_t file_size, mmu_size;
__le64 *bomap, *bomap_start;
 
+   /* Only catch the first event, or when manually re-armed */
+   if (!etnaviv_dump_core)
+   return;
+   etnaviv_dump_core = false;
+
mmu_size = etnaviv_iommu_dump_size(gpu->mmu);
 
/* We always dump registers, mmu, ring and end marker */
@@ -135,10 +145,13 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
mmu_size + gpu->buffer.size;
 
/* Add in the active command buffers */
-   list_for_each_entry(submit, &gpu->active_submit_list, node) {
+   spin_lock(&gpu->sched.job_list_lock);
+   list_for_each_entry(s_job, &gpu->sched.ring_mirror_list, node) {
+   submit = to_etnaviv_submit(s_job);
file_size += submit->cmdbuf.size;
n_obj++;
}
+   spin_unlock(&gpu->sched.job_list_lock);
 
/* Add in the active buffer objects */
list_for_each_entry(vram, &gpu->mmu->mappings, mmu_node) {
@@ -180,10 +193,14 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
  gpu->buffer.size,
  etnaviv_cmdbuf_get_va(&gpu->buffer));
 
-   list_for_each_entry(submit, &gpu->active_submit_list, node)
+   spin_lock(&gpu->sched.job_list_lock);
+   list_for_each_entry(s_job, &gpu->sched.ring_mirror_list, node) {
+   submit = to_etnaviv_submit(s_job);
etnaviv_core_dump_mem(&iter, ETDUMP_BUF_CMD,
  submit->cmdbuf.vaddr, submit->cmdbuf.size,
  etnaviv_cmdbuf_get_va(&submit->cmdbuf));
+   }
+   spin_unlock(&gpu->sched.job_list_lock);
 
/* Reserve space for the bomap */
if (n_bomap_pages) {
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index 83339e0335ff..46ecd3e66ac9 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -542,7 +542,6 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void 
*data,
goto err_submit_objects;
 
memcpy(submit->cmdbuf.vaddr, stream, args->stream_size);
-   submit->cmdbuf.user_size = ALIGN(args->stream_size, 8);
 
ret = submit_lock_objects(submit, &ticket);
if (ret)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 832950f22629..a8b4cf76188d 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -37,9 +37,6 @@ static const struct platform_device_id gpu_ids[] = {
{ },
 };
 
-static bool etnaviv_dump_core = true;
-module_param_named(dump_core, etnaviv_dump_core, bool, 0600);
-
 /*
  * Driver functions:
  */
@@ -913,38 +910,24 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct 
seq_file *m)
 }
 #endif
 
-/*
- * Hangcheck detection for locked gpu:
- */
-static void recover_worker(struct work_struct *work)
+void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gp

[PATCH v2 2/5] drm/etnaviv: hook up DRM GPU scheduler

2018-01-07 Thread Lucas Stach
This hooks in the DRM GPU scheduler. No improvement yet, as all the
dependency handling is still done in etnaviv_gem_submit. This just
replaces the actual GPU submit by passing through the scheduler.

Allows to get rid of the retire worker, as this is now driven by the
scheduler.

Signed-off-by: Lucas Stach 
---
 drivers/gpu/drm/etnaviv/Kconfig  |   1 +
 drivers/gpu/drm/etnaviv/Makefile |   3 +-
 drivers/gpu/drm/etnaviv/etnaviv_drv.c|  16 
 drivers/gpu/drm/etnaviv/etnaviv_drv.h|   7 +-
 drivers/gpu/drm/etnaviv/etnaviv_gem.h|   1 +
 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c |  11 ++-
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c| 113 +---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.h|  14 +--
 drivers/gpu/drm/etnaviv/etnaviv_sched.c  | 125 +++
 drivers/gpu/drm/etnaviv/etnaviv_sched.h  |  22 +
 10 files changed, 222 insertions(+), 91 deletions(-)
 create mode 100644 drivers/gpu/drm/etnaviv/etnaviv_sched.c
 create mode 100644 drivers/gpu/drm/etnaviv/etnaviv_sched.h

diff --git a/drivers/gpu/drm/etnaviv/Kconfig b/drivers/gpu/drm/etnaviv/Kconfig
index 3f58b4077767..e5bfeca361bd 100644
--- a/drivers/gpu/drm/etnaviv/Kconfig
+++ b/drivers/gpu/drm/etnaviv/Kconfig
@@ -11,6 +11,7 @@ config DRM_ETNAVIV
select WANT_DEV_COREDUMP
select CMA if HAVE_DMA_CONTIGUOUS
select DMA_CMA if HAVE_DMA_CONTIGUOUS
+   select DRM_SCHED
help
  DRM driver for Vivante GPUs.
 
diff --git a/drivers/gpu/drm/etnaviv/Makefile b/drivers/gpu/drm/etnaviv/Makefile
index 1281c8d4fae5..9bb780c22501 100644
--- a/drivers/gpu/drm/etnaviv/Makefile
+++ b/drivers/gpu/drm/etnaviv/Makefile
@@ -12,6 +12,7 @@ etnaviv-y := \
etnaviv_iommu_v2.o \
etnaviv_iommu.o \
etnaviv_mmu.o \
-   etnaviv_perfmon.o
+   etnaviv_perfmon.o \
+   etnaviv_sched.o
 
 obj-$(CONFIG_DRM_ETNAVIV)  += etnaviv.o
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index 6faf4042db23..8a73414682b2 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -101,12 +101,25 @@ static void load_gpu(struct drm_device *dev)
 
 static int etnaviv_open(struct drm_device *dev, struct drm_file *file)
 {
+   struct etnaviv_drm_private *priv = dev->dev_private;
struct etnaviv_file_private *ctx;
+   int i;
 
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
 
+   for (i = 0; i < ETNA_MAX_PIPES; i++) {
+   struct etnaviv_gpu *gpu = priv->gpu[i];
+
+   if (gpu) {
+   drm_sched_entity_init(&gpu->sched,
+   &ctx->sched_entity[i],
+   &gpu->sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL],
+   32, NULL);
+   }
+   }
+
file->driver_priv = ctx;
 
return 0;
@@ -126,6 +139,9 @@ static void etnaviv_postclose(struct drm_device *dev, 
struct drm_file *file)
if (gpu->lastctx == ctx)
gpu->lastctx = NULL;
mutex_unlock(&gpu->lock);
+
+   drm_sched_entity_fini(&gpu->sched,
+ &ctx->sched_entity[i]);
}
}
 
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.h 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.h
index a54f0b758a5c..1f055d931c6c 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.h
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct etnaviv_cmdbuf;
 struct etnaviv_gpu;
@@ -42,11 +43,11 @@ struct etnaviv_gem_object;
 struct etnaviv_gem_submit;
 
 struct etnaviv_file_private {
-   /* currently we don't do anything useful with this.. but when
-* per-context address spaces are supported we'd keep track of
+   /*
+* When per-context address spaces are supported we'd keep track of
 * the context's page-tables here.
 */
-   int dummy;
+   struct drm_sched_entity sched_entity[ETNA_MAX_PIPES];
 };
 
 struct etnaviv_drm_private {
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.h 
b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
index c30964152381..ae352f2a77f9 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
@@ -101,6 +101,7 @@ struct etnaviv_gem_submit_bo {
  * make it easier to unwind when things go wrong, etc).
  */
 struct etnaviv_gem_submit {
+   struct drm_sched_job sched_job;
struct kref refcount;
struct etnaviv_gpu *gpu;
struct dma_fence *out_fence, *in_fence;
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index 919c8dc39f32..0bc89e4daade 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnavi

[Bug 103791] Tearing after screen wakeup/on

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103791

--- Comment #20 from denisgolo...@yandex.ru ---
Doing 
$ xrandr --output DisplayPort-0 --set TearFree on

... does not help. Tearing is still present.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 2/2] video: udlfb: Delete an error message for a failed memory allocation in dlfb_realloc_framebuffer()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 14:07:36 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---

v2:
This update suggestion was rebased on source files from the software
"Linux next-20180105" together with an other change combination.

 drivers/video/fbdev/udlfb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index 560a6b6044a5..0c781b077aab 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1172,10 +1172,8 @@ static int dlfb_realloc_framebuffer(struct dlfb_data 
*dev, struct fb_info *info)
 * Alloc system memory for virtual framebuffer
 */
new_fb = vmalloc(new_len);
-   if (!new_fb) {
-   pr_err("Virtual framebuffer alloc failed\n");
+   if (!new_fb)
return -ENOMEM;
-   }
 
if (info->screen_base) {
memcpy(new_fb, old_fb, old_len);
-- 
2.15.1

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


[PATCH v2 1/2] video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 14:02:36 +0100

* Return an error code without storing it in an intermediate variable.

* Delete the label "error" and local variable "retval"
  which became unnecessary with this refactoring.

Signed-off-by: Markus Elfring 
---

v2:
This update suggestion was rebased on source files from the software
"Linux next-20180105".

 drivers/video/fbdev/udlfb.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index 99ce445986b3..560a6b6044a5 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1157,7 +1157,6 @@ static struct fb_ops dlfb_ops = {
  */
 static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info 
*info)
 {
-   int retval = -ENOMEM;
int old_len = info->fix.smem_len;
int new_len;
unsigned char *old_fb = info->screen_base;
@@ -1175,7 +1174,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data 
*dev, struct fb_info *info)
new_fb = vmalloc(new_len);
if (!new_fb) {
pr_err("Virtual framebuffer alloc failed\n");
-   goto error;
+   return -ENOMEM;
}
 
if (info->screen_base) {
@@ -1203,11 +1202,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data 
*dev, struct fb_info *info)
dev->backing_buffer = new_back;
}
}
-
-   retval = 0;
-
-error:
-   return retval;
+   return 0;
 }
 
 /*
-- 
2.15.1

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


[PATCH v2 0/2] video-UDLFB: Adjustments for dlfb_realloc_framebuffer()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 14:24:34 +0100

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Return an error code only as a constant
  Delete an error message for a failed memory allocation

---

v2:
Rebased on Linux next-20180105.

 drivers/video/fbdev/udlfb.c | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

-- 
2.15.1

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


[PATCH v2 2/2] video/fbdev/stifb: Delete an error message for a failed memory allocation in stifb_init_fb()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 12:34:22 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---

v2:
This update suggestion was rebased on source files from the software
"Linux next-20180105" together with a change for an error code.

 drivers/video/fbdev/stifb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c
index 511a594889af..dec8efb4f256 100644
--- a/drivers/video/fbdev/stifb.c
+++ b/drivers/video/fbdev/stifb.c
@@ -1126,10 +1126,8 @@ static int __init stifb_init_fb(struct sti_struct *sti, 
int bpp_pref)
int bpp, xres, yres;
 
fb = kzalloc(sizeof(*fb), GFP_ATOMIC);
-   if (!fb) {
-   printk(KERN_ERR "stifb: Could not allocate stifb structure\n");
+   if (!fb)
return -ENOMEM;
-   }

info = &fb->info;
 
-- 
2.15.1

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


[PATCH v2 1/2] video/fbdev/stifb: Return -ENOMEM after a failed kzalloc() in stifb_init_fb()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 11:33:59 +0100

Replace an error code for the indication of a memory allocation failure
in this function.

Fixes: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac ("Linux-2.6.12-rc2: Initial git 
repository build")
Suggested-by: Rolf Eike Beer 
Signed-off-by: Markus Elfring 
---
 drivers/video/fbdev/stifb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c
index 6ded5c198998..511a594889af 100644
--- a/drivers/video/fbdev/stifb.c
+++ b/drivers/video/fbdev/stifb.c
@@ -1128,7 +1128,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, 
int bpp_pref)
fb = kzalloc(sizeof(*fb), GFP_ATOMIC);
if (!fb) {
printk(KERN_ERR "stifb: Could not allocate stifb structure\n");
-   return -ENODEV;
+   return -ENOMEM;
}

info = &fb->info;
-- 
2.15.1

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


[PATCH v2 0/2] video/fbdev/stifb: Adjustments for stifb_init_fb()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 7 Jan 2018 12:45:54 +0100

Two update suggestions were taken into account.

Markus Elfring (2):
  Return -ENOMEM after a failed kzalloc()
  Delete an error message for a failed memory allocation

 drivers/video/fbdev/stifb.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

-- 
2.15.1

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


[Bug 104520] Intermittent X crashes: GPU HANG: ecode 9:0:0x85dffffb, in Xorg [443], reason: Hang on rcs0, action: reset

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104520

--- Comment #2 from Amy  ---
Further info:

Kernel (Arch Linux): 

4.14.12-1-ARCH #1 SMP PREEMPT Fri Jan 5 18:19:34 UTC 2018 x86_64 GNU/Linux

LSPCI info:
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02)
Subsystem: Acer Incorporated [ALI] HD Graphics 620
Kernel driver in use: i915
Kernel modules: i915
--
01:00.0 3D controller: NVIDIA Corporation Device 179c (rev ff)
Kernel modules: nouveau, nvidia_drm, nvidia

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104520] Intermittent X crashes: GPU HANG: ecode 9:0:0x85dffffb, in Xorg [443], reason: Hang on rcs0, action: reset

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104520

--- Comment #3 from Amy  ---
Created attachment 136593
  --> https://bugs.freedesktop.org/attachment.cgi?id=136593&action=edit
Glxinfo output.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104520] Intermittent X crashes: GPU HANG: ecode 9:0:0x85dffffb, in Xorg [443], reason: Hang on rcs0, action: reset

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104520

--- Comment #1 from Amy  ---
Created attachment 136592
  --> https://bugs.freedesktop.org/attachment.cgi?id=136592&action=edit
Dmesg log

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104520] Intermittent X crashes: GPU HANG: ecode 9:0:0x85dffffb, in Xorg [443], reason: Hang on rcs0, action: reset

2018-01-07 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104520

Bug ID: 104520
   Summary: Intermittent X crashes: GPU HANG: ecode
9:0:0x85db, in Xorg [443], reason: Hang on rcs0,
action: reset
   Product: Mesa
   Version: unspecified
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/DRI/i915
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: awil...@xsmail.com
QA Contact: dri-devel@lists.freedesktop.org

Created attachment 136591
  --> https://bugs.freedesktop.org/attachment.cgi?id=136591&action=edit
GPU error dup.

1) startx
2) loading i3 and i3 scripts (loading an xterm and palemoon) intermittently
crashes
Result: GPU hangs, and eventually X crashes with this message in the dmesg.

[drm] GPU HANG: ecode 9:0:0x85db, in Xorg [443], reason: Hang on rcs0,
action: reset
[  561.340148] [drm] GPU hangs can indicate a bug anywhere in the entire gfx
stack, including userspace.
[  561.340148] [drm] Please file a _new_ bug report on bugs.freedesktop.org
against DRI -> DRM/Intel
[  561.340148] [drm] drm/i915 developers can then reassign to the right
component if it's not a kernel issue.
[  561.340149] [drm] The gpu crash dump is required to analyze gpu hangs, so
please always attach it.
[  561.340149] [drm] GPU crash dump saved to /sys/class/drm/card0/error

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel