[Bug 106872] vram sizes reported by the kernel totally off

2018-06-09 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106872

Bug ID: 106872
   Summary: vram sizes reported by the kernel totally off
   Product: DRI
   Version: unspecified
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: b...@basnieuwenhuizen.nl

With Pierre-Loup's desktop we have an issue where the reported VRAM and CPU
visible VRAM are totally off.

e.g. the last report we had kernel reported total VRAM size of
0xfffb3070f000 (16.0 EiB) and a visible VRAM size of 0x86135000 (2.09 GiB).

The system is a large aperture system, so expected is ~8 GiB for both, and it
is most of the time. The system typically boots in a good state and eventually
after a while transitions to a bad state and sometimes it transitions back.

We have not been able to find a pattern and on one of the earlier cases the
debugfs vram_mm file reported reasonable size & utilization.


The kernels that have been tried include amd-staging-drm-next and a released
kernel (need to look up whether it was 4.15 or 4.16 if that information is
needed)

-- 
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 106871] Screen with blank cursor (raven ridge on MSI B350)

2018-06-09 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106871

Bug ID: 106871
   Summary: Screen with blank cursor (raven ridge on MSI B350)
   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: keve...@gmail.com

Created attachment 140110
  --> https://bugs.freedesktop.org/attachment.cgi?id=140110=edit
xorg loggings with the problem

After upgrading my debian stable with a (i assumed) a nice cpu with graphics
AMD 2200G, it did not work, only in VESA mode.
I upgrade to unstable/sed and now have a non working system with default
settings.

For me it is not clear, where the problem is (kernel or amdgpu), but maybe you
can help me with steps to get it clear.

This are the warnings and errors:
[ 9.874] (WW) AMDGPU(0): No outputs definitely connected, trying again...
[ 9.874] (WW) AMDGPU(0): Unable to find connected outputs - setting
1024x768 initial framebuffer
[ 9.874] (EE) AMDGPU(0): No modes.
[ 9.874] (EE) Screen(s) found, but none have a usable configuration.

I have attached the following info:
* lshw -c video 
* dmesg 
* /var/log/Xorg.0.log 
* lsmod | grep amdgpu after boot.

I boot with kernel 4.16, to get a working VESA driver I use the "nomodeset"
flag on the kernel arguments.

What I also don't understand is why the system doesn't fallback on the VESA
driver?

Thanks already a lot!

-- 
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 199407] Radeon night light/redshift flickers

2018-06-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=199407

jerry (taiuset...@protonmail.com) changed:

   What|Removed |Added

 CC||taiuset...@protonmail.com

--- Comment #8 from jerry (taiuset...@protonmail.com) ---
Created attachment 276427
  --> https://bugzilla.kernel.org/attachment.cgi?id=276427=edit
dmesg screen flickering

I'm also experiencing random screen flickering

Laptop: dell 11 3000

CPU: A6 9220e, GPU: Radeon R4

RAM: 4GB

Fedora28 workstation, wayland + gnome3, night light on

driver: amdgpu

kernel: 4.16.14

I already have amdgpu.dc=0 in my kernel parameter, yet I’m still experiencing
random screen flickering.

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


[Bug 106670] AMD GPU Error, random lockup, Ryzen 2500U Vega 8 GPU

2018-06-09 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106670

--- Comment #5 from Jack Wolf  ---
I have same issues.

AMD Ryzen 1800x 
Sapphier Vega 56
amdgpu git
kernel 4.17.0

This is what dmesg say from time to time beyond a hang up.

[Sa Jun  9 17:34:54 2018] [drm:generic_reg_wait] *ERROR* REG_WAIT timeout 10us
* 3500 tries - dce_mi_free_dmif line:563
[Sa Jun  9 17:34:54 2018] WARNING: CPU: 14 PID: 175 at
drivers/gpu/drm/amd/amdgpu/../display/dc/dc_helper.c:195
generic_reg_wait+0xe2/0x160
[Sa Jun  9 17:34:54 2018] Modules linked in: vboxpci(O) vboxnetadp(O)
vboxnetflt(O) vboxdrv(O)
[Sa Jun  9 17:34:54 2018] CPU: 14 PID: 175 Comm: kworker/14:1 Tainted: G   
   O  4.17.0 #1
[Sa Jun  9 17:34:54 2018] Hardware name: System manufacturer System Product
Name/PRIME B350-PLUS, BIOS 4011 04/19/2018
[Sa Jun  9 17:34:54 2018] Workqueue: events dm_irq_work_func
[Sa Jun  9 17:34:54 2018] RIP: 0010:generic_reg_wait+0xe2/0x160
[Sa Jun  9 17:34:54 2018] RSP: 0018:ba1941e9fa88 EFLAGS: 00010297
[Sa Jun  9 17:34:54 2018] RAX:  RBX: 0dad RCX:

[Sa Jun  9 17:34:54 2018] RDX:  RSI: 985a9ef953b8 RDI:
985a9ef953b8
[Sa Jun  9 17:34:54 2018] RBP: 000a R08: 0416 R09:
0002
[Sa Jun  9 17:34:54 2018] R10: 0002 R11: 0001 R12:
985a8c8b5280
[Sa Jun  9 17:34:54 2018] R13: 35af R14: 0010 R15:
0001
[Sa Jun  9 17:34:54 2018] FS:  () GS:985a9ef8()
knlGS:
[Sa Jun  9 17:34:54 2018] CS:  0010 DS:  ES:  CR0: 80050033
[Sa Jun  9 17:34:54 2018] CR2: 55e803d42c78 CR3: 0003c621c000 CR4:
003406e0
[Sa Jun  9 17:34:54 2018] Call Trace:
[Sa Jun  9 17:34:54 2018]  dce_mi_free_dmif+0x11c/0x1a0
[Sa Jun  9 17:34:54 2018]  dce110_reset_hw_ctx_wrap+0x13b/0x1c0
[Sa Jun  9 17:34:54 2018]  dce110_apply_ctx_to_hw+0x51/0x8c0
[Sa Jun  9 17:34:54 2018]  ? amdgpu_pm_compute_clocks+0xa2/0x570
[Sa Jun  9 17:34:54 2018]  dc_commit_state+0x333/0x5f0
[Sa Jun  9 17:34:54 2018]  ? set_freesync_on_streams.part.6+0x48/0x240
[Sa Jun  9 17:34:54 2018]  ? mod_freesync_set_user_enable+0x116/0x140
[Sa Jun  9 17:34:54 2018]  amdgpu_dm_atomic_commit_tail+0x359/0xd10
[Sa Jun  9 17:34:54 2018]  ? amdgpu_bo_pin_restricted+0x227/0x2e0
[Sa Jun  9 17:34:54 2018]  ? _cond_resched+0x10/0x40
[Sa Jun  9 17:34:54 2018]  ? wait_for_completion_timeout+0x2f/0x130
[Sa Jun  9 17:34:54 2018]  ? _cond_resched+0x10/0x40
[Sa Jun  9 17:34:54 2018]  ? wait_for_completion_interruptible+0x2c/0x160
[Sa Jun  9 17:34:54 2018]  ? dm_plane_helper_prepare_fb+0xea/0x290
[Sa Jun  9 17:34:54 2018]  commit_tail+0x38/0x70
[Sa Jun  9 17:34:54 2018]  drm_atomic_helper_commit+0x11c/0x130
[Sa Jun  9 17:34:54 2018]  dm_restore_drm_connector_state+0x100/0x190
[Sa Jun  9 17:34:54 2018]  handle_hpd_irq+0x81/0xa0
[Sa Jun  9 17:34:54 2018]  dm_irq_work_func+0x49/0x60
[Sa Jun  9 17:34:54 2018]  process_one_work+0x1cc/0x3c0
[Sa Jun  9 17:34:54 2018]  worker_thread+0x26/0x3f0
[Sa Jun  9 17:34:54 2018]  ?
trace_event_raw_event_workqueue_execute_start+0xc0/0xc0
[Sa Jun  9 17:34:54 2018]  kthread+0x10e/0x130
[Sa Jun  9 17:34:54 2018]  ? kthread_create_worker_on_cpu+0x70/0x70
[Sa Jun  9 17:34:54 2018]  ret_from_fork+0x22/0x40
[Sa Jun  9 17:34:54 2018] Code: 24 58 48 8b 4c 24 50 89 ee 8b 54 24 48 48 c7 c7
48 1d 4b 9a 44 89 4c 24 08 e8 6b 70 eb ff 41 83 7c 24 20 01 44 8b 4c 24 08 74
02 <0f> 0b 48 83 c4 10 44 89 c8
5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f
[Sa Jun  9 17:34:54 2018] ---[ end trace b03679a92b01c897 ]---


I can't give logs about hangups because i can't enter the machine via ssh.

-- 
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 0/7] Replace {un/reference} with {put,get} functions

2018-06-09 Thread Thomas Zimmermann
This patch set replaces functions named {un,reference} by their {put,get}
counterparts. Each patch also removes the replaced functions from the DRM
core and deletes them from the related Coccinelle script.
Affected data types are struct drm_connector, struct drm_framebuffer,
struct drm_gem_object, and struct drm_device.

This change fixes the related item on the DRM TODO list.

With the reference-counting functions being named {put,get}, the DRM
interface is more aligned to Linux kernel nameing standard. The patch
set does not change driver-internal interfaces.

Possible future changes: Most of DRM's remaining {un/ref} functions
perform additional tasks besides reference counting and should
probably not be renamed. Exceptions are ttm_bo_{reference,unref} and
ttm_object_file_{un/ref}. These functions mostly perform reference
counting, but would require additional changes to the calling code
besides renaming.


Thomas Zimmermann (7):
  drm: Replace drm_connector_{un/reference} with drm_connector_{put,get}
  drm: Replace drm_framebuffer_{un/reference} with
drm_framebuffer_{put,get}
  drm: Replace drm_gem_object_{un/reference} with
drm_gem_object_{put,get}
  drm: Replace __drm_gem_object_unreference with __drm_gem_object_put
  drm: Replace drm_gem_object_unreference_unlocked with put function
  drm: Replace drm_dev_unref with drm_dev_put
  drm: Clean up after DRM put/get conversion

 Documentation/gpu/todo.rst | 17 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c|  4 +-
 drivers/gpu/drm/arc/arcpgu_drv.c   |  8 +--
 drivers/gpu/drm/armada/armada_crtc.c   |  8 +--
 drivers/gpu/drm/armada/armada_drv.c|  6 +-
 drivers/gpu/drm/armada/armada_overlay.c|  2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c   |  8 +--
 drivers/gpu/drm/bochs/bochs_fbdev.c|  2 +-
 drivers/gpu/drm/bochs/bochs_mm.c   | 10 +--
 drivers/gpu/drm/drm_drv.c  | 13 
 drivers/gpu/drm/etnaviv/etnaviv_drv.c  |  8 +--
 drivers/gpu/drm/exynos/exynos_drm_drv.c|  4 +-
 drivers/gpu/drm/exynos/exynos_drm_fb.c |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_gem.c| 10 +--
 drivers/gpu/drm/exynos/exynos_drm_plane.c  |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  |  8 +--
 drivers/gpu/drm/gma500/framebuffer.c   |  2 +-
 drivers/gpu/drm/gma500/gem.c   |  2 +-
 drivers/gpu/drm/gma500/gma_display.c   |  6 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c|  4 +-
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c|  8 +--
 drivers/gpu/drm/i915/i915_gem_object.h | 13 +---
 drivers/gpu/drm/i915/intel_display.c   |  4 +-
 drivers/gpu/drm/i915/intel_dp_mst.c|  2 +-
 drivers/gpu/drm/i915/selftests/huge_pages.c|  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_context.c  |  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c   |  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_evict.c|  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c  |  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_object.c   |  2 +-
 drivers/gpu/drm/i915/selftests/i915_request.c  |  2 +-
 drivers/gpu/drm/i915/selftests/i915_vma.c  |  2 +-
 drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c |  2 +-
 drivers/gpu/drm/imx/imx-drm-core.c |  8 +--
 drivers/gpu/drm/mediatek/mtk_drm_drv.c |  6 +-
 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c  |  4 +-
 drivers/gpu/drm/msm/adreno/a5xx_power.c|  2 +-
 drivers/gpu/drm/msm/adreno/a5xx_preempt.c  |  2 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c |  4 +-
 drivers/gpu/drm/msm/msm_drv.c  |  8 +--
 drivers/gpu/drm/msm/msm_gem_submit.c   |  4 +-
 drivers/gpu/drm/mxsfb/mxsfb_drv.c  |  4 +-
 drivers/gpu/drm/nouveau/dispnv04/crtc.c|  2 +-
 drivers/gpu/drm/nouveau/dispnv50/disp.c|  2 +-
 drivers/gpu/drm/nouveau/nouveau_abi16.c|  2 +-
 drivers/gpu/drm/nouveau/nouveau_display.c  |  8 +--
 drivers/gpu/drm/nouveau/nouveau_fbcon.c|  2 +-
 drivers/gpu/drm/nouveau/nouveau_gem.c  | 14 ++--
 drivers/gpu/drm/nouveau/nouveau_platform.c |  2 +-
 drivers/gpu/drm/omapdrm/omap_drv.c |  6 +-
 drivers/gpu/drm/omapdrm/omap_fb.c  |  2 +-
 drivers/gpu/drm/omapdrm/omap_fbdev.c   |  2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c |  4 +-
 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c  |  2 +-
 drivers/gpu/drm/pl111/pl111_drv.c  | 14 ++--
 drivers/gpu/drm/qxl/qxl_drv.c  |  2 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c  |  2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c|  4 +-
 drivers/gpu/drm/shmobile/shmob_drm_drv.c   |  4 +-
 

[PATCH 7/7] drm: Clean up after DRM put/get conversion

2018-06-09 Thread Thomas Zimmermann
All cases of simple conversion from un/reference to put,get have been
fixed. This patch deletes the related, now empty, Coccinelle script;
and removes the item from the DRM's TODO list.

Signed-off-by: Thomas Zimmermann 
---
 Documentation/gpu/todo.rst   | 17 
 scripts/coccinelle/api/drm-get-put.cocci | 35 
 2 files changed, 52 deletions(-)
 delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index a7c150d6b63f..fbd258ec4883 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -28,23 +28,6 @@ them, but also all the virtual ones used by KVM, so everyone 
qualifies).
 
 Contact: Daniel Vetter, Thierry Reding, respective driver maintainers
 
-Switch from reference/unreference to get/put
-
-
-For some reason DRM core uses ``reference``/``unreference`` suffixes for
-refcounting functions, but kernel uses ``get``/``put`` (e.g.
-``kref_get``/``put()``). It would be good to switch over for consistency, and
-it's shorter. Needs to be done in 3 steps for each pair of functions:
-
-* Create new ``get``/``put`` functions, define the old names as compatibility
-  wrappers
-* Switch over each file/driver using a cocci-generated spatch.
-* Once all users of the old names are gone, remove them.
-
-This way drivers/patches in the progress of getting merged won't break.
-
-Contact: Daniel Vetter
-
 Convert existing KMS drivers to atomic modesetting
 --
 
diff --git a/scripts/coccinelle/api/drm-get-put.cocci 
b/scripts/coccinelle/api/drm-get-put.cocci
deleted file mode 100644
index b51bfaa58b83..
--- a/scripts/coccinelle/api/drm-get-put.cocci
+++ /dev/null
@@ -1,35 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-///
-/// Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and
-/// drm_*_unreference() helpers.
-///
-// Confidence: High
-// Copyright: (C) 2017 NVIDIA Corporation
-// Options: --no-includes --include-headers
-//
-
-virtual patch
-virtual report
-
-@depends on patch@
-expression object;
-@@
-
-(
-)
-
-@r depends on report@
-expression object;
-position p;
-@@
-
-(
-)
-
-@script:python depends on report@
-object << r.object;
-p << r.p;
-@@
-
-msg="WARNING: use get/put helpers to reference and dereference %s" % (object)
-coccilib.report.print_report(p[0], msg)
-- 
2.14.4

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


[PATCH 4/7] drm: Replace __drm_gem_object_unreference with __drm_gem_object_put

2018-06-09 Thread Thomas Zimmermann
This patch unifies the naming of DRM functions for reference counting
of struct drm_gem_object. The resulting code is more aligned with the
rest of the Linux kernel interfaces.

The patch also deletes the old function and removes it from the
Coccinelle script.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/i915/i915_gem_object.h   |  2 +-
 include/drm/drm_gem.h| 13 -
 scripts/coccinelle/api/drm-get-put.cocci |  5 -
 3 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_object.h 
b/drivers/gpu/drm/i915/i915_gem_object.h
index da6e849f41a4..0042496216fe 100644
--- a/drivers/gpu/drm/i915/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/i915_gem_object.h
@@ -345,7 +345,7 @@ __attribute__((nonnull))
 static inline void
 i915_gem_object_put(struct drm_i915_gem_object *obj)
 {
-   __drm_gem_object_unreference(>base);
+   __drm_gem_object_put(>base);
 }
 
 __deprecated
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index 43465aa4eb73..2c3f04e071cf 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -222,19 +222,6 @@ __drm_gem_object_put(struct drm_gem_object *obj)
 void drm_gem_object_put_unlocked(struct drm_gem_object *obj);
 void drm_gem_object_put(struct drm_gem_object *obj);
 
-/**
- * __drm_gem_object_unreference - raw function to release a GEM buffer object
- *reference
- * @obj: GEM buffer object
- *
- * This is a compatibility alias for __drm_gem_object_put() and should not be
- * used by new code.
- */
-static inline void __drm_gem_object_unreference(struct drm_gem_object *obj)
-{
-   __drm_gem_object_put(obj);
-}
-
 /**
  * drm_gem_object_unreference_unlocked - release a GEM buffer object reference
  * @obj: GEM buffer object
diff --git a/scripts/coccinelle/api/drm-get-put.cocci 
b/scripts/coccinelle/api/drm-get-put.cocci
index c37aa5beca77..4a948790b83c 100644
--- a/scripts/coccinelle/api/drm-get-put.cocci
+++ b/scripts/coccinelle/api/drm-get-put.cocci
@@ -16,9 +16,6 @@ expression object;
 @@
 
 (
-- __drm_gem_object_unreference(object)
-+ __drm_gem_object_put(object)
-|
 - drm_gem_object_unreference_unlocked(object)
 + drm_gem_object_put_unlocked(object)
 |
@@ -32,8 +29,6 @@ position p;
 @@
 
 (
-__drm_gem_object_unreference(object)
-|
 drm_gem_object_unreference_unlocked(object)
 |
 drm_dev_unref@p(object)
-- 
2.14.4

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


[PATCH 6/7] drm: Replace drm_dev_unref with drm_dev_put

2018-06-09 Thread Thomas Zimmermann
This patch unifies the naming of DRM functions for reference counting
of struct drm_device. The resulting code is more aligned with the rest
of the Linux kernel interfaces.

The patch also deletes the old function and removes it from the
Coccinelle script.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c|  4 ++--
 drivers/gpu/drm/arc/arcpgu_drv.c   |  8 
 drivers/gpu/drm/armada/armada_drv.c|  6 +++---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c   |  8 
 drivers/gpu/drm/drm_drv.c  | 13 -
 drivers/gpu/drm/etnaviv/etnaviv_drv.c  |  8 
 drivers/gpu/drm/exynos/exynos_drm_drv.c|  4 ++--
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  |  8 
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c|  4 ++--
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c|  8 
 drivers/gpu/drm/i915/selftests/huge_pages.c|  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_context.c  |  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c   |  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_evict.c|  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c  |  2 +-
 drivers/gpu/drm/i915/selftests/i915_gem_object.c   |  2 +-
 drivers/gpu/drm/i915/selftests/i915_request.c  |  2 +-
 drivers/gpu/drm/i915/selftests/i915_vma.c  |  2 +-
 drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c |  2 +-
 drivers/gpu/drm/imx/imx-drm-core.c |  8 
 drivers/gpu/drm/mediatek/mtk_drm_drv.c |  6 +++---
 drivers/gpu/drm/msm/msm_drv.c  |  8 
 drivers/gpu/drm/mxsfb/mxsfb_drv.c  |  4 ++--
 drivers/gpu/drm/nouveau/nouveau_platform.c |  2 +-
 drivers/gpu/drm/omapdrm/omap_drv.c |  4 ++--
 drivers/gpu/drm/pl111/pl111_drv.c  | 14 +++---
 drivers/gpu/drm/qxl/qxl_drv.c  |  2 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c  |  2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c|  4 ++--
 drivers/gpu/drm/shmobile/shmob_drm_drv.c   |  4 ++--
 drivers/gpu/drm/sti/sti_drv.c  |  8 
 drivers/gpu/drm/stm/drv.c  | 10 +-
 drivers/gpu/drm/sun4i/sun4i_drv.c  |  4 ++--
 drivers/gpu/drm/tegra/drm.c|  8 
 drivers/gpu/drm/tinydrm/core/tinydrm-core.c|  6 +++---
 drivers/gpu/drm/tve200/tve200_drv.c| 10 +-
 drivers/gpu/drm/udl/udl_drv.c  |  2 +-
 drivers/gpu/drm/vc4/vc4_drv.c  |  8 
 drivers/gpu/drm/vgem/vgem_drv.c|  2 +-
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c   |  2 +-
 drivers/gpu/drm/zte/zx_drm_drv.c   |  4 ++--
 include/drm/drm_drv.h  |  1 -
 scripts/coccinelle/api/drm-get-put.cocci   |  3 ---
 43 files changed, 99 insertions(+), 116 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index b0bf2f24da48..cf5b18e7d8db 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -664,7 +664,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 err_pci:
pci_disable_device(pdev);
 err_free:
-   drm_dev_unref(dev);
+   drm_dev_put(dev);
return ret;
 }
 
@@ -674,7 +674,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
struct drm_device *dev = pci_get_drvdata(pdev);
 
drm_dev_unregister(dev);
-   drm_dev_unref(dev);
+   drm_dev_put(dev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
 }
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index f067de4e1e82..27d426bf7d01 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -204,7 +204,7 @@ static int arcpgu_probe(struct platform_device *pdev)
 
ret = arcpgu_load(drm);
if (ret)
-   goto err_unref;
+   goto err_put;
 
ret = drm_dev_register(drm, 0);
if (ret)
@@ -215,8 +215,8 @@ static int arcpgu_probe(struct platform_device *pdev)
 err_unload:
arcpgu_unload(drm);
 
-err_unref:
-   drm_dev_unref(drm);
+err_put:
+   drm_dev_put(drm);
 
return ret;
 }
@@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
 
drm_dev_unregister(drm);
arcpgu_unload(drm);
-   drm_dev_unref(drm);
+   drm_dev_put(drm);
 
return 0;
 }
diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index 4b11b6b52f1d..d1705d298a39 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -109,7 +109,7 @@ static int armada_drm_bind(struct device *dev)
 
/*
 * The drm_device structure must be at the start 

[PATCH 3/7] drm: Replace drm_gem_object_{un/reference} with drm_gem_object_{put, get}

2018-06-09 Thread Thomas Zimmermann
This patch unifies the naming of DRM functions for reference counting
of struct drm_gem_object. The resulting code is more aligned with the
rest of the Linux kernel interfaces.

The patch also deletes the old functions and removes them from the
Coccinelle script.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/i915/i915_gem_object.h|  8 +---
 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c |  4 ++--
 drivers/gpu/drm/msm/adreno/a5xx_power.c   |  2 +-
 drivers/gpu/drm/msm/adreno/a5xx_preempt.c |  2 +-
 drivers/gpu/drm/msm/msm_gem_submit.c  |  4 ++--
 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c |  2 +-
 include/drm/drm_gem.h | 24 
 scripts/coccinelle/api/drm-get-put.cocci  | 10 --
 8 files changed, 8 insertions(+), 48 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_object.h 
b/drivers/gpu/drm/i915/i915_gem_object.h
index 54f00b350779..da6e849f41a4 100644
--- a/drivers/gpu/drm/i915/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/i915_gem_object.h
@@ -337,13 +337,10 @@ __attribute__((nonnull))
 static inline struct drm_i915_gem_object *
 i915_gem_object_get(struct drm_i915_gem_object *obj)
 {
-   drm_gem_object_reference(>base);
+   drm_gem_object_get(>base);
return obj;
 }
 
-__deprecated
-extern void drm_gem_object_reference(struct drm_gem_object *);
-
 __attribute__((nonnull))
 static inline void
 i915_gem_object_put(struct drm_i915_gem_object *obj)
@@ -351,9 +348,6 @@ i915_gem_object_put(struct drm_i915_gem_object *obj)
__drm_gem_object_unreference(>base);
 }
 
-__deprecated
-extern void drm_gem_object_unreference(struct drm_gem_object *);
-
 __deprecated
 extern void drm_gem_object_unreference_unlocked(struct drm_gem_object *);
 
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c 
b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
index 059ec7d394d0..d2127b1c4ece 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
@@ -132,14 +132,14 @@ reset_set(void *data, u64 val)
if (a5xx_gpu->pm4_bo) {
if (a5xx_gpu->pm4_iova)
msm_gem_put_iova(a5xx_gpu->pm4_bo, gpu->aspace);
-   drm_gem_object_unreference(a5xx_gpu->pm4_bo);
+   drm_gem_object_put(a5xx_gpu->pm4_bo);
a5xx_gpu->pm4_bo = NULL;
}
 
if (a5xx_gpu->pfp_bo) {
if (a5xx_gpu->pfp_iova)
msm_gem_put_iova(a5xx_gpu->pfp_bo, gpu->aspace);
-   drm_gem_object_unreference(a5xx_gpu->pfp_bo);
+   drm_gem_object_put(a5xx_gpu->pfp_bo);
a5xx_gpu->pfp_bo = NULL;
}
 
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_power.c 
b/drivers/gpu/drm/msm/adreno/a5xx_power.c
index e9c0e56dbec0..7a41e1c147e4 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_power.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_power.c
@@ -323,7 +323,7 @@ void a5xx_gpmu_ucode_init(struct msm_gpu *gpu)
if (a5xx_gpu->gpmu_iova)
msm_gem_put_iova(a5xx_gpu->gpmu_bo, gpu->aspace);
if (a5xx_gpu->gpmu_bo)
-   drm_gem_object_unreference(a5xx_gpu->gpmu_bo);
+   drm_gem_object_put(a5xx_gpu->gpmu_bo);
 
a5xx_gpu->gpmu_bo = NULL;
a5xx_gpu->gpmu_iova = 0;
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c 
b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c
index 970c7963ae29..f3c21f827a4d 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c
@@ -272,7 +272,7 @@ void a5xx_preempt_fini(struct msm_gpu *gpu)
if (a5xx_gpu->preempt_iova[i])
msm_gem_put_iova(a5xx_gpu->preempt_bo[i], gpu->aspace);
 
-   drm_gem_object_unreference(a5xx_gpu->preempt_bo[i]);
+   drm_gem_object_put(a5xx_gpu->preempt_bo[i]);
a5xx_gpu->preempt_bo[i] = NULL;
}
 }
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c 
b/drivers/gpu/drm/msm/msm_gem_submit.c
index 7bd83e0afa97..7a7923e6220d 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -144,7 +144,7 @@ static int submit_lookup_objects(struct msm_gem_submit 
*submit,
goto out_unlock;
}
 
-   drm_gem_object_reference(obj);
+   drm_gem_object_get(obj);
 
submit->bos[i].obj = msm_obj;
 
@@ -396,7 +396,7 @@ static void submit_cleanup(struct msm_gem_submit *submit)
struct msm_gem_object *msm_obj = submit->bos[i].obj;
submit_unlock_unpin_bo(submit, i, false);
list_del_init(_obj->submit_entry);
-   drm_gem_object_unreference(_obj->base);
+   drm_gem_object_put(_obj->base);
}
 
ww_acquire_fini(>ticket);
diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c 
b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
index 8e41d649e248..1a73c9887cd3 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
+++ 

[PATCH 5/7] drm: Replace drm_gem_object_unreference_unlocked with put function

2018-06-09 Thread Thomas Zimmermann
This patch unifies the naming of DRM functions for reference counting
of struct drm_gem_object. The resulting code is more aligned with the
rest of the Linux kernel interfaces.

The patch also deletes the old function and removes it from the
Coccinelle script.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/bochs/bochs_fbdev.c   |  2 +-
 drivers/gpu/drm/bochs/bochs_mm.c  | 10 +-
 drivers/gpu/drm/exynos/exynos_drm_fb.c|  2 +-
 drivers/gpu/drm/exynos/exynos_drm_gem.c   | 10 +-
 drivers/gpu/drm/gma500/framebuffer.c  |  2 +-
 drivers/gpu/drm/gma500/gem.c  |  2 +-
 drivers/gpu/drm/gma500/gma_display.c  |  6 +++---
 drivers/gpu/drm/i915/i915_gem_object.h|  3 ---
 drivers/gpu/drm/nouveau/dispnv04/crtc.c   |  2 +-
 drivers/gpu/drm/nouveau/nouveau_abi16.c   |  2 +-
 drivers/gpu/drm/nouveau/nouveau_display.c |  8 
 drivers/gpu/drm/nouveau/nouveau_gem.c | 14 +++---
 drivers/gpu/drm/omapdrm/omap_drv.c|  2 +-
 drivers/gpu/drm/omapdrm/omap_fb.c |  2 +-
 drivers/gpu/drm/omapdrm/omap_fbdev.c  |  2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c|  4 ++--
 include/drm/drm_gem.h | 13 -
 scripts/coccinelle/api/drm-get-put.cocci  |  5 -
 18 files changed, 35 insertions(+), 56 deletions(-)

diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c 
b/drivers/gpu/drm/bochs/bochs_fbdev.c
index 14eb8d0d5a00..6f0cf363371d 100644
--- a/drivers/gpu/drm/bochs/bochs_fbdev.c
+++ b/drivers/gpu/drm/bochs/bochs_fbdev.c
@@ -144,7 +144,7 @@ static int bochs_fbdev_destroy(struct bochs_device *bochs)
drm_fb_helper_unregister_fbi(>fb.helper);
 
if (gfb->obj) {
-   drm_gem_object_unreference_unlocked(gfb->obj);
+   drm_gem_object_put_unlocked(gfb->obj);
gfb->obj = NULL;
}
 
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
index 39cd08416773..032f418e407d 100644
--- a/drivers/gpu/drm/bochs/bochs_mm.c
+++ b/drivers/gpu/drm/bochs/bochs_mm.c
@@ -414,7 +414,7 @@ int bochs_dumb_create(struct drm_file *file, struct 
drm_device *dev,
return ret;
 
ret = drm_gem_handle_create(file, gobj, );
-   drm_gem_object_unreference_unlocked(gobj);
+   drm_gem_object_put_unlocked(gobj);
if (ret)
return ret;
 
@@ -454,7 +454,7 @@ int bochs_dumb_mmap_offset(struct drm_file *file, struct 
drm_device *dev,
bo = gem_to_bochs_bo(obj);
*offset = bochs_bo_mmap_offset(bo);
 
-   drm_gem_object_unreference_unlocked(obj);
+   drm_gem_object_put_unlocked(obj);
return 0;
 }
 
@@ -464,7 +464,7 @@ static void bochs_user_framebuffer_destroy(struct 
drm_framebuffer *fb)
 {
struct bochs_framebuffer *bochs_fb = to_bochs_framebuffer(fb);
 
-   drm_gem_object_unreference_unlocked(bochs_fb->obj);
+   drm_gem_object_put_unlocked(bochs_fb->obj);
drm_framebuffer_cleanup(fb);
kfree(fb);
 }
@@ -515,13 +515,13 @@ bochs_user_framebuffer_create(struct drm_device *dev,
 
bochs_fb = kzalloc(sizeof(*bochs_fb), GFP_KERNEL);
if (!bochs_fb) {
-   drm_gem_object_unreference_unlocked(obj);
+   drm_gem_object_put_unlocked(obj);
return ERR_PTR(-ENOMEM);
}
 
ret = bochs_framebuffer_init(dev, bochs_fb, mode_cmd, obj);
if (ret) {
-   drm_gem_object_unreference_unlocked(obj);
+   drm_gem_object_put_unlocked(obj);
kfree(bochs_fb);
return ERR_PTR(ret);
}
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c 
b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index 7fcc1a7ab1a0..27b7d34d776c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -138,7 +138,7 @@ exynos_user_fb_create(struct drm_device *dev, struct 
drm_file *file_priv,
 
 err:
while (i--)
-   drm_gem_object_unreference_unlocked(_gem[i]->base);
+   drm_gem_object_put_unlocked(_gem[i]->base);
 
return ERR_PTR(ret);
 }
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c 
b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 6e1494fa71b4..bdf5a7655228 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -143,7 +143,7 @@ static int exynos_drm_gem_handle_create(struct 
drm_gem_object *obj,
DRM_DEBUG_KMS("gem handle = 0x%x\n", *handle);
 
/* drop reference from allocate - handle holds it now. */
-   drm_gem_object_unreference_unlocked(obj);
+   drm_gem_object_put_unlocked(obj);
 
return 0;
 }
@@ -186,7 +186,7 @@ unsigned long exynos_drm_gem_get_size(struct drm_device 
*dev,
 
exynos_gem = to_exynos_gem(obj);
 
-   drm_gem_object_unreference_unlocked(obj);
+   drm_gem_object_put_unlocked(obj);
 
return exynos_gem->size;
 }
@@ -329,13 +329,13 @@ void exynos_drm_gem_put_dma_addr(struct drm_device *dev,
  

[PATCH 1/7] drm: Replace drm_connector_{un/reference} with drm_connector_{put, get}

2018-06-09 Thread Thomas Zimmermann
This patch unifies the naming of DRM functions for reference counting
of struct drm_connector. The resulting code is more aligned with the
rest of the Linux kernel interfaces.

The patch also deletes the old functions and removes them from the
Coccinelle script.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/i915/intel_display.c |  4 ++--
 drivers/gpu/drm/i915/intel_dp_mst.c  |  2 +-
 drivers/gpu/drm/nouveau/dispnv50/disp.c  |  2 +-
 include/drm/drm_connector.h  | 24 
 scripts/coccinelle/api/drm-get-put.cocci | 10 --
 5 files changed, 4 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index ed29219b1676..94f4794ab965 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10691,7 +10691,7 @@ static void 
intel_modeset_update_connector_atomic_state(struct drm_device *dev)
drm_connector_list_iter_begin(dev, _iter);
for_each_intel_connector_iter(connector, _iter) {
if (connector->base.state->crtc)
-   drm_connector_unreference(>base);
+   drm_connector_put(>base);
 
if (connector->base.encoder) {
connector->base.state->best_encoder =
@@ -10699,7 +10699,7 @@ static void 
intel_modeset_update_connector_atomic_state(struct drm_device *dev)
connector->base.state->crtc =
connector->base.encoder->crtc;
 
-   drm_connector_reference(>base);
+   drm_connector_get(>base);
} else {
connector->base.state->best_encoder = NULL;
connector->base.state->crtc = NULL;
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c 
b/drivers/gpu/drm/i915/intel_dp_mst.c
index 9e6956c08688..b8c12b0f 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -518,7 +518,7 @@ static void intel_dp_destroy_mst_connector(struct 
drm_dp_mst_topology_mgr *mgr,
intel_connector->mst_port = NULL;
drm_modeset_unlock(>dev->mode_config.connection_mutex);
 
-   drm_connector_unreference(connector);
+   drm_connector_put(connector);
 }
 
 static void intel_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c 
b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index b83465ae7c1b..1f8bba8f6528 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -1007,7 +1007,7 @@ nv50_mstm_destroy_connector(struct 
drm_dp_mst_topology_mgr *mgr,
mstc->port = NULL;
drm_modeset_unlock(>dev->mode_config.connection_mutex);
 
-   drm_connector_unreference(>connector);
+   drm_connector_put(>connector);
 }
 
 static void
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index ee4c48218c85..28f2997063bf 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1059,30 +1059,6 @@ static inline void drm_connector_put(struct 
drm_connector *connector)
drm_mode_object_put(>base);
 }
 
-/**
- * drm_connector_reference - acquire a connector reference
- * @connector: DRM connector
- *
- * This is a compatibility alias for drm_connector_get() and should not be
- * used by new code.
- */
-static inline void drm_connector_reference(struct drm_connector *connector)
-{
-   drm_connector_get(connector);
-}
-
-/**
- * drm_connector_unreference - release a connector reference
- * @connector: DRM connector
- *
- * This is a compatibility alias for drm_connector_put() and should not be
- * used by new code.
- */
-static inline void drm_connector_unreference(struct drm_connector *connector)
-{
-   drm_connector_put(connector);
-}
-
 const char *drm_get_connector_status_name(enum drm_connector_status status);
 const char *drm_get_subpixel_order_name(enum subpixel_order order);
 const char *drm_get_dpms_name(int val);
diff --git a/scripts/coccinelle/api/drm-get-put.cocci 
b/scripts/coccinelle/api/drm-get-put.cocci
index 3a09c97ad87d..1b1c5344b07f 100644
--- a/scripts/coccinelle/api/drm-get-put.cocci
+++ b/scripts/coccinelle/api/drm-get-put.cocci
@@ -16,12 +16,6 @@ expression object;
 @@
 
 (
-- drm_connector_reference(object)
-+ drm_connector_get(object)
-|
-- drm_connector_unreference(object)
-+ drm_connector_put(object)
-|
 - drm_framebuffer_reference(object)
 + drm_framebuffer_get(object)
 |
@@ -50,10 +44,6 @@ position p;
 @@
 
 (
-drm_connector_unreference@p(object)
-|
-drm_connector_reference@p(object)
-|
 drm_framebuffer_unreference@p(object)
 |
 drm_framebuffer_reference@p(object)
-- 
2.14.4

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


[PATCH 2/7] drm: Replace drm_framebuffer_{un/reference} with drm_framebuffer_{put, get}

2018-06-09 Thread Thomas Zimmermann
This patch unifies the naming of DRM functions for reference counting
of struct drm_framebuffer. The resulting code is more aligned with the
rest of the Linux kernel interfaces.

The patch also deletes the old functions and removes them from the
Coccinelle script.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/armada/armada_crtc.c   |  8 
 drivers/gpu/drm/armada/armada_overlay.c|  2 +-
 drivers/gpu/drm/exynos/exynos_drm_plane.c  |  2 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c |  4 ++--
 drivers/gpu/drm/nouveau/nouveau_fbcon.c|  2 +-
 include/drm/drm_framebuffer.h  | 24 
 scripts/coccinelle/api/drm-get-put.cocci   | 10 --
 7 files changed, 9 insertions(+), 43 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_crtc.c 
b/drivers/gpu/drm/armada/armada_crtc.c
index 0311dd5b..38724b554a54 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -1220,7 +1220,7 @@ static int armada_drm_primary_update(struct drm_plane 
*plane,
 * Take a reference on the new framebuffer - we want to
 * hold on to it while the hardware is displaying it.
 */
-   drm_framebuffer_reference(fb);
+   drm_framebuffer_get(fb);
 
work->old_fb = plane->fb;
} else {
@@ -1239,7 +1239,7 @@ static int armada_drm_primary_update(struct drm_plane 
*plane,
if (!dplane->state.vsync_update) {
work->fn(dcrtc, work);
if (work->old_fb)
-   drm_framebuffer_unreference(work->old_fb);
+   drm_framebuffer_put(work->old_fb);
return 0;
}
 
@@ -1248,7 +1248,7 @@ static int armada_drm_primary_update(struct drm_plane 
*plane,
if (ret) {
work->fn(dcrtc, work);
if (work->old_fb)
-   drm_framebuffer_unreference(work->old_fb);
+   drm_framebuffer_put(work->old_fb);
}
 
dplane->next_work = !dplane->next_work;
@@ -1308,7 +1308,7 @@ int armada_drm_plane_disable(struct drm_plane *plane,
if (armada_drm_plane_work_queue(dcrtc, work)) {
work->fn(dcrtc, work);
if (work->old_fb)
-   drm_framebuffer_unreference(work->old_fb);
+   drm_framebuffer_put(work->old_fb);
}
 
dplane->next_work = !dplane->next_work;
diff --git a/drivers/gpu/drm/armada/armada_overlay.c 
b/drivers/gpu/drm/armada/armada_overlay.c
index c391955009d6..bb2874d84d74 100644
--- a/drivers/gpu/drm/armada/armada_overlay.c
+++ b/drivers/gpu/drm/armada/armada_overlay.c
@@ -228,7 +228,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct 
drm_crtc *crtc,
 * Take a reference on the new framebuffer - we want to
 * hold on to it while the hardware is displaying it.
 */
-   drm_framebuffer_reference(fb);
+   drm_framebuffer_get(fb);
 
work->old_fb = plane->fb;
} else {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c 
b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index 38a2a7f1204b..7098c6d35266 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -132,7 +132,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane)
if (plane->state) {
exynos_state = to_exynos_plane_state(plane->state);
if (exynos_state->base.fb)
-   drm_framebuffer_unreference(exynos_state->base.fb);
+   drm_framebuffer_put(exynos_state->base.fb);
kfree(exynos_state);
plane->state = NULL;
}
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c 
b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
index 36aa1738b67a..96af796abc05 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
@@ -185,7 +185,7 @@ static void mdp5_plane_reset(struct drm_plane *plane)
struct mdp5_plane_state *mdp5_state;
 
if (plane->state && plane->state->fb)
-   drm_framebuffer_unreference(plane->state->fb);
+   drm_framebuffer_put(plane->state->fb);
 
kfree(to_mdp5_plane_state(plane->state));
mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
@@ -228,7 +228,7 @@ static void mdp5_plane_destroy_state(struct drm_plane 
*plane,
struct mdp5_plane_state *pstate = to_mdp5_plane_state(state);
 
if (state->fb)
-   drm_framebuffer_unreference(state->fb);
+   drm_framebuffer_put(state->fb);
 
kfree(pstate);
 }
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c 
b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index 85c1f10bc2b6..844498c4267c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -429,7 +429,7 

[Bug 106870] [Raven Ridge occasionally hangs] VM_L2_PROTECTION_FAULT_STATUS:0x00000000

2018-06-09 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106870

Bug ID: 106870
   Summary: [Raven Ridge occasionally hangs]
VM_L2_PROTECTION_FAULT_STATUS:0x
   Product: DRI
   Version: DRI git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: zapd...@gmail.com

Created attachment 140109
  --> https://bugs.freedesktop.org/attachment.cgi?id=140109=edit
Freeze before launching android emulator

X become unresponsive occasionally during the day, it usually happens before
launching applications but it's not reproducible constantly, it also happens
while browsing in Firefox. I have attached the log when it happened before
launching the android emulator (amdgpu.vm_debug was set to true to show the
stack trace). I can reboot the machine with a sysRq but everything graphical is
freeze. Sometime it says gfxhub others mmhub.
Ubuntu 18.04, Kernel is 4.17 from the kernel-ppa, asrock ab350m pro4 updated to
the latest test firmware with AGESA 1.0.0.3b to see if it fixed the problem but
still happens, mesa stack from the oibaf ppa, with padoka it seems the error
appears less frequently and the error is usually silent and can only see this
"[drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout, last signaled
seq=453604"

-- 
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 106427] RX560, 5k@60Hz, Xorg: Black screen, “soft” kernel lockup

2018-06-09 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106427

--- Comment #6 from txtoxtox...@googlemail.com ---
Still present with kernel 4.17.0, xorg amdgpu 18.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 199959] amdgpu, regression?: system freezes after resume

2018-06-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=199959

--- Comment #13 from Christian König (christian.koe...@amd.com) ---
(In reply to Alexander Mezin from comment #11)
> I literally have no idea what I'm doing, but adding
> 'amdgpu_device_resize_fb_bar(adev);' line to all 'gmc_v?_?_resume()'
> (because I don't know which version is used for my card) "fixed" it somehow.
> Resume works, but there are some artifacts on screen during resume (they
> flash only once and then disappear). Before 'amdgpu_device_resize_fb_bar'
> was introduced, there were no artifacts at all.

Hehe, yeah that was a really nice test and confirms my suspicion on what's
going wrong here.

Because you tried to resize the BAR once more after resume the resources in the
address space are freed up and allocated again:
[  212.484672] amdgpu :65:00.0: BAR 2: releasing [mem
0xe2-0xe2001f 64bit pref]
[  212.484673] amdgpu :65:00.0: BAR 0: releasing [mem
0xe0-0xe1 64bit pref]
[  212.484683] pcieport :64:00.0: BAR 15: releasing [mem
0xe0-0xe2 64bit pref]

[  212.484691] pcieport :64:00.0: BAR 15: assigned [mem
0xe0-0xe2 64bit pref]
[  212.484692] amdgpu :65:00.0: BAR 0: assigned [mem
0xe0-0xe1 64bit pref]
[  212.484697] amdgpu :65:00.0: BAR 2: assigned [mem
0xe2-0xe2001f 64bit pref]

Since it allocates the exact same address we freed up before the real issue is
not the address itself, but that fact that the hardware config isn't saved
during suspend/resume.

That strongly looks like a bug in the BIOS and/or the Linux PCI subsystem
driver for Intel hardware to me.

I will try to narrow this down with a few patches on Monday, but don't expect
any quick fix.

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