Re: [Intel-gfx] [PATCH 1/5] drm: report dp downstream port type as a subconnector property

2020-04-03 Thread Jeevan B
On 2020-04-01 at 16:03:46 +0300, Ville Syrjälä wrote:
> On Wed, Apr 01, 2020 at 05:42:24PM +0530, Jeevan B wrote:
> > Currently, downstream port type is only reported in debugfs. This
> > information should be considered important since it reflects the actual
> > physical connector type. Some userspace (e.g. window compositors)
> > may want to show this info to a user.
> > 
> > The 'subconnector' property is already utilized for DVI-I and TV-out for
> > reporting connector subtype.
> > 
> > The initial motivation for this feature came from i2c test [1].
> > It is supposed to be skipped on VGA connectors, but it cannot
> > detect VGA over DP and fails instead.
> > 
> > v2:
> >  - Ville: utilized drm_dp_is_branch()
> >  - Ville: implement DP 1.0 downstream type info
> >  - Replaced create_dp_properties with add_dp_subconnector_property
> >  - Added dp_set_subconnector_property helper
> > 
> > v4:
> >  - Ville: add DP1.0 best assumption about subconnector
> >  - Ville: assume DVI is DVI-D
> >  - Ville: reuse Writeback enum value for Virtual subconnector
> >  - Renamed #defines: HDMI -> HDMIA, DP -> DisplayPort
> > 
> > [1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
> > 
> > Reviewed-by: Emil Velikov 
> > Signed-off-by: Oleg Vasilev 
> 
> Is this Oleg's patch? If so why did you change the patch author to be
> yourself?
>
it happened unintentionally i will update and resend the series to list  

Thanks
Jeevan B 
> > Cc: Ville Syrjälä 
> > Cc: intel-gfx@lists.freedesktop.org
> > Signed-off-by: Jeevan B 
> > Link: 
> > https://patchwork.freedesktop.org/patch/msgid/20190829114854.1539-3-oleg.vasi...@intel.com
> > ---
> >  drivers/gpu/drm/drm_connector.c | 49 --
> >  drivers/gpu/drm/drm_dp_helper.c | 77 
> > +
> >  include/drm/drm_connector.h |  3 ++
> >  include/drm/drm_dp_helper.h |  8 +
> >  include/drm/drm_mode_config.h   |  6 
> >  include/uapi/drm/drm_mode.h | 21 ++-
> >  6 files changed, 154 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_connector.c 
> > b/drivers/gpu/drm/drm_connector.c
> > index b1099e1..b6972d1 100644
> > --- a/drivers/gpu/drm/drm_connector.c
> > +++ b/drivers/gpu/drm/drm_connector.c
> > @@ -844,7 +844,7 @@ static const struct drm_prop_enum_list 
> > drm_dvi_i_select_enum_list[] = {
> >  DRM_ENUM_NAME_FN(drm_get_dvi_i_select_name, drm_dvi_i_select_enum_list)
> >  
> >  static const struct drm_prop_enum_list drm_dvi_i_subconnector_enum_list[] 
> > = {
> > -   { DRM_MODE_SUBCONNECTOR_Unknown,   "Unknown"   }, /* DVI-I and TV-out */
> > +   { DRM_MODE_SUBCONNECTOR_Unknown,   "Unknown"   }, /* DVI-I, TV-out and 
> > DP */
> > { DRM_MODE_SUBCONNECTOR_DVID,  "DVI-D" }, /* DVI-I  */
> > { DRM_MODE_SUBCONNECTOR_DVIA,  "DVI-A" }, /* DVI-I  */
> >  };
> > @@ -861,7 +861,7 @@ static const struct drm_prop_enum_list 
> > drm_tv_select_enum_list[] = {
> >  DRM_ENUM_NAME_FN(drm_get_tv_select_name, drm_tv_select_enum_list)
> >  
> >  static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = {
> > -   { DRM_MODE_SUBCONNECTOR_Unknown,   "Unknown"   }, /* DVI-I and TV-out */
> > +   { DRM_MODE_SUBCONNECTOR_Unknown,   "Unknown"   }, /* DVI-I, TV-out and 
> > DP */
> > { DRM_MODE_SUBCONNECTOR_Composite, "Composite" }, /* TV-out */
> > { DRM_MODE_SUBCONNECTOR_SVIDEO,"SVIDEO"}, /* TV-out */
> > { DRM_MODE_SUBCONNECTOR_Component, "Component" }, /* TV-out */
> > @@ -870,6 +870,19 @@ static const struct drm_prop_enum_list 
> > drm_tv_subconnector_enum_list[] = {
> >  DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name,
> >  drm_tv_subconnector_enum_list)
> >  
> > +static const struct drm_prop_enum_list drm_dp_subconnector_enum_list[] = {
> > +   { DRM_MODE_SUBCONNECTOR_Unknown, "Unknown"   }, /* DVI-I, TV-out 
> > and DP */
> > +   { DRM_MODE_SUBCONNECTOR_VGA, "VGA"   }, /* DP */
> > +   { DRM_MODE_SUBCONNECTOR_DVID,"DVI-D" }, /* DP */
> > +   { DRM_MODE_SUBCONNECTOR_HDMIA,   "HDMI"  }, /* DP */
> > +   { DRM_MODE_SUBCONNECTOR_DisplayPort, "DP"}, /* DP */
> > +   { DRM_MODE_SUBCONNECTOR_Wireless,"Wireless"  }, /* DP */
> > +   { DRM_MODE_SUBCONNECTOR_Native,  "Native"}, /* DP */
> > +};
> > +
> > +DRM_ENUM_NAME_FN(drm_get_dp_subconnector_name,
> > +drm_dp_subconnector_enum_list)
> > +
> >  static const struct drm_prop_enum_list hdmi_colorspaces[] = {
> > /* For Default case, driver will set the colorspace */
> > { DRM_MODE_COLORIMETRY_DEFAULT, "Default" },
> > @@ -1186,6 +1199,14 @@ static const struct drm_prop_enum_list 
> > dp_colorspaces[] = {
> >   * can also expose this property to external outputs, in which case they
> >   * must support "None", which should be the default (since external screens
> >   * have a built-in scaler).
> > + *
> > + * subconnector:
> > + * This property is used by DVI-I, TVout and DisplayPort to indicate 
> > differe

[Intel-gfx] ✓ Fi.CI.BAT: success for SAGV support for Gen12+ (rev10)

2020-04-03 Thread Patchwork
== Series Details ==

Series: SAGV support for Gen12+ (rev10)
URL   : https://patchwork.freedesktop.org/series/75129/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8243 -> Patchwork_17194


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17194/index.html

Possible new issues
---

  Here are the unknown changes that may have been introduced in Patchwork_17194:

### IGT changes ###

 Suppressed 

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * {igt@gem_wait@busy@all}:
- fi-gdg-551: [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-gdg-551/igt@gem_wait@b...@all.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17194/fi-gdg-551/igt@gem_wait@b...@all.html

  
Known issues


  Here are the changes found in Patchwork_17194 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@kms_chamelium@dp-crc-fast:
- fi-cml-u2:  [PASS][3] -> [FAIL][4] ([i915#262])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-cml-u2/igt@kms_chamel...@dp-crc-fast.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17194/fi-cml-u2/igt@kms_chamel...@dp-crc-fast.html

  
 Possible fixes 

  * igt@i915_pm_rpm@module-reload:
- fi-icl-dsi: [INCOMPLETE][5] ([i915#189]) -> [PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-icl-dsi/igt@i915_pm_...@module-reload.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17194/fi-icl-dsi/igt@i915_pm_...@module-reload.html

  * igt@i915_selftest@live@execlists:
- fi-bxt-dsi: [INCOMPLETE][7] ([i915#656]) -> [PASS][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-bxt-dsi/igt@i915_selftest@l...@execlists.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17194/fi-bxt-dsi/igt@i915_selftest@l...@execlists.html

  
  {name}: This element is suppressed. This means it is ignored when computing
  the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#189]: https://gitlab.freedesktop.org/drm/intel/issues/189
  [i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656


Participating hosts (41 -> 38)
--

  Additional (4): fi-cfl-8109u fi-byt-n2820 fi-bwr-2160 fi-snb-2520m 
  Missing(7): fi-hsw-4200u fi-byt-j1900 fi-byt-squawks fi-bsw-cyan 
fi-kbl-7500u fi-byt-clapper fi-bdw-samus 


Build changes
-

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_8243 -> Patchwork_17194

  CI-20190529: 20190529
  CI_DRM_8243: 45ccb1b8606b6ba1a5d4f8a8b4dda27bd8dbb04c @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5560: 213062c7dcf0cbc8069cbb5f91acbc494def33fd @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_17194: 1ba579e5a9a2d41717a5666c74ed5444f2c6b73f @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

1ba579e5a9a2 drm/i915: Enable SAGV support for Gen12
9e821cd38de0 drm/i915: Restrict qgv points which don't have enough bandwidth.
ff752f1ff8c0 drm/i915: Rename bw_state to new_bw_state
239a48d2167c drm/i915: Added required new PCode commands
0e0085943e7f drm/i915: Add proper SAGV support for TGL+
cd2178aba4dc drm/i915: Extract gen specific functions from intel_can_enable_sagv
5fc52d157ac3 drm/i915: Add intel_atomic_get_bw_*_state helpers
94034283d7ed drm/i915: Introduce skl_plane_wm_level accessor.
a35112134535 drm/i915: Eliminate magic numbers "0" and "1" from color plane
39ffd9923dd5 drm/i915: Start passing latency as parameter

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17194/index.html
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Avoid setting timer->expires to 0

2020-04-03 Thread Chris Wilson
We use timer->expires == 0 to detect if a timer had been cancelled, but
it's a valid expiration we could set. Just skip using 0 and set the
expiry for the next jiffie.

Signed-off-by: Chris Wilson 
---
 drivers/gpu/drm/i915/i915_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_utils.c 
b/drivers/gpu/drm/i915/i915_utils.c
index 029854ae65fc..9769d278e800 100644
--- a/drivers/gpu/drm/i915/i915_utils.c
+++ b/drivers/gpu/drm/i915/i915_utils.c
@@ -101,5 +101,5 @@ void set_timer_ms(struct timer_list *t, unsigned long 
timeout)
 */
barrier();
 
-   mod_timer(t, jiffies + timeout);
+   mod_timer(t, jiffies + timeout ?: 1);
 }
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] 5.7-rc0: hangs while attempting to run X

2020-04-03 Thread Pavel Machek
Hi!

> > Hardware is thinkpad x220. I had this crash few days ago. And today I
> > have similar-looking one, with slightly newer kernel. (Will post
> > as a follow-up).

As part of quest for working system, I tried 5.7-rc0, based on

Merge: 50a5de895dbe b4d8ddf8356d
Author: Linus Torvalds 
Date:   Wed Apr 1 18:18:18 2020 -0700

It hangs in userspace, at a time when X should be starting, and I'm
looking at blinking cursor.

5.6-rcs worked, I'll test 5.6-final.

Best regards,

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for i915 lpsp support for lpsp igt (rev6)

2020-04-03 Thread Vudum, Lakshminarayana
New test igt@i915_pm_lpsp@non-edp-lpsp is not yet available in CI bug log. So, 
I can't create a filter for this skip yet. Otherwise other issues are 
addressed. 
Yesterday I have re-reported after addressing the issues but due to long queue 
results are not yet updated.

Lakshmi.
-Original Message-
From: Gupta, Anshuman  
Sent: Thursday, April 2, 2020 12:07 PM
To: Vudum, Lakshminarayana 
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: ✗ Fi.CI.IGT: failure for i915 lpsp support for lpsp igt (rev6)

On 2020-04-01 at 14:17:33 +, Patchwork wrote:
> == Series Details ==
> 
> Series: i915 lpsp support for lpsp igt (rev6)
> URL   : https://patchwork.freedesktop.org/series/74648/
> State : failure
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_8228_full -> Patchwork_17155_full 
> 
> 
> Summary
> ---
> 
>   **FAILURE**
> 
>   Serious unknown changes coming with Patchwork_17155_full absolutely need to 
> be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_17155_full, please notify your bug team to allow 
> them
>   to document this new failure mode, which will reduce false positives in CI.
> 
>   
> 
> Possible new issues
> ---
> 
>   Here are the unknown changes that may have been introduced in 
> Patchwork_17155_full:
>
Hi Lakshmi , 
> ### IGT changes ###
> 
>  Possible regressions 
> 
>   * {igt@i915_pm_lpsp@non-edp-lpsp} (NEW):
> - shard-tglb: NOTRUN -> [SKIP][1]
>[1]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-tglb1/igt@i915_pm_l...@non-edp-lpsp.html
> - shard-iclb: NOTRUN -> [SKIP][2]
>[2]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb6/i
> gt@i915_pm_l...@non-edp-lpsp.html

Above are new test and valid skip since there is no non-edp panel, could we 
filter these as valid skip.
Test requirement: valid_output
No valid output found
> 
>   * igt@i915_pm_rpm@fences-dpms:
> - shard-tglb: [PASS][3] -> [SKIP][4] +1 similar issue
>[3]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-tglb6/igt@i915_pm_...@fences-dpms.html
>[4]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-tglb6/i
> gt@i915_pm_...@fences-dpms.html
> 
>   * igt@i915_pm_rpm@modeset-lpsp-stress-no-wait:
> - shard-iclb: [PASS][5] -> [SKIP][6] +1 similar issue
>[5]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb3/igt@i915_pm_...@modeset-lpsp-stress-no-wait.html
>[6]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb7/i
> gt@i915_pm_...@modeset-lpsp-stress-no-wait.html
Above two test fails due to runtime-pm was actvie
"(i915_pm_rpm:2380) igt_pm-WARNING: timeout: pm_status expected:suspended, 
got:active"
Could u please check if there is any known issue, if it is not known issue 
probably we need to file bug for these.
> 
>   * igt@runner@aborted:
> - shard-tglb: NOTRUN -> [FAIL][7]
>[7]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-tglb1/i
> gt@run...@aborted.html
Above failure is due to below WARN_ON in 
kms_vblank@pipe-D-ts-continuation-suspend
<7>[  500.119918] [IGT] kms_vblank: starting subtest 
pipe-D-ts-continuation-suspend
-
<4>[  501.899229] [ cut here ] <4>[  501.899232] i915 
raw-wakerefs=1 wakelocks=1 on cleanup <4>[  501.899280] WARNING: CPU: 7 PID: 
2600 at drivers/gpu/drm/i915/intel_runtime_pm.c:602 
intel_runtime_pm_driver_release+0x27/0x40 [i915] Is above WARN_ON a known issue.
Thanks ,
Anshuman Gupta
> 
>   
>  Warnings 
> 
>   * igt@i915_pm_lpsp@screens-disabled:
> - shard-snb:  [SKIP][8] ([fdo#109271]) -> [FAIL][9]
>[8]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-snb2/igt@i915_pm_l...@screens-disabled.html
>[9]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-snb4/ig
> t@i915_pm_l...@screens-disabled.html
> 
>   
>  Suppressed 
> 
>   The following results come from untrusted machines, tests, or statuses.
>   They do not affect the overall result.
> 
>   * {igt@kms_plane_alpha_blend@pipe-b-alpha-transparent-fb}:
> - shard-glk:  NOTRUN -> [FAIL][10]
>[10]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-glk7/igt@kms_plane_alpha_bl...@pipe-b-alpha-transparent-fb.html
> - shard-skl:  NOTRUN -> [FAIL][11]
>[11]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-skl9/ig
> t@kms_plane_alpha_bl...@pipe-b-alpha-transparent-fb.html
> 
>   
> New tests
> -
> 
>   New tests have been introduced between CI_DRM_8228_full and 
> Patchwork_17155_full:
> 
> ### New IGT tests (2) ###
> 
>   * igt@gem_exec_capture@capture:
> - Statuses :
> - Exec time: [None] s
> 
>   * igt@i915_pm_lpsp@non

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Avoid setting timer->expires to 0

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915: Avoid setting timer->expires to 0
URL   : https://patchwork.freedesktop.org/series/75447/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8243 -> Patchwork_17195


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17195/index.html

Known issues


  Here are the changes found in Patchwork_17195 that come from known issues:

### IGT changes ###

 Possible fixes 

  * igt@i915_pm_rpm@module-reload:
- fi-icl-dsi: [INCOMPLETE][1] ([i915#189]) -> [PASS][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-icl-dsi/igt@i915_pm_...@module-reload.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17195/fi-icl-dsi/igt@i915_pm_...@module-reload.html

  * igt@i915_selftest@live@execlists:
- fi-bxt-dsi: [INCOMPLETE][3] ([i915#656]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-bxt-dsi/igt@i915_selftest@l...@execlists.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17195/fi-bxt-dsi/igt@i915_selftest@l...@execlists.html

  
  [i915#189]: https://gitlab.freedesktop.org/drm/intel/issues/189
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656


Participating hosts (41 -> 38)
--

  Additional (5): fi-skl-6770hq fi-bwr-2160 fi-ivb-3770 fi-skl-lmem 
fi-byt-n2820 
  Missing(8): fi-hsw-4200u fi-hsw-peppy fi-byt-squawks fi-bsw-cyan 
fi-bsw-kefka fi-byt-clapper fi-bsw-nick fi-bdw-samus 


Build changes
-

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_8243 -> Patchwork_17195

  CI-20190529: 20190529
  CI_DRM_8243: 45ccb1b8606b6ba1a5d4f8a8b4dda27bd8dbb04c @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5560: 213062c7dcf0cbc8069cbb5f91acbc494def33fd @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_17195: 9001132185073e70b7bcdfee5689aeb8d519a79a @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

900113218507 drm/i915: Avoid setting timer->expires to 0

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17195/index.html
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [CI] drm/i915: Check current i915_vma.pin_count status first on unbind

2020-04-03 Thread Chris Wilson
Do an early rejection of a i915_vma_unbind() attempt if the i915_vma is
currently pinned, without waiting to see if the inflight operations may
unpin it. We see this problem with the shrinker trying to unbind the
active vma from inside its bind worker:

<6> [472.618968] Workqueue: events_unbound fence_work [i915]
<4> [472.618970] Call Trace:
<4> [472.618974]  ? __schedule+0x2e5/0x810
<4> [472.618978]  schedule+0x37/0xe0
<4> [472.618982]  schedule_preempt_disabled+0xf/0x20
<4> [472.618984]  __mutex_lock+0x281/0x9c0
<4> [472.618987]  ? mark_held_locks+0x49/0x70
<4> [472.618989]  ? _raw_spin_unlock_irqrestore+0x47/0x60
<4> [472.619038]  ? i915_vma_unbind+0xae/0x110 [i915]
<4> [472.619084]  ? i915_vma_unbind+0xae/0x110 [i915]
<4> [472.619122]  i915_vma_unbind+0xae/0x110 [i915]
<4> [472.619165]  i915_gem_object_unbind+0x1dc/0x400 [i915]
<4> [472.619208]  i915_gem_shrink+0x328/0x660 [i915]
<4> [472.619250]  ? i915_gem_shrink_all+0x38/0x60 [i915]
<4> [472.619282]  i915_gem_shrink_all+0x38/0x60 [i915]
<4> [472.619325]  vm_alloc_page.constprop.25+0x1aa/0x240 [i915]
<4> [472.619330]  ? rcu_read_lock_sched_held+0x4d/0x80
<4> [472.619363]  ? __alloc_pd+0xb/0x30 [i915]
<4> [472.619366]  ? module_assert_mutex_or_preempt+0xf/0x30
<4> [472.619368]  ? __module_address+0x23/0xe0
<4> [472.619371]  ? is_module_address+0x26/0x40
<4> [472.619374]  ? static_obj+0x34/0x50
<4> [472.619376]  ? lockdep_init_map+0x4d/0x1e0
<4> [472.619407]  setup_page_dma+0xd/0x90 [i915]
<4> [472.619437]  alloc_pd+0x29/0x50 [i915]
<4> [472.619470]  __gen8_ppgtt_alloc+0x443/0x6b0 [i915]
<4> [472.619503]  gen8_ppgtt_alloc+0xd7/0x300 [i915]
<4> [472.619535]  ppgtt_bind_vma+0x2a/0xe0 [i915]
<4> [472.619577]  __vma_bind+0x26/0x40 [i915]
<4> [472.619611]  fence_work+0x1c/0x90 [i915]
<4> [472.619617]  process_one_work+0x26a/0x620

Fixes: 2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex")
Signed-off-by: Chris Wilson 
Cc: Tvrtko Ursulin 
Reviewed-by: Tvrtko Ursulin 
---
 drivers/gpu/drm/i915/i915_vma.c | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 4cdd883f9d66..c76159b6df69 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -1225,18 +1225,6 @@ int __i915_vma_unbind(struct i915_vma *vma)
 
lockdep_assert_held(&vma->vm->mutex);
 
-   /*
-* First wait upon any activity as retiring the request may
-* have side-effects such as unpinning or even unbinding this vma.
-*
-* XXX Actually waiting under the vm->mutex is a hinderance and
-* should be pipelined wherever possible. In cases where that is
-* unavoidable, we should lift the wait to before the mutex.
-*/
-   ret = i915_vma_sync(vma);
-   if (ret)
-   return ret;
-
if (i915_vma_is_pinned(vma)) {
vma_print_allocator(vma, "is pinned");
return -EAGAIN;
@@ -1308,6 +1296,11 @@ int i915_vma_unbind(struct i915_vma *vma)
if (!drm_mm_node_allocated(&vma->node))
return 0;
 
+   if (i915_vma_is_pinned(vma)) {
+   vma_print_allocator(vma, "is pinned");
+   return -EAGAIN;
+   }
+
if (i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND))
/* XXX not always required: nop_clear_range */
wakeref = intel_runtime_pm_get(&vm->i915->runtime_pm);
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.IGT: failure for i915 lpsp support for lpsp igt (rev6)

2020-04-03 Thread Patchwork
== Series Details ==

Series: i915 lpsp support for lpsp igt (rev6)
URL   : https://patchwork.freedesktop.org/series/74648/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8228_full -> Patchwork_17155_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17155_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17155_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17155_full:

### IGT changes ###

 Possible regressions 

  * {igt@i915_pm_lpsp@non-edp-lpsp} (NEW):
- shard-tglb: NOTRUN -> [SKIP][1]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-tglb1/igt@i915_pm_l...@non-edp-lpsp.html
- shard-iclb: NOTRUN -> [SKIP][2]
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb6/igt@i915_pm_l...@non-edp-lpsp.html

  * igt@i915_pm_rpm@modeset-lpsp-stress-no-wait:
- shard-iclb: [PASS][3] -> [SKIP][4] +1 similar issue
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb3/igt@i915_pm_...@modeset-lpsp-stress-no-wait.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb7/igt@i915_pm_...@modeset-lpsp-stress-no-wait.html

  * igt@runner@aborted:
- shard-tglb: NOTRUN -> [FAIL][5]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-tglb1/igt@run...@aborted.html

  
 Warnings 

  * igt@i915_pm_lpsp@screens-disabled:
- shard-snb:  [SKIP][6] ([fdo#109271]) -> [FAIL][7]
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-snb2/igt@i915_pm_l...@screens-disabled.html
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-snb4/igt@i915_pm_l...@screens-disabled.html

  
New tests
-

  New tests have been introduced between CI_DRM_8228_full and 
Patchwork_17155_full:

### New IGT tests (1) ###

  * igt@i915_pm_lpsp@non-edp-lpsp:
- Statuses : 4 pass(s) 3 skip(s)
- Exec time: [0.0, 0.77] s

  

Known issues


  Here are the changes found in Patchwork_17155_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_busy@busy-vcs1:
- shard-iclb: [PASS][8] -> [SKIP][9] ([fdo#112080]) +8 similar 
issues
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb1/igt@gem_b...@busy-vcs1.html
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb6/igt@gem_b...@busy-vcs1.html

  * igt@gem_exec_schedule@implicit-both-bsd1:
- shard-iclb: [PASS][10] -> [SKIP][11] ([fdo#109276] / [i915#677]) 
+1 similar issue
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb2/igt@gem_exec_sched...@implicit-both-bsd1.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb6/igt@gem_exec_sched...@implicit-both-bsd1.html

  * igt@gem_exec_schedule@in-order-bsd2:
- shard-iclb: [PASS][12] -> [SKIP][13] ([fdo#109276]) +10 similar 
issues
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb2/igt@gem_exec_sched...@in-order-bsd2.html
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb8/igt@gem_exec_sched...@in-order-bsd2.html

  * igt@gem_exec_schedule@pi-distinct-iova-bsd:
- shard-iclb: [PASS][14] -> [SKIP][15] ([i915#677]) +1 similar issue
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb8/igt@gem_exec_sched...@pi-distinct-iova-bsd.html
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb1/igt@gem_exec_sched...@pi-distinct-iova-bsd.html

  * igt@gem_exec_schedule@preempt-bsd:
- shard-iclb: [PASS][16] -> [SKIP][17] ([fdo#112146]) +5 similar 
issues
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb3/igt@gem_exec_sched...@preempt-bsd.html
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb1/igt@gem_exec_sched...@preempt-bsd.html

  * igt@gem_exec_suspend@basic-s3:
- shard-kbl:  [PASS][18] -> [DMESG-WARN][19] ([i915#180] / 
[i915#93] / [i915#95])
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-kbl3/igt@gem_exec_susp...@basic-s3.html
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-kbl1/igt@gem_exec_susp...@basic-s3.html

  * igt@i915_pm_rc6_residency@rc6-idle:
- shard-snb:  [PASS][20] -> [TIMEOUT][21] ([i915#1526])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-snb6/igt@i915_pm_rc6_reside...@rc6-idle.html
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-snb5/igt@i915_pm_rc6_reside...@rc6-idle.html
- sha

[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/gem: Try allocating va from free space (rev3)

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915/gem: Try allocating va from free space (rev3)
URL   : https://patchwork.freedesktop.org/series/74748/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8233_full -> Patchwork_17171_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17171_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17171_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17171_full:

### IGT changes ###

 Possible regressions 

  * igt@i915_pm_rc6_residency@rc6-idle:
- shard-snb:  NOTRUN -> [FAIL][1]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-snb1/igt@i915_pm_rc6_reside...@rc6-idle.html

  

### Piglit changes ###

 Possible regressions 

  * spec@!opengl 1.1@max-texture-size (NEW):
- pig-snb-2600:   NOTRUN -> [INCOMPLETE][2]
   [2]: None

  
New tests
-

  New tests have been introduced between CI_DRM_8233_full and 
Patchwork_17171_full:

### New IGT tests (1) ###

  * igt@gem_exec_reloc@basic-spin:
- Statuses :
- Exec time: [None] s

  


### New Piglit tests (1) ###

  * spec@!opengl 1.1@max-texture-size:
- Statuses : 1 incomplete(s)
- Exec time: [0.0] s

  

Known issues


  Here are the changes found in Patchwork_17171_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_exec_schedule@in-order-bsd:
- shard-iclb: [PASS][3] -> [SKIP][4] ([fdo#112146]) +4 similar 
issues
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8233/shard-iclb3/igt@gem_exec_sched...@in-order-bsd.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-iclb2/igt@gem_exec_sched...@in-order-bsd.html

  * igt@i915_pm_rc6_residency@rc6-idle:
- shard-glk:  [PASS][5] -> [FAIL][6] ([i915#1527])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8233/shard-glk2/igt@i915_pm_rc6_reside...@rc6-idle.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-glk4/igt@i915_pm_rc6_reside...@rc6-idle.html

  * igt@i915_pm_rps@min-max-config-loaded:
- shard-glk:  [PASS][7] -> [FAIL][8] ([i915#39])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8233/shard-glk8/igt@i915_pm_...@min-max-config-loaded.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-glk6/igt@i915_pm_...@min-max-config-loaded.html

  * igt@i915_selftest@live@execlists:
- shard-glk:  [PASS][9] -> [INCOMPLETE][10] ([i915#58] / [i915#656] 
/ [k.org#198133])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8233/shard-glk6/igt@i915_selftest@l...@execlists.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-glk8/igt@i915_selftest@l...@execlists.html
- shard-apl:  [PASS][11] -> [INCOMPLETE][12] ([i915#656])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8233/shard-apl4/igt@i915_selftest@l...@execlists.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-apl2/igt@i915_selftest@l...@execlists.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-kbl:  [PASS][13] -> [DMESG-WARN][14] ([i915#180]) +5 
similar issues
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8233/shard-kbl1/igt@kms_cursor_...@pipe-c-cursor-suspend.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-kbl4/igt@kms_cursor_...@pipe-c-cursor-suspend.html

  * igt@kms_draw_crc@draw-method-rgb565-mmap-cpu-untiled:
- shard-glk:  [PASS][15] -> [FAIL][16] ([i915#52] / [i915#54])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8233/shard-glk8/igt@kms_draw_...@draw-method-rgb565-mmap-cpu-untiled.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-glk1/igt@kms_draw_...@draw-method-rgb565-mmap-cpu-untiled.html

  * igt@kms_draw_crc@draw-method-xrgb-pwrite-untiled:
- shard-kbl:  [PASS][17] -> [FAIL][18] ([i915#177] / [i915#52] / 
[i915#54] / [i915#93] / [i915#95])
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8233/shard-kbl6/igt@kms_draw_...@draw-method-xrgb-pwrite-untiled.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-kbl2/igt@kms_draw_...@draw-method-xrgb-pwrite-untiled.html
- shard-apl:  [PASS][19] -> [FAIL][20] ([i915#52] / [i915#54] / 
[i915#95])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8233/shard-apl7/igt@kms_draw_...@draw-method-xrgb-pwrite-untiled.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17171/shard-apl6/igt@kms_draw_...@draw-method-xrgb-pwrite-untiled.htm

[Intel-gfx] [PATCH 09/10] drm/i915/gem: Allow combining submit-fences with syncobj

2020-04-03 Thread Chris Wilson
Fixes: a88b6e4cbafd ("drm/i915: Allow specification of parallel execbuf")
Signed-off-by: Chris Wilson 
Cc: Tvrtko Ursulin 
Cc: Lionel Landwerlin 
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++---
 include/uapi/drm/i915_drm.h|  7 ---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index bf1b5399ffa3..5c1c5a9eced4 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -2299,7 +2299,7 @@ get_fence_array(struct drm_i915_gem_execbuffer2 *args,
BUILD_BUG_ON(~(ARCH_KMALLOC_MINALIGN - 1) &
 ~__I915_EXEC_FENCE_UNKNOWN_FLAGS);
 
-   fences[n] = ptr_pack_bits(syncobj, fence.flags, 2);
+   fences[n] = ptr_pack_bits(syncobj, fence.flags, 3);
}
 
return fences;
@@ -2330,7 +2330,7 @@ await_fence_array(struct i915_execbuffer *eb,
struct dma_fence *fence;
unsigned int flags;
 
-   syncobj = ptr_unpack_bits(fences[n], &flags, 2);
+   syncobj = ptr_unpack_bits(fences[n], &flags, 3);
if (!(flags & I915_EXEC_FENCE_WAIT))
continue;
 
@@ -2354,7 +2354,11 @@ await_fence_array(struct i915_execbuffer *eb,
spin_unlock(&syncobj->lock);
}
 
-   err = i915_request_await_dma_fence(eb->request, fence);
+   if (flags & I915_EXEC_FENCE_WAIT_SUBMIT)
+   err = i915_request_await_execution(eb->request, fence,
+  
eb->engine->bond_execute);
+   else
+   err = i915_request_await_dma_fence(eb->request, fence);
dma_fence_put(fence);
if (err < 0)
return err;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 14b67cd6b54b..704dd0e3bc1d 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1040,9 +1040,10 @@ struct drm_i915_gem_exec_fence {
 */
__u32 handle;
 
-#define I915_EXEC_FENCE_WAIT(1<<0)
-#define I915_EXEC_FENCE_SIGNAL  (1<<1)
-#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1))
+#define I915_EXEC_FENCE_WAIT(1u << 0)
+#define I915_EXEC_FENCE_SIGNAL  (1u << 1)
+#define I915_EXEC_FENCE_WAIT_SUBMIT (1u << 2)
+#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_WAIT_SUBMIT << 1))
__u32 flags;
 };
 
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 04/10] dma-buf: Report signaled links inside dma-fence-chain

2020-04-03 Thread Chris Wilson
Whenever we walk along the dma-fence-chain, we prune signaled links to
keep the chain nice and tidy. This leads to situations where we can
prune a link and report the earlier fence as the target seqno --
violating our own consistency checks that the seqno is not more advanced
than the last element in a dma-fence-chain.

Report a NULL fence and success if the seqno has already been signaled.

Signed-off-by: Chris Wilson 
---
 drivers/dma-buf/dma-fence-chain.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/dma-buf/dma-fence-chain.c 
b/drivers/dma-buf/dma-fence-chain.c
index 3d123502ff12..c435bbba851c 100644
--- a/drivers/dma-buf/dma-fence-chain.c
+++ b/drivers/dma-buf/dma-fence-chain.c
@@ -99,6 +99,12 @@ int dma_fence_chain_find_seqno(struct dma_fence **pfence, 
uint64_t seqno)
return -EINVAL;
 
dma_fence_chain_for_each(*pfence, &chain->base) {
+   if ((*pfence)->seqno < seqno) { /* already signaled */
+   dma_fence_put(*pfence);
+   *pfence = NULL;
+   break;
+   }
+
if ((*pfence)->context != chain->base.context ||
to_dma_fence_chain(*pfence)->prev_seqno < seqno)
break;
@@ -222,6 +228,7 @@ EXPORT_SYMBOL(dma_fence_chain_ops);
  * @chain: the chain node to initialize
  * @prev: the previous fence
  * @fence: the current fence
+ * @seqno: the sequence number (syncpt) of the fence within the chain
  *
  * Initialize a new chain node and either start a new chain or add the node to
  * the existing chain of the previous fence.
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 07/10] drm/syncobj: Allow use of dma-fence-proxy

2020-04-03 Thread Chris Wilson
Allow the callers to supply a dma-fence-proxy for asynchronous waiting on
future fences.

Signed-off-by: Chris Wilson 
---
 drivers/gpu/drm/drm_syncobj.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index 42d46414f767..e141db0e1eb6 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -184,6 +184,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -324,14 +325,9 @@ void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
struct dma_fence *old_fence;
struct syncobj_wait_entry *cur, *tmp;
 
-   if (fence)
-   dma_fence_get(fence);
-
spin_lock(&syncobj->lock);
 
-   old_fence = rcu_dereference_protected(syncobj->fence,
- lockdep_is_held(&syncobj->lock));
-   rcu_assign_pointer(syncobj->fence, fence);
+   old_fence = dma_fence_replace_proxy(&syncobj->fence, fence);
 
if (fence != old_fence) {
list_for_each_entry_safe(cur, tmp, &syncobj->cb_list, node)
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 05/10] dma-buf: Exercise dma-fence-chain under selftests

2020-04-03 Thread Chris Wilson
A few very simple testcases to exercise the dma-fence-chain API.

Signed-off-by: Chris Wilson 
---
 drivers/dma-buf/Makefile |   3 +-
 drivers/dma-buf/selftests.h  |   1 +
 drivers/dma-buf/st-dma-fence-chain.c | 713 +++
 3 files changed, 716 insertions(+), 1 deletion(-)
 create mode 100644 drivers/dma-buf/st-dma-fence-chain.c

diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile
index 9c190026bfab..995e05f609ff 100644
--- a/drivers/dma-buf/Makefile
+++ b/drivers/dma-buf/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_UDMABUF)   += udmabuf.o
 
 dmabuf_selftests-y := \
selftest.o \
-   st-dma-fence.o
+   st-dma-fence.o \
+   st-dma-fence-chain.o
 
 obj-$(CONFIG_DMABUF_SELFTESTS) += dmabuf_selftests.o
diff --git a/drivers/dma-buf/selftests.h b/drivers/dma-buf/selftests.h
index 5320386f02e5..55918ef9adab 100644
--- a/drivers/dma-buf/selftests.h
+++ b/drivers/dma-buf/selftests.h
@@ -11,3 +11,4 @@
  */
 selftest(sanitycheck, __sanitycheck__) /* keep first (igt selfcheck) */
 selftest(dma_fence, dma_fence)
+selftest(dma_fence_chain, dma_fence_chain)
diff --git a/drivers/dma-buf/st-dma-fence-chain.c 
b/drivers/dma-buf/st-dma-fence-chain.c
new file mode 100644
index ..bd08ba67b03b
--- /dev/null
+++ b/drivers/dma-buf/st-dma-fence-chain.c
@@ -0,0 +1,713 @@
+// SPDX-License-Identifier: MIT
+
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "selftest.h"
+
+static struct kmem_cache *slab_fences;
+
+static inline struct mock_fence {
+   struct dma_fence base;
+   spinlock_t lock;
+} *to_mock_fence(struct dma_fence *f) {
+   return container_of(f, struct mock_fence, base);
+}
+
+static const char *mock_name(struct dma_fence *f)
+{
+   return "mock";
+}
+
+static void mock_fence_release(struct dma_fence *f)
+{
+   kmem_cache_free(slab_fences, to_mock_fence(f));
+}
+
+static const struct dma_fence_ops mock_ops = {
+   .get_driver_name = mock_name,
+   .get_timeline_name = mock_name,
+   .release = mock_fence_release,
+};
+
+static struct dma_fence *mock_fence(void)
+{
+   struct mock_fence *f;
+
+   f = kmem_cache_alloc(slab_fences, GFP_KERNEL);
+   if (!f)
+   return NULL;
+
+   spin_lock_init(&f->lock);
+   dma_fence_init(&f->base, &mock_ops, &f->lock, 0, 0);
+
+   return &f->base;
+}
+
+static inline struct mock_chain {
+   struct dma_fence_chain base;
+} *to_mock_chain(struct dma_fence *f) {
+   return container_of(f, struct mock_chain, base.base);
+}
+
+static struct dma_fence *mock_chain(struct dma_fence *prev,
+   struct dma_fence *fence,
+   u64 seqno)
+{
+   struct mock_chain *f;
+
+   f = kmalloc(sizeof(*f), GFP_KERNEL);
+   if (!f)
+   return NULL;
+
+   dma_fence_chain_init(&f->base,
+dma_fence_get(prev),
+dma_fence_get(fence),
+seqno);
+
+   return &f->base.base;
+}
+
+static int sanitycheck(void *arg)
+{
+   struct dma_fence *f, *chain;
+   int err = 0;
+
+   f = mock_fence();
+   if (!f)
+   return -ENOMEM;
+
+   chain = mock_chain(NULL, f, 1);
+   if (!chain)
+   err = -ENOMEM;
+
+   dma_fence_signal(f);
+   dma_fence_put(f);
+
+   dma_fence_put(chain);
+
+   return err;
+}
+
+struct fence_chains {
+   unsigned int chain_length;
+   struct dma_fence **fences;
+   struct dma_fence **chains;
+
+   struct dma_fence *tail;
+};
+
+static uint64_t seqno_inc(unsigned int i)
+{
+   return i + 1;
+}
+
+static int fence_chains_init(struct fence_chains *fc, unsigned int count,
+uint64_t (*seqno_fn)(unsigned int))
+{
+   unsigned int i;
+   int err = 0;
+
+   fc->chains = kvmalloc_array(count, sizeof(*fc->chains),
+   GFP_KERNEL | __GFP_ZERO);
+   if (!fc->chains)
+   return -ENOMEM;
+
+   fc->fences = kvmalloc_array(count, sizeof(*fc->fences),
+   GFP_KERNEL | __GFP_ZERO);
+   if (!fc->fences) {
+   err = -ENOMEM;
+   goto err_chains;
+   }
+
+   fc->tail = NULL;
+   for (i = 0; i < count; i++) {
+   fc->fences[i] = mock_fence();
+   if (!fc->fences[i]) {
+   err = -ENOMEM;
+   goto unwind;
+   }
+
+   fc->chains[i] = mock_chain(fc->tail,
+  fc->fences[i],
+  seqno_fn(i));
+   if (!fc->chains[i]) {
+   err = -ENOMEM;
+   goto unwind;
+   }
+
+   fc->tail = fc->chains[i];
+   }

[Intel-gfx] [PATCH 06/10] dma-buf: Proxy fence, an unsignaled fence placeholder

2020-04-03 Thread Chris Wilson
Often we need to create a fence for a future event that has not yet been
associated with a fence. We can store a proxy fence, a placeholder, in
the timeline and replace it later when the real fence is known. Any
listeners that attach to the proxy fence will automatically be signaled
when the real fence completes, and any future listeners will instead be
attach directly to the real fence avoiding any indirection overhead.

Signed-off-by: Chris Wilson 
Cc: Lionel Landwerlin 
---
 drivers/dma-buf/Makefile |  13 +-
 drivers/dma-buf/dma-fence-private.h  |  20 +
 drivers/dma-buf/dma-fence-proxy.c| 189 +
 drivers/dma-buf/dma-fence.c  |   4 +-
 drivers/dma-buf/selftests.h  |   1 +
 drivers/dma-buf/st-dma-fence-proxy.c | 581 +++
 include/linux/dma-fence-proxy.h  |  20 +
 7 files changed, 824 insertions(+), 4 deletions(-)
 create mode 100644 drivers/dma-buf/dma-fence-private.h
 create mode 100644 drivers/dma-buf/dma-fence-proxy.c
 create mode 100644 drivers/dma-buf/st-dma-fence-proxy.c
 create mode 100644 include/linux/dma-fence-proxy.h

diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile
index 995e05f609ff..afaf6dadd9a3 100644
--- a/drivers/dma-buf/Makefile
+++ b/drivers/dma-buf/Makefile
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-y := dma-buf.o dma-fence.o dma-fence-array.o dma-fence-chain.o \
-dma-resv.o seqno-fence.o
+obj-y := \
+   dma-buf.o \
+   dma-fence.o \
+   dma-fence-array.o \
+   dma-fence-chain.o \
+   dma-fence-proxy.o \
+   dma-resv.o \
+   seqno-fence.o
 obj-$(CONFIG_DMABUF_HEAPS) += dma-heap.o
 obj-$(CONFIG_DMABUF_HEAPS) += heaps/
 obj-$(CONFIG_SYNC_FILE)+= sync_file.o
@@ -10,6 +16,7 @@ obj-$(CONFIG_UDMABUF) += udmabuf.o
 dmabuf_selftests-y := \
selftest.o \
st-dma-fence.o \
-   st-dma-fence-chain.o
+   st-dma-fence-chain.o \
+   st-dma-fence-proxy.o
 
 obj-$(CONFIG_DMABUF_SELFTESTS) += dmabuf_selftests.o
diff --git a/drivers/dma-buf/dma-fence-private.h 
b/drivers/dma-buf/dma-fence-private.h
new file mode 100644
index ..6924d28af0fa
--- /dev/null
+++ b/drivers/dma-buf/dma-fence-private.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Fence mechanism for dma-buf and to allow for asynchronous dma access
+ *
+ * Copyright (C) 2012 Canonical Ltd
+ * Copyright (C) 2012 Texas Instruments
+ *
+ * Authors:
+ * Rob Clark 
+ * Maarten Lankhorst 
+ */
+
+#ifndef DMA_FENCE_PRIVATE_H
+#define DMA_FENCE_PRIAVTE_H
+
+struct dma_fence;
+
+bool __dma_fence_enable_signaling(struct dma_fence *fence);
+
+#endif /* DMA_FENCE_PRIAVTE_H */
diff --git a/drivers/dma-buf/dma-fence-proxy.c 
b/drivers/dma-buf/dma-fence-proxy.c
new file mode 100644
index ..6dce543d0757
--- /dev/null
+++ b/drivers/dma-buf/dma-fence-proxy.c
@@ -0,0 +1,189 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * dma-fence-proxy: placeholder unsignaled fence
+ *
+ * Copyright (C) 2017-2019 Intel Corporation
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "dma-fence-private.h"
+
+struct dma_fence_proxy {
+   struct dma_fence base;
+   spinlock_t lock;
+
+   struct dma_fence *real;
+   struct dma_fence_cb cb;
+   struct irq_work work;
+};
+
+static const char *proxy_get_driver_name(struct dma_fence *fence)
+{
+   struct dma_fence_proxy *p = container_of(fence, typeof(*p), base);
+   struct dma_fence *real = READ_ONCE(p->real);
+
+   return real ? real->ops->get_driver_name(real) : "proxy";
+}
+
+static const char *proxy_get_timeline_name(struct dma_fence *fence)
+{
+   struct dma_fence_proxy *p = container_of(fence, typeof(*p), base);
+   struct dma_fence *real = READ_ONCE(p->real);
+
+   return real ? real->ops->get_timeline_name(real) : "unset";
+}
+
+static void proxy_irq_work(struct irq_work *work)
+{
+   struct dma_fence_proxy *p = container_of(work, typeof(*p), work);
+
+   dma_fence_signal(&p->base);
+   dma_fence_put(&p->base);
+}
+
+static void proxy_callback(struct dma_fence *real, struct dma_fence_cb *cb)
+{
+   struct dma_fence_proxy *p = container_of(cb, typeof(*p), cb);
+
+   if (real->error)
+   dma_fence_set_error(&p->base, real->error);
+
+   /* Lower the height of the proxy chain -> single stack frame */
+   irq_work_queue(&p->work);
+}
+
+static bool proxy_enable_signaling(struct dma_fence *fence)
+{
+   struct dma_fence_proxy *p = container_of(fence, typeof(*p), base);
+   struct dma_fence *real = READ_ONCE(p->real);
+   bool ret = true;
+
+   if (real) {
+   spin_lock_nested(real->lock, SINGLE_DEPTH_NESTING);
+   ret = __dma_fence_enable_signaling(real);
+   spin_unlock(real->lock);
+   }
+
+   return ret;
+}
+
+static void proxy_release(struct dma_fence *fence)
+{
+   struct dma_fence_proxy *p = container_of(fence, typeof

[Intel-gfx] [PATCH 10/10] drm/i915/gt: Declare when we enabled timeslicing

2020-04-03 Thread Chris Wilson
Let userspace know if they can trust timeslicing by including it as part
of the I915_PARAM_HAS_SCHEDULER::I915_SCHEDULER_CAP_TIMESLICING

v2: Only declare timeslicing if we can safely preempt userspace.

Fixes: 8ee36e048c98 ("drm/i915/execlists: Minimalistic timeslicing")
Signed-off-by: Chris Wilson 
Cc: Kenneth Graunke 
---
 drivers/gpu/drm/i915/gt/intel_engine.h  | 3 ++-
 drivers/gpu/drm/i915/gt/intel_engine_user.c | 5 +
 include/uapi/drm/i915_drm.h | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine.h 
b/drivers/gpu/drm/i915/gt/intel_engine.h
index b469de0dd9b6..424672ee7874 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine.h
+++ b/drivers/gpu/drm/i915/gt/intel_engine.h
@@ -339,7 +339,8 @@ intel_engine_has_timeslices(const struct intel_engine_cs 
*engine)
if (!IS_ACTIVE(CONFIG_DRM_I915_TIMESLICE_DURATION))
return false;
 
-   return intel_engine_has_semaphores(engine);
+   return (intel_engine_has_semaphores(engine) &&
+   intel_engine_has_preemption(engine));
 }
 
 #endif /* _INTEL_RINGBUFFER_H_ */
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_user.c 
b/drivers/gpu/drm/i915/gt/intel_engine_user.c
index 848decee9066..b84fdd722781 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_user.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_user.c
@@ -121,6 +121,11 @@ static void set_scheduler_caps(struct drm_i915_private 
*i915)
else
disabled |= BIT(map[i].sched);
}
+
+   if (intel_engine_has_timeslices(engine))
+   enabled |= I915_SCHEDULER_CAP_TIMESLICING;
+   else
+   disabled |= I915_SCHEDULER_CAP_TIMESLICING;
}
 
i915->caps.scheduler = enabled & ~disabled;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 704dd0e3bc1d..1ee227b5131a 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -523,6 +523,7 @@ typedef struct drm_i915_irq_wait {
 #define   I915_SCHEDULER_CAP_PREEMPTION(1ul << 2)
 #define   I915_SCHEDULER_CAP_SEMAPHORES(1ul << 3)
 #define   I915_SCHEDULER_CAP_ENGINE_BUSY_STATS (1ul << 4)
+#define   I915_SCHEDULER_CAP_TIMESLICING   (1ul << 5)
 
 #define I915_PARAM_HUC_STATUS   42
 
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 03/10] dma-buf: Prettify typecasts for dma-fence-chain

2020-04-03 Thread Chris Wilson
Inside dma-fence-chain, we use a cmpxchg on an RCU-protected pointer. To
avoid the sparse warning for using the RCU pointer directly, we have to
cast away the __rcu annotation. However, we don't need to use void*
everywhere and can stick to the dma_fence*.

Signed-off-by: Chris Wilson 
Reviewed-by: Mika Kuoppala 
---
 drivers/dma-buf/dma-fence-chain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/dma-buf/dma-fence-chain.c 
b/drivers/dma-buf/dma-fence-chain.c
index 44a741677d25..3d123502ff12 100644
--- a/drivers/dma-buf/dma-fence-chain.c
+++ b/drivers/dma-buf/dma-fence-chain.c
@@ -62,7 +62,8 @@ struct dma_fence *dma_fence_chain_walk(struct dma_fence 
*fence)
replacement = NULL;
}
 
-   tmp = cmpxchg((void **)&chain->prev, (void *)prev, (void 
*)replacement);
+   tmp = cmpxchg((struct dma_fence __force **)&chain->prev,
+ prev, replacement);
if (tmp == prev)
dma_fence_put(tmp);
else
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 08/10] drm/i915/gem: Teach execbuf how to wait on future syncobj

2020-04-03 Thread Chris Wilson
If a syncobj has not yet been assigned, treat it as a future fence and
install and wait upon a dma-fence-proxy. The proxy will be replace by
the real fence later, and that fence will be responsible for signaling
our waiter.

Signed-off-by: Chris Wilson 
---
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 21 +--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 9d11bad74e9a..bf1b5399ffa3 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2334,8 +2335,24 @@ await_fence_array(struct i915_execbuffer *eb,
continue;
 
fence = drm_syncobj_fence_get(syncobj);
-   if (!fence)
-   return -EINVAL;
+   if (!fence) {
+   struct dma_fence *old;
+
+   fence = dma_fence_create_proxy();
+   if (!fence)
+   return -ENOMEM;
+
+   spin_lock(&syncobj->lock);
+   old = rcu_dereference_protected(syncobj->fence, true);
+   if (unlikely(old)) {
+   dma_fence_put(fence);
+   fence = dma_fence_get(old);
+   } else {
+   rcu_assign_pointer(syncobj->fence,
+  dma_fence_get(fence));
+   }
+   spin_unlock(&syncobj->lock);
+   }
 
err = i915_request_await_dma_fence(eb->request, fence);
dma_fence_put(fence);
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 01/10] drm/i915/selftests: Add request throughput measurement to perf

2020-04-03 Thread Chris Wilson
Under ideal circumstances, the driver should be able to keep the GPU
fully saturated with work. Measure how close to ideal we get under the
harshest of conditions with no user payload.

v2: Also measure throughput using only one thread.

Signed-off-by: Chris Wilson 
---
 .../drm/i915/selftests/i915_perf_selftests.h  |   1 +
 drivers/gpu/drm/i915/selftests/i915_request.c | 590 +-
 2 files changed, 590 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_perf_selftests.h 
b/drivers/gpu/drm/i915/selftests/i915_perf_selftests.h
index 3bf7f53e9924..d8da142985eb 100644
--- a/drivers/gpu/drm/i915/selftests/i915_perf_selftests.h
+++ b/drivers/gpu/drm/i915/selftests/i915_perf_selftests.h
@@ -16,5 +16,6 @@
  * Tests are executed in order by igt/i915_selftest
  */
 selftest(engine_cs, intel_engine_cs_perf_selftests)
+selftest(request, i915_request_perf_selftests)
 selftest(blt, i915_gem_object_blt_perf_selftests)
 selftest(region, intel_memory_region_perf_selftests)
diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c 
b/drivers/gpu/drm/i915/selftests/i915_request.c
index 1dab0360f76a..3cf0599cec4b 100644
--- a/drivers/gpu/drm/i915/selftests/i915_request.c
+++ b/drivers/gpu/drm/i915/selftests/i915_request.c
@@ -23,6 +23,7 @@
  */
 
 #include 
+#include 
 
 #include "gem/i915_gem_pm.h"
 #include "gem/selftests/mock_context.h"
@@ -1239,7 +1240,7 @@ static int live_parallel_engines(void *arg)
struct igt_live_test t;
unsigned int idx;
 
-   snprintf(name, sizeof(name), "%ps", fn);
+   snprintf(name, sizeof(name), "%ps", *fn);
err = igt_live_test_begin(&t, i915, __func__, name);
if (err)
break;
@@ -1476,3 +1477,590 @@ int i915_request_live_selftests(struct drm_i915_private 
*i915)
 
return i915_subtests(tests, i915);
 }
+
+static int switch_to_kernel_sync(struct intel_context *ce, int err)
+{
+   struct i915_request *rq;
+   struct dma_fence *fence;
+
+   rq = intel_engine_create_kernel_request(ce->engine);
+   if (IS_ERR(rq))
+   return PTR_ERR(rq);
+
+   fence = i915_active_fence_get(&ce->timeline->last_request);
+   if (fence) {
+   i915_request_await_dma_fence(rq, fence);
+   dma_fence_put(fence);
+   }
+
+   rq = i915_request_get(rq);
+   i915_request_add(rq);
+   if (i915_request_wait(rq, 0, HZ / 2) < 0 && !err)
+   err = -ETIME;
+   i915_request_put(rq);
+
+   while (!err && !intel_engine_is_idle(ce->engine))
+   intel_engine_flush_submission(ce->engine);
+
+   return err;
+}
+
+struct perf_stats {
+   struct intel_engine_cs *engine;
+   unsigned long count;
+   ktime_t time;
+   ktime_t busy;
+   u64 runtime;
+};
+
+struct perf_series {
+   struct drm_i915_private *i915;
+   unsigned int nengines;
+   struct intel_context *ce[];
+};
+
+static int s_sync0(void *arg)
+{
+   struct perf_series *ps = arg;
+   IGT_TIMEOUT(end_time);
+   unsigned int idx = 0;
+   int err = 0;
+
+   GEM_BUG_ON(!ps->nengines);
+   do {
+   struct i915_request *rq;
+
+   rq = i915_request_create(ps->ce[idx]);
+   if (IS_ERR(rq)) {
+   err = PTR_ERR(rq);
+   break;
+   }
+
+   i915_request_get(rq);
+   i915_request_add(rq);
+
+   if (i915_request_wait(rq, 0, HZ / 5) < 0)
+   err = -ETIME;
+   i915_request_put(rq);
+   if (err)
+   break;
+
+   if (++idx == ps->nengines)
+   idx = 0;
+   } while (!__igt_timeout(end_time, NULL));
+
+   return err;
+}
+
+static int s_sync1(void *arg)
+{
+   struct perf_series *ps = arg;
+   struct i915_request *prev = NULL;
+   IGT_TIMEOUT(end_time);
+   unsigned int idx = 0;
+   int err = 0;
+
+   GEM_BUG_ON(!ps->nengines);
+   do {
+   struct i915_request *rq;
+
+   rq = i915_request_create(ps->ce[idx]);
+   if (IS_ERR(rq)) {
+   err = PTR_ERR(rq);
+   break;
+   }
+
+   i915_request_get(rq);
+   i915_request_add(rq);
+
+   if (prev && i915_request_wait(prev, 0, HZ / 5) < 0)
+   err = -ETIME;
+   i915_request_put(prev);
+   prev = rq;
+   if (err)
+   break;
+
+   if (++idx == ps->nengines)
+   idx = 0;
+   } while (!__igt_timeout(end_time, NULL));
+   i915_request_put(prev);
+
+   return err;
+}
+
+static int s_many(void *arg)
+{
+   struct perf_series *ps = arg;
+   IGT_TIMEOUT(end_time);
+   unsigned int idx = 0;
+
+   GEM_BUG_ON(!ps->nengines);
+   do {
+  

[Intel-gfx] [PATCH 02/10] drm/i915/gt: Yield the timeslice if caught waiting on a user semaphore

2020-04-03 Thread Chris Wilson
If we find ourselves waiting on a MI_SEMAPHORE_WAIT, either within the
user batch or in our own preamble, the engine raises a
GT_WAIT_ON_SEMAPHORE interrupt. We can unmask that interrupt and so
respond to a semaphore wait by yielding the timeslice, if we have
another context to yield to!

The only real complication is that the interrupt is only generated for
the start of the semaphore wait, and is asynchronous to our
process_csb() -- that is, we may not have registered the timeslice before
we see the interrupt. To ensure we don't miss a potential semaphore
blocking forward progress (e.g. selftests/live_timeslice_preempt) we mark
the interrupt and apply it to the next timeslice regardless of whether it
was active at the time.

v2: We use semaphores in preempt-to-busy, within the timeslicing
implementation itself! Ergo, when we do insert a preemption due to an
expired timeslice, the new context may start with the missed semaphore
flagged by the retired context and be yielded, ad infinitum. To avoid
this, read the context id at the time of the semaphore interrupt and
only yield if that context is still active.

Fixes: 8ee36e048c98 ("drm/i915/execlists: Minimalistic timeslicing")
Signed-off-by: Chris Wilson 
Cc: Tvrtko Ursulin 
Cc: Kenneth Graunke 
---
 drivers/gpu/drm/i915/gt/intel_engine_cs.c|  6 +++
 drivers/gpu/drm/i915/gt/intel_engine_types.h |  9 +
 drivers/gpu/drm/i915/gt/intel_gt_irq.c   | 13 ++-
 drivers/gpu/drm/i915/gt/intel_lrc.c  | 40 +---
 drivers/gpu/drm/i915/gt/selftest_lrc.c   | 15 +++-
 drivers/gpu/drm/i915/i915_reg.h  |  1 +
 6 files changed, 67 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c 
b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 843cb6f2f696..04995040407d 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -1313,6 +1313,12 @@ static void intel_engine_print_registers(struct 
intel_engine_cs *engine,
 
if (engine->id == RENDER_CLASS && IS_GEN_RANGE(dev_priv, 4, 7))
drm_printf(m, "\tCCID: 0x%08x\n", ENGINE_READ(engine, CCID));
+   if (HAS_EXECLISTS(dev_priv)) {
+   drm_printf(m, "\tEL_STAT_HI: 0x%08x\n",
+  ENGINE_READ(engine, RING_EXECLIST_STATUS_HI));
+   drm_printf(m, "\tEL_STAT_LO: 0x%08x\n",
+  ENGINE_READ(engine, RING_EXECLIST_STATUS_LO));
+   }
drm_printf(m, "\tRING_START: 0x%08x\n",
   ENGINE_READ(engine, RING_START));
drm_printf(m, "\tRING_HEAD:  0x%08x\n",
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h 
b/drivers/gpu/drm/i915/gt/intel_engine_types.h
index 80cdde712842..ac283ab5d89c 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_types.h
+++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h
@@ -156,6 +156,15 @@ struct intel_engine_execlists {
 */
struct i915_priolist default_priolist;
 
+   /**
+* @yield: CCID at the time of the last semaphore-wait interrupt.
+*
+* Instead of leaving a semaphore busy-spinning on an engine, we would
+* like to switch to another ready context, i.e. yielding the semaphore
+* timeslice.
+*/
+   u32 yield;
+
/**
 * @error_interrupt: CS Master EIR
 *
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_irq.c 
b/drivers/gpu/drm/i915/gt/intel_gt_irq.c
index f0e7fd95165a..875bd0392ffc 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_irq.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_irq.c
@@ -39,6 +39,13 @@ cs_irq_handler(struct intel_engine_cs *engine, u32 iir)
}
}
 
+   if (iir & GT_WAIT_SEMAPHORE_INTERRUPT) {
+   WRITE_ONCE(engine->execlists.yield,
+  ENGINE_READ_FW(engine, RING_EXECLIST_STATUS_HI));
+   if (del_timer(&engine->execlists.timer))
+   tasklet = true;
+   }
+
if (iir & GT_CONTEXT_SWITCH_INTERRUPT)
tasklet = true;
 
@@ -228,7 +235,8 @@ void gen11_gt_irq_postinstall(struct intel_gt *gt)
const u32 irqs =
GT_CS_MASTER_ERROR_INTERRUPT |
GT_RENDER_USER_INTERRUPT |
-   GT_CONTEXT_SWITCH_INTERRUPT;
+   GT_CONTEXT_SWITCH_INTERRUPT |
+   GT_WAIT_SEMAPHORE_INTERRUPT;
struct intel_uncore *uncore = gt->uncore;
const u32 dmask = irqs << 16 | irqs;
const u32 smask = irqs << 16;
@@ -366,7 +374,8 @@ void gen8_gt_irq_postinstall(struct intel_gt *gt)
const u32 irqs =
GT_CS_MASTER_ERROR_INTERRUPT |
GT_RENDER_USER_INTERRUPT |
-   GT_CONTEXT_SWITCH_INTERRUPT;
+   GT_CONTEXT_SWITCH_INTERRUPT |
+   GT_WAIT_SEMAPHORE_INTERRUPT;
const u32 gt_interrupts[] = {
irqs << GEN8_RCS_IRQ_SHIFT | irqs << GEN8_BCS_IRQ_SHIFT,
irqs << GEN8_VCS0_IRQ_SHIFT | irqs << G

Re: [Intel-gfx] 5.7-rc0: hangs while attempting to run X

2020-04-03 Thread Pavel Machek
Hi!

> > > Hardware is thinkpad x220. I had this crash few days ago. And today I
> > > have similar-looking one, with slightly newer kernel. (Will post
> > > as a follow-up).
> 
> As part of quest for working system, I tried 5.7-rc0, based on
> 
> Merge: 50a5de895dbe b4d8ddf8356d
> Author: Linus Torvalds 
> Date:   Wed Apr 1 18:18:18 2020 -0700
> 
> It hangs in userspace, at a time when X should be starting, and I'm
> looking at blinking cursor.
> 
> 5.6-rcs worked, I'll test 5.6-final.

5.6-final works.

Hmm...

commit f365ab31efacb70bed1e821f7435626e0b2528a6
Merge: 4646de87d325 59e7a8cc2dcf
Author: Linus Torvalds 
Date:   Wed Apr 1 15:24:20 2020 -0700

Merge tag 'drm-next-2020-04-01' of git://anongit.freedesktop.org/drm/drm

Let me test 4646de87d32526ee87b46c2e0130413367fb5362...that one works.

Ok, so obviously... I should
test... f365ab31efacb70bed1e821f7435626e0b2528a6

Now, this is anti-social:

Busywait for request completion limit (ns)
(DRM_I915_MAX_REQUEST_BUSYWAIT) [8000] (NEW)

How should I know what to answer here (or the others)

Interval between heartbeat pulses (ms) (DRM_I915_HEARTBEAT_INTERVAL) [2500] 2500
Preempt timeout (ms, jiffy granularity) (DRM_I915_PREEMPT_TIMEOUT) [640] 640

I just took the defaults.. but... 

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] 5.7-rc0: hangs while attempting to run X

2020-04-03 Thread Chris Wilson
Quoting Pavel Machek (2020-04-03 10:14:30)
> Hi!
> 
> > > > Hardware is thinkpad x220. I had this crash few days ago. And today I
> > > > have similar-looking one, with slightly newer kernel. (Will post
> > > > as a follow-up).
> > 
> > As part of quest for working system, I tried 5.7-rc0, based on
> > 
> > Merge: 50a5de895dbe b4d8ddf8356d
> > Author: Linus Torvalds 
> > Date:   Wed Apr 1 18:18:18 2020 -0700
> > 
> > It hangs in userspace, at a time when X should be starting, and I'm
> > looking at blinking cursor.
> > 
> > 5.6-rcs worked, I'll test 5.6-final.
> 
> 5.6-final works.
> 
> Hmm...
> 
> commit f365ab31efacb70bed1e821f7435626e0b2528a6
> Merge: 4646de87d325 59e7a8cc2dcf
> Author: Linus Torvalds 
> Date:   Wed Apr 1 15:24:20 2020 -0700
> 
> Merge tag 'drm-next-2020-04-01' of git://anongit.freedesktop.org/drm/drm
> 
> Let me test 4646de87d32526ee87b46c2e0130413367fb5362...that one works.
> 
> Ok, so obviously... I should
> test... f365ab31efacb70bed1e821f7435626e0b2528a6
> 
> Now, this is anti-social:
> 
> Busywait for request completion limit (ns)
> (DRM_I915_MAX_REQUEST_BUSYWAIT) [8000] (NEW)
> 
> How should I know what to answer here (or the others)
> 
> Interval between heartbeat pulses (ms) (DRM_I915_HEARTBEAT_INTERVAL) [2500] 
> 2500
> Preempt timeout (ms, jiffy granularity) (DRM_I915_PREEMPT_TIMEOUT) [640] 640
> 
> I just took the defaults.. but... 

It is _deep_ under EXPERT.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] kernel 5.6: baytrail hdmi audio not working

2020-04-03 Thread Greg KH
On Thu, Apr 02, 2020 at 10:53:36AM -0400, Giacomo Comes wrote:
> On Thu, Apr 02, 2020 at 04:52:03PM +0300, Ville Syrjälä wrote:
> > On Wed, Apr 01, 2020 at 06:53:17PM -0400, Giacomo Comes wrote:
> > > Hi,
> > > on my Intel Compute Stick STCK1 (baytrail hdmi audio) 
> > > sound is not working with the kernel 5.6
> > > 
> > > I have bisected the kernel and I found the commit that introduced the 
> > > issue:
> > > 
> > > commit 58d124ea2739e1440ddd743d46c470fe724aca9a
> > > Author: Maarten Lankhorst 
> > > Date:   Thu Oct 31 12:26:04 2019 +0100
> > > 
> > > drm/i915: Complete crtc hw/uapi split, v6.
> > > 
> > > Now that we separated everything into uapi and hw, it's
> > > time to make the split definitive. Remove the union and
> > > make a copy of the hw state on modeset and fastset.
> > > 
> > > Color blobs are copied in crtc atomic_check(), right
> > > before color management is checked.
> > > 
> > > If more information is required please let me know.
> > 
> > Should hopefully be fixed with
> > commit 2bdd4c28baff ("drm/i915/display: Fix mode private_flags
> > comparison at atomic_check")
> > 
> > Stable folks, please pick that up for 5.6.x stable releases.
> 
> I can confirm that the commit indeed solves the problem I have.
> It should go in the stable 5.6.x release ASAP.

Now queued up, thanks.

greg k-h
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.IGT: failure for i915 lpsp support for lpsp igt (rev6)

2020-04-03 Thread Patchwork
== Series Details ==

Series: i915 lpsp support for lpsp igt (rev6)
URL   : https://patchwork.freedesktop.org/series/74648/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8228_full -> Patchwork_17155_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17155_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17155_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17155_full:

### IGT changes ###

 Possible regressions 

  * {igt@i915_pm_lpsp@non-edp-lpsp} (NEW):
- shard-tglb: NOTRUN -> [SKIP][1]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-tglb1/igt@i915_pm_l...@non-edp-lpsp.html
- shard-iclb: NOTRUN -> [SKIP][2]
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb6/igt@i915_pm_l...@non-edp-lpsp.html

  * igt@i915_pm_rpm@modeset-lpsp-stress-no-wait:
- shard-iclb: [PASS][3] -> [SKIP][4] +1 similar issue
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb3/igt@i915_pm_...@modeset-lpsp-stress-no-wait.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb7/igt@i915_pm_...@modeset-lpsp-stress-no-wait.html

  * igt@runner@aborted:
- shard-tglb: NOTRUN -> [FAIL][5]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-tglb1/igt@run...@aborted.html

  
 Warnings 

  * igt@i915_pm_lpsp@screens-disabled:
- shard-snb:  [SKIP][6] ([fdo#109271]) -> [FAIL][7]
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-snb2/igt@i915_pm_l...@screens-disabled.html
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-snb4/igt@i915_pm_l...@screens-disabled.html

  
New tests
-

  New tests have been introduced between CI_DRM_8228_full and 
Patchwork_17155_full:

### New IGT tests (1) ###

  * igt@i915_pm_lpsp@non-edp-lpsp:
- Statuses : 4 pass(s) 3 skip(s)
- Exec time: [0.0, 0.77] s

  

Known issues


  Here are the changes found in Patchwork_17155_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_busy@busy-vcs1:
- shard-iclb: [PASS][8] -> [SKIP][9] ([fdo#112080]) +8 similar 
issues
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb1/igt@gem_b...@busy-vcs1.html
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb6/igt@gem_b...@busy-vcs1.html

  * igt@gem_exec_schedule@implicit-both-bsd1:
- shard-iclb: [PASS][10] -> [SKIP][11] ([fdo#109276] / [i915#677]) 
+1 similar issue
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb2/igt@gem_exec_sched...@implicit-both-bsd1.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb6/igt@gem_exec_sched...@implicit-both-bsd1.html

  * igt@gem_exec_schedule@in-order-bsd2:
- shard-iclb: [PASS][12] -> [SKIP][13] ([fdo#109276]) +10 similar 
issues
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb2/igt@gem_exec_sched...@in-order-bsd2.html
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb8/igt@gem_exec_sched...@in-order-bsd2.html

  * igt@gem_exec_schedule@pi-distinct-iova-bsd:
- shard-iclb: [PASS][14] -> [SKIP][15] ([i915#677]) +1 similar issue
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb8/igt@gem_exec_sched...@pi-distinct-iova-bsd.html
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb1/igt@gem_exec_sched...@pi-distinct-iova-bsd.html

  * igt@gem_exec_schedule@preempt-bsd:
- shard-iclb: [PASS][16] -> [SKIP][17] ([fdo#112146]) +5 similar 
issues
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-iclb3/igt@gem_exec_sched...@preempt-bsd.html
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-iclb1/igt@gem_exec_sched...@preempt-bsd.html

  * igt@gem_exec_suspend@basic-s3:
- shard-kbl:  [PASS][18] -> [DMESG-WARN][19] ([i915#180] / 
[i915#93] / [i915#95])
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-kbl3/igt@gem_exec_susp...@basic-s3.html
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-kbl1/igt@gem_exec_susp...@basic-s3.html

  * igt@i915_pm_rc6_residency@rc6-idle:
- shard-snb:  [PASS][20] -> [TIMEOUT][21] ([i915#1526])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/shard-snb6/igt@i915_pm_rc6_reside...@rc6-idle.html
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17155/shard-snb5/igt@i915_pm_rc6_reside...@rc6-idle.html
- sha

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Check current i915_vma.pin_count status first on unbind (rev4)

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915: Check current i915_vma.pin_count status first on unbind (rev4)
URL   : https://patchwork.freedesktop.org/series/72529/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8243 -> Patchwork_17196


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17196 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17196, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17196/index.html

Possible new issues
---

  Here are the unknown changes that may have been introduced in Patchwork_17196:

### IGT changes ###

 Possible regressions 

  * igt@i915_selftest@live@gt_mocs:
- fi-ivb-3770:NOTRUN -> [INCOMPLETE][1]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17196/fi-ivb-3770/igt@i915_selftest@live@gt_mocs.html

  * igt@i915_selftest@live@gtt:
- fi-ilk-650: [PASS][2] -> [INCOMPLETE][3]
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-ilk-650/igt@i915_selftest@l...@gtt.html
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17196/fi-ilk-650/igt@i915_selftest@l...@gtt.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-cml-u2:  [PASS][4] -> [DMESG-WARN][5]
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-cml-u2/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-atomic.html
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17196/fi-cml-u2/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-atomic.html

  * igt@runner@aborted:
- fi-ilk-650: NOTRUN -> [FAIL][6]
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17196/fi-ilk-650/igt@run...@aborted.html

  
Known issues


  Here are the changes found in Patchwork_17196 that come from known issues:

### IGT changes ###

 Possible fixes 

  * igt@i915_pm_rpm@module-reload:
- fi-icl-dsi: [INCOMPLETE][7] ([i915#189]) -> [PASS][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-icl-dsi/igt@i915_pm_...@module-reload.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17196/fi-icl-dsi/igt@i915_pm_...@module-reload.html

  * igt@i915_selftest@live@execlists:
- fi-bxt-dsi: [INCOMPLETE][9] ([i915#656]) -> [PASS][10]
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-bxt-dsi/igt@i915_selftest@l...@execlists.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17196/fi-bxt-dsi/igt@i915_selftest@l...@execlists.html

  
  [i915#189]: https://gitlab.freedesktop.org/drm/intel/issues/189
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656


Participating hosts (41 -> 44)
--

  Additional (8): fi-skl-6770hq fi-snb-2520m fi-ivb-3770 fi-cfl-8109u 
fi-skl-lmem fi-kbl-7560u fi-byt-n2820 fi-skl-6600u 
  Missing(5): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper 
fi-bdw-samus 


Build changes
-

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_8243 -> Patchwork_17196

  CI-20190529: 20190529
  CI_DRM_8243: 45ccb1b8606b6ba1a5d4f8a8b4dda27bd8dbb04c @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5560: 213062c7dcf0cbc8069cbb5f91acbc494def33fd @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_17196: e6a263b61da901a7c10aca793f55d0d3e1d897e2 @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

e6a263b61da9 drm/i915: Check current i915_vma.pin_count status first on unbind

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17196/index.html
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/10] drm/i915/selftests: Add request throughput measurement to perf

2020-04-03 Thread Patchwork
== Series Details ==

Series: series starting with [01/10] drm/i915/selftests: Add request throughput 
measurement to perf
URL   : https://patchwork.freedesktop.org/series/75452/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
9b51ead71e1a drm/i915/selftests: Add request throughput measurement to perf
-:96: WARNING:LINE_SPACING: Missing a blank line after declarations
#96: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1525:
+   struct perf_series *ps = arg;
+   IGT_TIMEOUT(end_time);

-:130: WARNING:LINE_SPACING: Missing a blank line after declarations
#130: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1559:
+   struct i915_request *prev = NULL;
+   IGT_TIMEOUT(end_time);

-:165: WARNING:LINE_SPACING: Missing a blank line after declarations
#165: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1594:
+   struct perf_series *ps = arg;
+   IGT_TIMEOUT(end_time);

-:188: WARNING:LINE_SPACING: Missing a blank line after declarations
#188: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1617:
+   struct drm_i915_private *i915 = arg;
+   static int (* const func[])(void *arg) = {

-:196: WARNING:LINE_SPACING: Missing a blank line after declarations
#196: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1625:
+   struct intel_engine_cs *engine;
+   int (* const *fn)(void *arg);

-:325: WARNING:LINE_SPACING: Missing a blank line after declarations
#325: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1754:
+   struct intel_context *ce;
+   IGT_TIMEOUT(end_time);

-:393: WARNING:LINE_SPACING: Missing a blank line after declarations
#393: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1822:
+   struct intel_context *ce;
+   IGT_TIMEOUT(end_time);

-:462: WARNING:LINE_SPACING: Missing a blank line after declarations
#462: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1891:
+   struct intel_context *ce;
+   IGT_TIMEOUT(end_time);

-:518: WARNING:LINE_SPACING: Missing a blank line after declarations
#518: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1947:
+   struct drm_i915_private *i915 = arg;
+   static int (* const func[])(void *arg) = {

-:526: WARNING:LINE_SPACING: Missing a blank line after declarations
#526: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:1955:
+   struct intel_engine_cs *engine;
+   int (* const *fn)(void *arg);

-:571: WARNING:YIELD: Using yield() is generally wrong. See yield() kernel-doc 
(sched/core.c)
#571: FILE: drivers/gpu/drm/i915/selftests/i915_request.c:2000:
+   yield(); /* start all threads before we kthread_stop() */

total: 0 errors, 11 warnings, 0 checks, 611 lines checked
1401910d33b8 drm/i915/gt: Yield the timeslice if caught waiting on a user 
semaphore
db3b61d6 dma-buf: Prettify typecasts for dma-fence-chain
42c9e1350031 dma-buf: Report signaled links inside dma-fence-chain
ae8934bfc404 dma-buf: Exercise dma-fence-chain under selftests
-:33: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does 
MAINTAINERS need updating?
#33: 
new file mode 100644

-:61: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment
#61: FILE: drivers/dma-buf/st-dma-fence-chain.c:24:
+   spinlock_t lock;

-:235: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to 
using 'find_seqno', this function's name, in a string
#235: FILE: drivers/dma-buf/st-dma-fence-chain.c:198:
+   pr_err("Reported %d for find_seqno(0)!\n", err);

-:244: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to 
using 'find_seqno', this function's name, in a string
#244: FILE: drivers/dma-buf/st-dma-fence-chain.c:207:
+   pr_err("Reported %d for find_seqno(%d:%d)!\n",

-:249: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to 
using 'find_seqno', this function's name, in a string
#249: FILE: drivers/dma-buf/st-dma-fence-chain.c:212:
+   pr_err("Incorrect fence reported by 
find_seqno(%d:%d)\n",

-:272: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to 
using 'find_seqno', this function's name, in a string
#272: FILE: drivers/dma-buf/st-dma-fence-chain.c:235:
+   pr_err("Error not reported for future fence: 
find_seqno(%d:%d)!\n",

-:286: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to 
using 'find_seqno', this function's name, in a string
#286: FILE: drivers/dma-buf/st-dma-fence-chain.c:249:
+   pr_err("Incorrect fence reported by 
find_seqno(%d:%d)\n",

-:737: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to 
using 'dma_fence_chain', this function's name, in a string
#737: FILE: drivers/dma-buf/st-dma-fence-chain.c:700:
+   pr_info("sizeof(dma_fence_chain)=%zu\n",

total: 0 errors, 7 warnings, 1 checks, 725 lines checked
ecffda61d51b dma-buf: Proxy fence, an unsignaled fence placeholder
-:45: WARNING:FILE_PATH_CHANGES: added, moved or deleted f

[Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [CI,1/3] drm/i915/gt: Only wait for GPU activity before unbinding a GGTT fence

2020-04-03 Thread Patchwork
== Series Details ==

Series: series starting with [CI,1/3] drm/i915/gt: Only wait for GPU activity 
before unbinding a GGTT fence
URL   : https://patchwork.freedesktop.org/series/75383/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8234_full -> Patchwork_17172_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17172_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17172_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17172_full:

### IGT changes ###

 Possible regressions 

  * igt@gem_mmap_gtt@cpuset-big-copy-xy:
- shard-skl:  [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8234/shard-skl10/igt@gem_mmap_...@cpuset-big-copy-xy.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17172/shard-skl2/igt@gem_mmap_...@cpuset-big-copy-xy.html

  * igt@gem_mmap_gtt@hang:
- shard-snb:  [PASS][3] -> [FAIL][4] +1 similar issue
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8234/shard-snb2/igt@gem_mmap_...@hang.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17172/shard-snb2/igt@gem_mmap_...@hang.html
- shard-iclb: [PASS][5] -> [FAIL][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8234/shard-iclb1/igt@gem_mmap_...@hang.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17172/shard-iclb2/igt@gem_mmap_...@hang.html

  * igt@gem_tiled_swapping@non-threaded:
- shard-apl:  [PASS][7] -> [FAIL][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8234/shard-apl3/igt@gem_tiled_swapp...@non-threaded.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17172/shard-apl4/igt@gem_tiled_swapp...@non-threaded.html

  
New tests
-

  New tests have been introduced between CI_DRM_8234_full and 
Patchwork_17172_full:

### New IGT tests (27) ###

  * igt@gem_busy@busy:
- Statuses :
- Exec time: [None] s

  * igt@gem_exec_reloc@basic-spin:
- Statuses :
- Exec time: [None] s

  * igt@gem_exec_schedule@implicit-write-read:
- Statuses :
- Exec time: [None] s

  * igt@i915_hangman@error-state-capture:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-accuracy-2:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-accuracy-50:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-accuracy-98:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-check-all:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-double-start:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-hang:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-idle:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-no-semaphores:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-start:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@enable-race:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@idle:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@idle-no-semaphores:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@init-sema:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@init-wait:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@most-busy-check-all:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@most-busy-idle-check-all:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@multi-client:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@render-node-busy:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@render-node-busy-idle:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@semaphore-busy:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@semaphore-wait:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@semaphore-wait-idle:
- Statuses :
- Exec time: [None] s

  

Known issues


  Here are the changes found in Patchwork_17172_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_cs_tlb@vcs1:
- shard-iclb: [PASS][9] -> [SKIP][10] ([fdo#112080])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8234/shard-iclb4/igt@gem_cs_...@vcs1.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17172/shard-iclb5/igt@gem_cs_...@vcs1.html

  * igt@gem_eio@in-flight-1us:
- shard-skl:  [PASS][11] -> [INCOMPLETE][12] ([i915#1098])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8234/shard-skl7/igt@gem_...@in-flight-1us.html
   [12]: 
https://

[Intel-gfx] 5.7-rc0: regression caused by drm tree, hangs while attempting to run X

2020-04-03 Thread Pavel Machek
Hi!

> > > > Hardware is thinkpad x220. I had this crash few days ago. And today I
> > > > have similar-looking one, with slightly newer kernel. (Will post
> > > > as a follow-up).
> > 
> > As part of quest for working system, I tried 5.7-rc0, based on
> > 
> > Merge: 50a5de895dbe b4d8ddf8356d
> > Author: Linus Torvalds 
> > Date:   Wed Apr 1 18:18:18 2020 -0700
> > 
> > It hangs in userspace, at a time when X should be starting, and I'm
> > looking at blinking cursor.
> > 
> > 5.6-rcs worked, I'll test 5.6-final.
> 
> 5.6-final works.
> 
> Hmm...
> 
> commit f365ab31efacb70bed1e821f7435626e0b2528a6
> Merge: 4646de87d325 59e7a8cc2dcf
> Author: Linus Torvalds 
> Date:   Wed Apr 1 15:24:20 2020 -0700
> 
> Merge tag 'drm-next-2020-04-01' of git://anongit.freedesktop.org/drm/drm
> 
> Let me test 4646de87d32526ee87b46c2e0130413367fb5362...that one works.
> 
> Ok, so obviously... I should
> test... f365ab31efacb70bed1e821f7435626e0b2528a6

f365ab31efacb70bed1e821f7435626e0b2528a6 is broken, and it is the
first broken merge. next-0403 is also broken.

Any ideas, besides the b-word?

Would c0ca be good commit for testing? 

commit 700d6ab987f3b5e28b13b5993e5a9a975c5604e2
Merge: c0ca5437c509 2bdd4c28baff
Author: Dave Airlie 
Date:   Mon Mar 30 15:56:03 2020 +1000

Merge tag 'drm-intel-next-fixes-2020-03-27' of git://anongit.freedesktop.org
/drm/drm-intel into drm-next

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [01/10] drm/i915/selftests: Add request throughput measurement to perf

2020-04-03 Thread Patchwork
== Series Details ==

Series: series starting with [01/10] drm/i915/selftests: Add request throughput 
measurement to perf
URL   : https://patchwork.freedesktop.org/series/75452/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8243 -> Patchwork_17197


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17197/index.html

New tests
-

  New tests have been introduced between CI_DRM_8243 and Patchwork_17197:

### New IGT tests (2) ###

  * igt@dmabuf@all@dma_fence_chain:
- Statuses : 43 pass(s)
- Exec time: [7.43, 32.02] s

  * igt@dmabuf@all@dma_fence_proxy:
- Statuses : 43 pass(s)
- Exec time: [0.03, 0.12] s

  

Known issues


  Here are the changes found in Patchwork_17197 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@kms_chamelium@common-hpd-after-suspend:
- fi-cml-u2:  [PASS][1] -> [DMESG-WARN][2] ([IGT#4])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-cml-u2/igt@kms_chamel...@common-hpd-after-suspend.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17197/fi-cml-u2/igt@kms_chamel...@common-hpd-after-suspend.html

  * igt@kms_chamelium@dp-edid-read:
- fi-cml-u2:  [PASS][3] -> [FAIL][4] ([i915#976])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-cml-u2/igt@kms_chamel...@dp-edid-read.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17197/fi-cml-u2/igt@kms_chamel...@dp-edid-read.html

  
 Possible fixes 

  * igt@i915_pm_rpm@module-reload:
- fi-icl-dsi: [INCOMPLETE][5] ([i915#189]) -> [PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-icl-dsi/igt@i915_pm_...@module-reload.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17197/fi-icl-dsi/igt@i915_pm_...@module-reload.html

  * igt@i915_selftest@live@execlists:
- fi-bxt-dsi: [INCOMPLETE][7] ([i915#656]) -> [PASS][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8243/fi-bxt-dsi/igt@i915_selftest@l...@execlists.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17197/fi-bxt-dsi/igt@i915_selftest@l...@execlists.html

  
  [IGT#4]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/4
  [i915#189]: https://gitlab.freedesktop.org/drm/intel/issues/189
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656
  [i915#976]: https://gitlab.freedesktop.org/drm/intel/issues/976


Participating hosts (41 -> 44)
--

  Additional (9): fi-skl-6770hq fi-bwr-2160 fi-snb-2520m fi-ivb-3770 
fi-cfl-8109u fi-skl-lmem fi-kbl-7560u fi-byt-n2820 fi-skl-6600u 
  Missing(6): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-kbl-x1275 
fi-byt-clapper fi-bdw-samus 


Build changes
-

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_8243 -> Patchwork_17197

  CI-20190529: 20190529
  CI_DRM_8243: 45ccb1b8606b6ba1a5d4f8a8b4dda27bd8dbb04c @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5560: 213062c7dcf0cbc8069cbb5f91acbc494def33fd @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_17197: 48a06c080f4b9055f83ac771df1ec5506b72bb9c @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

48a06c080f4b drm/i915/gt: Declare when we enabled timeslicing
fa98e5774e0e drm/i915/gem: Allow combining submit-fences with syncobj
7889ebb21db1 drm/i915/gem: Teach execbuf how to wait on future syncobj
537c5a3fd9bc drm/syncobj: Allow use of dma-fence-proxy
ecffda61d51b dma-buf: Proxy fence, an unsignaled fence placeholder
ae8934bfc404 dma-buf: Exercise dma-fence-chain under selftests
42c9e1350031 dma-buf: Report signaled links inside dma-fence-chain
db3b61d6 dma-buf: Prettify typecasts for dma-fence-chain
1401910d33b8 drm/i915/gt: Yield the timeslice if caught waiting on a user 
semaphore
9b51ead71e1a drm/i915/selftests: Add request throughput measurement to perf

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17197/index.html
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/gem: Drop cached obj->bind_count (rev3)

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915/gem: Drop cached obj->bind_count (rev3)
URL   : https://patchwork.freedesktop.org/series/74593/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8235_full -> Patchwork_17173_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17173_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17173_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17173_full:

### IGT changes ###

 Possible regressions 

  * igt@gem_tiled_swapping@non-threaded:
- shard-hsw:  [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-hsw6/igt@gem_tiled_swapp...@non-threaded.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-hsw1/igt@gem_tiled_swapp...@non-threaded.html

  
 Suppressed 

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * {igt@gem_wait@write-busy@all}:
- shard-glk:  [PASS][3] -> [FAIL][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-glk4/igt@gem_wait@write-b...@all.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-glk2/igt@gem_wait@write-b...@all.html

  
New tests
-

  New tests have been introduced between CI_DRM_8235_full and 
Patchwork_17173_full:

### New IGT tests (1) ###

  * igt@perf_pmu@busy-double-start:
- Statuses :
- Exec time: [None] s

  

Known issues


  Here are the changes found in Patchwork_17173_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_cs_tlb@vcs1:
- shard-iclb: [PASS][5] -> [SKIP][6] ([fdo#112080])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-iclb2/igt@gem_cs_...@vcs1.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-iclb8/igt@gem_cs_...@vcs1.html

  * igt@i915_selftest@live@requests:
- shard-tglb: [PASS][7] -> [INCOMPLETE][8] ([i915#1531])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-tglb1/igt@i915_selftest@l...@requests.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-tglb7/igt@i915_selftest@l...@requests.html

  * igt@i915_suspend@debugfs-reader:
- shard-skl:  [PASS][9] -> [INCOMPLETE][10] ([i915#69])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-skl5/igt@i915_susp...@debugfs-reader.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-skl9/igt@i915_susp...@debugfs-reader.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-kbl:  [PASS][11] -> [DMESG-WARN][12] ([i915#180]) +3 
similar issues
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-kbl4/igt@kms_cursor_...@pipe-c-cursor-suspend.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-kbl4/igt@kms_cursor_...@pipe-c-cursor-suspend.html
- shard-apl:  [PASS][13] -> [DMESG-WARN][14] ([i915#180]) +2 
similar issues
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-apl3/igt@kms_cursor_...@pipe-c-cursor-suspend.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-apl6/igt@kms_cursor_...@pipe-c-cursor-suspend.html

  * igt@kms_cursor_legacy@2x-flip-vs-cursor-atomic:
- shard-glk:  [PASS][15] -> [FAIL][16] ([i915#72])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-glk5/igt@kms_cursor_leg...@2x-flip-vs-cursor-atomic.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-glk6/igt@kms_cursor_leg...@2x-flip-vs-cursor-atomic.html

  * igt@kms_fbcon_fbt@fbc-suspend:
- shard-kbl:  [PASS][17] -> [DMESG-WARN][18] ([i915#180] / 
[i915#93] / [i915#95])
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-kbl1/igt@kms_fbcon_...@fbc-suspend.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-kbl3/igt@kms_fbcon_...@fbc-suspend.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-skl:  [PASS][19] -> [FAIL][20] ([i915#46])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-skl3/igt@kms_f...@flip-vs-expired-vblank-interruptible.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17173/shard-skl2/igt@kms_f...@flip-vs-expired-vblank-interruptible.html

  * igt@kms_hdr@bpc-switch:
- shard-skl:  [PASS][21] -> [FAIL][22] ([i915#1188])
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8235/shard-skl10/igt@kms_...@bpc-switch.html
   [22]: 
https://intel-gfx-ci.01.org/tree/drm

Re: [Intel-gfx] 5.7-rc0: regression caused by drm tree, hangs while attempting to run X

2020-04-03 Thread Pavel Machek
Hi!

> > commit f365ab31efacb70bed1e821f7435626e0b2528a6
> > Merge: 4646de87d325 59e7a8cc2dcf
> > Author: Linus Torvalds 
> > Date:   Wed Apr 1 15:24:20 2020 -0700
> > 
> > Merge tag 'drm-next-2020-04-01' of
> > git://anongit.freedesktop.org/drm/drm


> Any ideas, besides the b-word?
> 
> Would c0ca be good commit for testing?
> 
> commit 700d6ab987f3b5e28b13b5993e5a9a975c5604e2
> Merge: c0ca5437c509 2bdd4c28baff

c0ca is broken.

commit 9001b17698d86f842e2b13e0cafe8021d43209e9
Merge: bda1fb0ed000 217a485c8399

Merge tag 'drm-intel-next-2020-03-13' of git://anongit.freedesktop.org/drm/d
rm-intel into drm-next

UAPI Changes:

So bda1fb0ed000 looks like test candidate... and that one works.

I guess 217a485c8399 is reasonable next step... and that
11a48a5a18c63fd7621bb050228cebf13566e4d8 should work ok. 

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Remove WARN_ON and WARN_ON_ONCE overrides.

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915: Remove WARN_ON and WARN_ON_ONCE overrides.
URL   : https://patchwork.freedesktop.org/series/75390/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8236_full -> Patchwork_17174_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17174_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17174_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17174_full:

### IGT changes ###

 Possible regressions 

  * igt@gem_mmap_gtt@cpuset-basic-small-copy-odd:
- shard-skl:  [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-skl8/igt@gem_mmap_...@cpuset-basic-small-copy-odd.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17174/shard-skl1/igt@gem_mmap_...@cpuset-basic-small-copy-odd.html

  * igt@gem_tiled_swapping@non-threaded:
- shard-apl:  [PASS][3] -> [FAIL][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-apl8/igt@gem_tiled_swapp...@non-threaded.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17174/shard-apl2/igt@gem_tiled_swapp...@non-threaded.html
- shard-iclb: [PASS][5] -> [FAIL][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-iclb6/igt@gem_tiled_swapp...@non-threaded.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17174/shard-iclb2/igt@gem_tiled_swapp...@non-threaded.html
- shard-kbl:  [PASS][7] -> [FAIL][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-kbl2/igt@gem_tiled_swapp...@non-threaded.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17174/shard-kbl1/igt@gem_tiled_swapp...@non-threaded.html

  
New tests
-

  New tests have been introduced between CI_DRM_8236_full and 
Patchwork_17174_full:

### New IGT tests (25) ###

  * igt@gem_busy@busy:
- Statuses :
- Exec time: [None] s

  * igt@gem_exec_reloc@basic-spin:
- Statuses :
- Exec time: [None] s

  * igt@gem_exec_schedule@implicit-write-read:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-accuracy-2:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-accuracy-50:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-accuracy-98:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-check-all:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-double-start:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-hang:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-idle:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-no-semaphores:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-start:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@enable-race:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@idle:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@idle-no-semaphores:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@init-wait:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@most-busy-check-all:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@most-busy-idle-check-all:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@multi-client:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@render-node-busy:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@render-node-busy-idle:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@semaphore-busy:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@semaphore-wait:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@semaphore-wait-idle:
- Statuses :
- Exec time: [None] s

  

Known issues


  Here are the changes found in Patchwork_17174_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_cs_tlb@vcs1:
- shard-iclb: [PASS][9] -> [SKIP][10] ([fdo#112080])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-iclb2/igt@gem_cs_...@vcs1.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17174/shard-iclb5/igt@gem_cs_...@vcs1.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-glk:  [PASS][11] -> [FAIL][12] ([i915#79])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-glk7/igt@kms_f...@2x-flip-vs-expired-vblank-interruptible.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17174/shard-glk3/igt@kms_f...@2x-flip-vs-expired-vblank-interruptible.html

  * 

Re: [Intel-gfx] [PATCH v8 04/12] perf tool: extend Perf tool with CAP_PERFMON capability support

2020-04-03 Thread Jiri Olsa
On Thu, Apr 02, 2020 at 11:47:35AM +0300, Alexey Budankov wrote:
> 
> Extend error messages to mention CAP_PERFMON capability as an option
> to substitute CAP_SYS_ADMIN capability for secure system performance
> monitoring and observability operations. Make perf_event_paranoid_check()
> and __cmd_ftrace() to be aware of CAP_PERFMON capability.
> 
> CAP_PERFMON implements the principal of least privilege for performance
> monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
> principle of least privilege: A security design principle that states
> that a process or program be granted only those privileges (e.g.,
> capabilities) necessary to accomplish its legitimate function, and only
> for the time that such privileges are actually required)
> 
> For backward compatibility reasons access to perf_events subsystem remains
> open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for
> secure perf_events monitoring is discouraged with respect to CAP_PERFMON
> capability.
> 
> Signed-off-by: Alexey Budankov 
> Reviewed-by: James Morris 

Acked-by: Jiri Olsa 

thanks,
jirka

> ---
>  tools/perf/builtin-ftrace.c |  5 +++--
>  tools/perf/design.txt   |  3 ++-
>  tools/perf/util/cap.h   |  4 
>  tools/perf/util/evsel.c | 10 +-
>  tools/perf/util/util.c  |  1 +
>  5 files changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
> index d5adc417a4ca..55eda54240fb 100644
> --- a/tools/perf/builtin-ftrace.c
> +++ b/tools/perf/builtin-ftrace.c
> @@ -284,10 +284,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int 
> argc, const char **argv)
>   .events = POLLIN,
>   };
>  
> - if (!perf_cap__capable(CAP_SYS_ADMIN)) {
> + if (!(perf_cap__capable(CAP_PERFMON) ||
> +   perf_cap__capable(CAP_SYS_ADMIN))) {
>   pr_err("ftrace only works for %s!\n",
>  #ifdef HAVE_LIBCAP_SUPPORT
> - "users with the SYS_ADMIN capability"
> + "users with the CAP_PERFMON or CAP_SYS_ADMIN capability"
>  #else
>   "root"
>  #endif
> diff --git a/tools/perf/design.txt b/tools/perf/design.txt
> index 0453ba26cdbd..a42fab308ff6 100644
> --- a/tools/perf/design.txt
> +++ b/tools/perf/design.txt
> @@ -258,7 +258,8 @@ gets schedule to. Per task counters can be created by any 
> user, for
>  their own tasks.
>  
>  A 'pid == -1' and 'cpu == x' counter is a per CPU counter that counts
> -all events on CPU-x. Per CPU counters need CAP_SYS_ADMIN privilege.
> +all events on CPU-x. Per CPU counters need CAP_PERFMON or CAP_SYS_ADMIN
> +privilege.
>  
>  The 'flags' parameter is currently unused and must be zero.
>  
> diff --git a/tools/perf/util/cap.h b/tools/perf/util/cap.h
> index 051dc590ceee..ae52878c0b2e 100644
> --- a/tools/perf/util/cap.h
> +++ b/tools/perf/util/cap.h
> @@ -29,4 +29,8 @@ static inline bool perf_cap__capable(int cap __maybe_unused)
>  #define CAP_SYSLOG   34
>  #endif
>  
> +#ifndef CAP_PERFMON
> +#define CAP_PERFMON  38
> +#endif
> +
>  #endif /* __PERF_CAP_H */
> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index 816d930d774e..2696922f06bc 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -2507,14 +2507,14 @@ int perf_evsel__open_strerror(struct evsel *evsel, 
> struct target *target,
>"You may not have permission to collect %sstats.\n\n"
>"Consider tweaking /proc/sys/kernel/perf_event_paranoid,\n"
>"which controls use of the performance events system by\n"
> -  "unprivileged users (without CAP_SYS_ADMIN).\n\n"
> +  "unprivileged users (without CAP_PERFMON or 
> CAP_SYS_ADMIN).\n\n"
>"The current value is %d:\n\n"
>"  -1: Allow use of (almost) all events by all users\n"
>"  Ignore mlock limit after perf_event_mlock_kb without 
> CAP_IPC_LOCK\n"
> -  ">= 0: Disallow ftrace function tracepoint by users without 
> CAP_SYS_ADMIN\n"
> -  "  Disallow raw tracepoint access by users without 
> CAP_SYS_ADMIN\n"
> -  ">= 1: Disallow CPU event access by users without 
> CAP_SYS_ADMIN\n"
> -  ">= 2: Disallow kernel profiling by users without 
> CAP_SYS_ADMIN\n\n"
> +  ">= 0: Disallow ftrace function tracepoint by users without 
> CAP_PERFMON or CAP_SYS_ADMIN\n"
> +  "  Disallow raw tracepoint access by users without 
> CAP_SYS_PERFMON or CAP_SYS_ADMIN\n"
> +  ">= 1: Disallow CPU event access by users without CAP_PERFMON 
> or CAP_SYS_ADMIN\n"
> +  ">= 2: Disallow kernel profiling by users without CAP_PERFMON 
> or CAP_SYS_ADMIN\n\n"
>"To make this setting permanent, edit /etc/sysctl.conf too, 
> e.g.:\n\n"
>"  kernel.perf_event_paranoid = -1\n" ,
>target->system_wide ? "system-wide " : "",
> diff --git a/tool

[Intel-gfx] ✗ Fi.CI.IGT: failure for Introduce CAP_PERFMON to secure system performance monitoring and observability (rev5)

2020-04-03 Thread Patchwork
== Series Details ==

Series: Introduce CAP_PERFMON to secure system performance monitoring and 
observability (rev5)
URL   : https://patchwork.freedesktop.org/series/72273/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8236_full -> Patchwork_17177_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17177_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17177_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17177_full:

### IGT changes ###

 Possible regressions 

  * igt@gem_ctx_persistence@engines-hang@rcs0:
- shard-tglb: [PASS][1] -> [FAIL][2] +1 similar issue
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-tglb1/igt@gem_ctx_persistence@engines-h...@rcs0.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-tglb7/igt@gem_ctx_persistence@engines-h...@rcs0.html

  * igt@gem_mmap_gtt@cpuset-medium-copy-xy:
- shard-skl:  [PASS][3] -> [FAIL][4] +2 similar issues
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-skl2/igt@gem_mmap_...@cpuset-medium-copy-xy.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-skl2/igt@gem_mmap_...@cpuset-medium-copy-xy.html

  * igt@gem_tiled_swapping@non-threaded:
- shard-glk:  [PASS][5] -> [FAIL][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-glk6/igt@gem_tiled_swapp...@non-threaded.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-glk4/igt@gem_tiled_swapp...@non-threaded.html

  
New tests
-

  New tests have been introduced between CI_DRM_8236_full and 
Patchwork_17177_full:

### New IGT tests (2) ###

  * igt@perf_pmu@busy-hang:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@multi-client:
- Statuses :
- Exec time: [None] s

  

Known issues


  Here are the changes found in Patchwork_17177_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_cs_tlb@vcs1:
- shard-iclb: [PASS][7] -> [SKIP][8] ([fdo#112080])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-iclb2/igt@gem_cs_...@vcs1.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-iclb5/igt@gem_cs_...@vcs1.html

  * igt@gem_exec_suspend@basic-s3:
- shard-apl:  [PASS][9] -> [DMESG-WARN][10] ([i915#180])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-apl4/igt@gem_exec_susp...@basic-s3.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-apl8/igt@gem_exec_susp...@basic-s3.html

  * igt@i915_suspend@fence-restore-untiled:
- shard-kbl:  [PASS][11] -> [DMESG-WARN][12] ([i915#180])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-kbl1/igt@i915_susp...@fence-restore-untiled.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-kbl7/igt@i915_susp...@fence-restore-untiled.html

  * igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-untiled:
- shard-glk:  [PASS][13] -> [FAIL][14] ([i915#52] / [i915#54])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-glk5/igt@kms_draw_...@draw-method-rgb565-mmap-gtt-untiled.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-glk9/igt@kms_draw_...@draw-method-rgb565-mmap-gtt-untiled.html

  * igt@kms_flip@flip-vs-expired-vblank:
- shard-skl:  [PASS][15] -> [FAIL][16] ([i915#79])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-skl1/igt@kms_f...@flip-vs-expired-vblank.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-skl10/igt@kms_f...@flip-vs-expired-vblank.html

  * igt@kms_hdr@bpc-switch-suspend:
- shard-skl:  [PASS][17] -> [FAIL][18] ([i915#1188])
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-skl3/igt@kms_...@bpc-switch-suspend.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-skl6/igt@kms_...@bpc-switch-suspend.html

  * igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl:  [PASS][19] -> [FAIL][20] ([fdo#108145] / [i915#265])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-skl10/igt@kms_plane_alpha_bl...@pipe-b-coverage-7efc.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17177/shard-skl10/igt@kms_plane_alpha_bl...@pipe-b-coverage-7efc.html

  * igt@kms_psr@no_drrs:
- shard-iclb: [PASS][21] -> [FAIL][22] ([i915#173])
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8236/shard-iclb4/igt@kms_psr@no_drrs.html
   [22]: 
https://intel

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Check current i915_vma.pin_count status first on unbind (rev5)

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915: Check current i915_vma.pin_count status first on unbind (rev5)
URL   : https://patchwork.freedesktop.org/series/72529/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8244 -> Patchwork_17198


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17198 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17198, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17198/index.html

Possible new issues
---

  Here are the unknown changes that may have been introduced in Patchwork_17198:

### IGT changes ###

 Possible regressions 

  * igt@i915_selftest@live@gt_heartbeat:
- fi-ivb-3770:[PASS][1] -> [INCOMPLETE][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8244/fi-ivb-3770/igt@i915_selftest@live@gt_heartbeat.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17198/fi-ivb-3770/igt@i915_selftest@live@gt_heartbeat.html

  
Known issues


  Here are the changes found in Patchwork_17198 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@i915_selftest@live@execlists:
- fi-skl-6600u:   [PASS][3] -> [INCOMPLETE][4] ([i915#656])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8244/fi-skl-6600u/igt@i915_selftest@l...@execlists.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17198/fi-skl-6600u/igt@i915_selftest@l...@execlists.html

  
 Possible fixes 

  * igt@gem_tiled_fence_blits@basic:
- fi-blb-e6850:   [DMESG-WARN][5] ([i915#1612]) -> [PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8244/fi-blb-e6850/igt@gem_tiled_fence_bl...@basic.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17198/fi-blb-e6850/igt@gem_tiled_fence_bl...@basic.html

  * igt@kms_chamelium@common-hpd-after-suspend:
- fi-cml-u2:  [DMESG-WARN][7] ([IGT#4]) -> [PASS][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8244/fi-cml-u2/igt@kms_chamel...@common-hpd-after-suspend.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17198/fi-cml-u2/igt@kms_chamel...@common-hpd-after-suspend.html

  * igt@kms_chamelium@dp-crc-fast:
- fi-icl-u2:  [FAIL][9] ([i915#262]) -> [PASS][10]
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8244/fi-icl-u2/igt@kms_chamel...@dp-crc-fast.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17198/fi-icl-u2/igt@kms_chamel...@dp-crc-fast.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-cml-u2:  [FAIL][11] ([fdo#103375]) -> [PASS][12]
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8244/fi-cml-u2/igt@kms_pipe_crc_ba...@suspend-read-crc-pipe-a.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17198/fi-cml-u2/igt@kms_pipe_crc_ba...@suspend-read-crc-pipe-a.html

  
  [IGT#4]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/4
  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [i915#1612]: https://gitlab.freedesktop.org/drm/intel/issues/1612
  [i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656


Participating hosts (48 -> 42)
--

  Additional (1): fi-kbl-7560u 
  Missing(7): fi-ilk-m540 fi-hsw-4200u fi-bsw-n3050 fi-byt-squawks 
fi-bsw-cyan fi-ilk-650 fi-bdw-samus 


Build changes
-

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_8244 -> Patchwork_17198

  CI-20190529: 20190529
  CI_DRM_8244: 55348aac86bd6f0c4ce4d3d8a0e227f6a20a72f9 @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5560: 213062c7dcf0cbc8069cbb5f91acbc494def33fd @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_17198: 76f954e0c9ad5f764d1185ebdf541609d97e0bc2 @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

76f954e0c9ad drm/i915: Check current i915_vma.pin_count status first on unbind

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17198/index.html
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t v2] lib: Fix device lists not cleaned up sufficiently before rescan

2020-04-03 Thread Janusz Krzysztofik
Some effort is already taken to clean up previous content of device
lists before forced device rescan is performed but it is not
sufficient.  An attempt to use forced device rescan in a test results
in that test crashing or spinning until being killed by OOM killer.
Fix it.

v2: Remove device from the list before device attributes are destroyed

Signed-off-by: Janusz Krzysztofik 
Reviewed-by: Zbigniew Kempczyński 
---
 lib/igt_device_scan.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c
index cf7c4d951..30a9704a5 100644
--- a/lib/igt_device_scan.c
+++ b/lib/igt_device_scan.c
@@ -353,14 +353,11 @@ static void set_vendor_device(struct igt_device *dev)
dev->device = strndup(pci_id + 5, 4);
 }
 
-/* Allocate arrays for keeping scanned devices */
+/* Initialize lists for keeping scanned devices */
 static bool prepare_scan(void)
 {
-   if (igt_devs.all.prev == NULL || igt_devs.all.next == NULL)
-   IGT_INIT_LIST_HEAD(&igt_devs.all);
-
-   if (igt_devs.filtered.prev == NULL || igt_devs.filtered.next == NULL)
-   IGT_INIT_LIST_HEAD(&igt_devs.filtered);
+   IGT_INIT_LIST_HEAD(&igt_devs.all);
+   IGT_INIT_LIST_HEAD(&igt_devs.filtered);
 
return true;
 }
@@ -595,7 +592,14 @@ void igt_devices_scan(bool force)
 {
if (force && igt_devs.devs_scanned) {
struct igt_device *dev, *tmp;
+
+   igt_list_for_each_entry_safe(dev, tmp, &igt_devs.filtered,
+link) {
+   igt_list_del(&dev->link);
+   free(dev);
+   }
igt_list_for_each_entry_safe(dev, tmp, &igt_devs.all, link) {
+   igt_list_del(&dev->link);
igt_device_free(dev);
free(dev);
}
-- 
2.21.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [CI] drm/i915: Check current i915_vma.pin_count status first on unbind

2020-04-03 Thread Chris Wilson
Do an early rejection of a i915_vma_unbind() attempt if the i915_vma is
currently pinned, without waiting to see if the inflight operations may
unpin it. We see this problem with the shrinker trying to unbind the
active vma from inside its bind worker:

<6> [472.618968] Workqueue: events_unbound fence_work [i915]
<4> [472.618970] Call Trace:
<4> [472.618974]  ? __schedule+0x2e5/0x810
<4> [472.618978]  schedule+0x37/0xe0
<4> [472.618982]  schedule_preempt_disabled+0xf/0x20
<4> [472.618984]  __mutex_lock+0x281/0x9c0
<4> [472.618987]  ? mark_held_locks+0x49/0x70
<4> [472.618989]  ? _raw_spin_unlock_irqrestore+0x47/0x60
<4> [472.619038]  ? i915_vma_unbind+0xae/0x110 [i915]
<4> [472.619084]  ? i915_vma_unbind+0xae/0x110 [i915]
<4> [472.619122]  i915_vma_unbind+0xae/0x110 [i915]
<4> [472.619165]  i915_gem_object_unbind+0x1dc/0x400 [i915]
<4> [472.619208]  i915_gem_shrink+0x328/0x660 [i915]
<4> [472.619250]  ? i915_gem_shrink_all+0x38/0x60 [i915]
<4> [472.619282]  i915_gem_shrink_all+0x38/0x60 [i915]
<4> [472.619325]  vm_alloc_page.constprop.25+0x1aa/0x240 [i915]
<4> [472.619330]  ? rcu_read_lock_sched_held+0x4d/0x80
<4> [472.619363]  ? __alloc_pd+0xb/0x30 [i915]
<4> [472.619366]  ? module_assert_mutex_or_preempt+0xf/0x30
<4> [472.619368]  ? __module_address+0x23/0xe0
<4> [472.619371]  ? is_module_address+0x26/0x40
<4> [472.619374]  ? static_obj+0x34/0x50
<4> [472.619376]  ? lockdep_init_map+0x4d/0x1e0
<4> [472.619407]  setup_page_dma+0xd/0x90 [i915]
<4> [472.619437]  alloc_pd+0x29/0x50 [i915]
<4> [472.619470]  __gen8_ppgtt_alloc+0x443/0x6b0 [i915]
<4> [472.619503]  gen8_ppgtt_alloc+0xd7/0x300 [i915]
<4> [472.619535]  ppgtt_bind_vma+0x2a/0xe0 [i915]
<4> [472.619577]  __vma_bind+0x26/0x40 [i915]
<4> [472.619611]  fence_work+0x1c/0x90 [i915]
<4> [472.619617]  process_one_work+0x26a/0x620

Fixes: 2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex")
Signed-off-by: Chris Wilson 
Cc: Tvrtko Ursulin 
Reviewed-by: Tvrtko Ursulin 
---
 drivers/gpu/drm/i915/i915_vma.c | 25 +
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 4cdd883f9d66..b02429aaf046 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -1225,18 +1225,6 @@ int __i915_vma_unbind(struct i915_vma *vma)
 
lockdep_assert_held(&vma->vm->mutex);
 
-   /*
-* First wait upon any activity as retiring the request may
-* have side-effects such as unpinning or even unbinding this vma.
-*
-* XXX Actually waiting under the vm->mutex is a hinderance and
-* should be pipelined wherever possible. In cases where that is
-* unavoidable, we should lift the wait to before the mutex.
-*/
-   ret = i915_vma_sync(vma);
-   if (ret)
-   return ret;
-
if (i915_vma_is_pinned(vma)) {
vma_print_allocator(vma, "is pinned");
return -EAGAIN;
@@ -1308,15 +1296,20 @@ int i915_vma_unbind(struct i915_vma *vma)
if (!drm_mm_node_allocated(&vma->node))
return 0;
 
-   if (i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND))
-   /* XXX not always required: nop_clear_range */
-   wakeref = intel_runtime_pm_get(&vm->i915->runtime_pm);
-
/* Optimistic wait before taking the mutex */
err = i915_vma_sync(vma);
if (err)
goto out_rpm;
 
+   if (i915_vma_is_pinned(vma)) {
+   vma_print_allocator(vma, "is pinned");
+   return -EAGAIN;
+   }
+
+   if (i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND))
+   /* XXX not always required: nop_clear_range */
+   wakeref = intel_runtime_pm_get(&vm->i915->runtime_pm);
+
err = mutex_lock_interruptible_nested(&vma->vm->mutex, !wakeref);
if (err)
goto out_rpm;
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [01/17] drm/i915/audio: use struct drm_device based logging

2020-04-03 Thread Patchwork
== Series Details ==

Series: series starting with [01/17] drm/i915/audio: use struct drm_device 
based logging
URL   : https://patchwork.freedesktop.org/series/75414/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8237_full -> Patchwork_17179_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17179_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17179_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17179_full:

### IGT changes ###

 Possible regressions 

  * igt@gem_mmap_gtt@cpuset-basic-small-copy-odd:
- shard-skl:  [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8237/shard-skl9/igt@gem_mmap_...@cpuset-basic-small-copy-odd.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17179/shard-skl7/igt@gem_mmap_...@cpuset-basic-small-copy-odd.html

  * igt@gem_tiled_swapping@non-threaded:
- shard-kbl:  [PASS][3] -> [FAIL][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8237/shard-kbl6/igt@gem_tiled_swapp...@non-threaded.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17179/shard-kbl3/igt@gem_tiled_swapp...@non-threaded.html

  
New tests
-

  New tests have been introduced between CI_DRM_8237_full and 
Patchwork_17179_full:

### New IGT tests (22) ###

  * igt@gem_busy@busy:
- Statuses :
- Exec time: [None] s

  * igt@gem_exec_schedule@implicit-write-read:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-accuracy-2:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-accuracy-50:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-accuracy-98:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-check-all:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-double-start:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-hang:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-idle:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-no-semaphores:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@busy-start:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@enable-race:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@idle:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@idle-no-semaphores:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@init-wait:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@most-busy-check-all:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@most-busy-idle-check-all:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@multi-client:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@render-node-busy:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@render-node-busy-idle:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@semaphore-busy:
- Statuses :
- Exec time: [None] s

  * igt@perf_pmu@semaphore-wait-idle:
- Statuses :
- Exec time: [None] s

  

Known issues


  Here are the changes found in Patchwork_17179_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_ctx_persistence@engines-mixed-process@vcs1:
- shard-kbl:  [PASS][5] -> [FAIL][6] ([i915#1528])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8237/shard-kbl1/igt@gem_ctx_persistence@engines-mixed-proc...@vcs1.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17179/shard-kbl4/igt@gem_ctx_persistence@engines-mixed-proc...@vcs1.html

  * igt@gem_ctx_ringsize@active@bcs0:
- shard-skl:  [PASS][7] -> [FAIL][8] ([i915#1407])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8237/shard-skl1/igt@gem_ctx_ringsize@act...@bcs0.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17179/shard-skl5/igt@gem_ctx_ringsize@act...@bcs0.html

  * igt@i915_selftest@live@requests:
- shard-tglb: [PASS][9] -> [INCOMPLETE][10] ([i915#1531])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8237/shard-tglb7/igt@i915_selftest@l...@requests.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17179/shard-tglb1/igt@i915_selftest@l...@requests.html

  * igt@kms_flip@flip-vs-expired-vblank:
- shard-glk:  [PASS][11] -> [FAIL][12] ([i915#79])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8237/shard-glk1/igt@kms_f...@flip-vs-expired-vblank.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17179/shard-glk1/igt@kms_f...@flip-vs-expired-vblank.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
- shard-sk

[Intel-gfx] [bisected] Re: 5.7-rc0: regression caused by drm tree, hangs while attempting to run X

2020-04-03 Thread Pavel Machek
Hi!

> > > commit f365ab31efacb70bed1e821f7435626e0b2528a6
> > > Merge: 4646de87d325 59e7a8cc2dcf
> > > Author: Linus Torvalds 
> > > Date:   Wed Apr 1 15:24:20 2020 -0700
> > > 
> > > Merge tag 'drm-next-2020-04-01' of
> > > git://anongit.freedesktop.org/drm/drm
> 
> 
> > Any ideas, besides the b-word?
> > 
> > Would c0ca be good commit for testing?
> > 
> > commit 700d6ab987f3b5e28b13b5993e5a9a975c5604e2
> > Merge: c0ca5437c509 2bdd4c28baff
> 
> c0ca is broken.
> 
> commit 9001b17698d86f842e2b13e0cafe8021d43209e9
> Merge: bda1fb0ed000 217a485c8399
> 
> Merge tag 'drm-intel-next-2020-03-13' of 
> git://anongit.freedesktop.org/drm/d
> rm-intel into drm-next
> 
> UAPI Changes:
> 
> So bda1fb0ed000 looks like test candidate... and that one works.
> 
> I guess 217a485c8399 is reasonable next step... and that
> 11a48a5a18c63fd7621bb050228cebf13566e4d8 should work ok. 

# bad: [217a485c8399634abacd2f138b3524d2e78e8aad] drm/i915: Update DRIVER_DATE 
to 20200313
# good: [11a48a5a18c63fd7621bb050228cebf13566e4d8] Linux 5.6-rc2
git bisect start '217a485c8399' '11a48a5a18c63fd7621bb050228cebf13566e4d8'
# good: [837b63e6087838d0f1e612d448405419199d8033] drm/i915: Program MBUS with 
rmw during initialization
git bisect good 837b63e6087838d0f1e612d448405419199d8033
# good: [3a1b82a19ff91cfef9b5d9d9faabb0ebcac15df0] drm/i915/tgl: Allow DC5/DC6 
entry while PG2 is active
git bisect good 3a1b82a19ff91cfef9b5d9d9faabb0ebcac15df0
# good: [ba518bbd3f3c265419fa8c3702940cb7c642c6a5] drm/i915: Force DPCD 
backlight mode for some Dell CML 2020 panels
git bisect good ba518bbd3f3c265419fa8c3702940cb7c642c6a5
# good: [73ce0969d1d0bc2cb53370017923640db72e70ec] drm/i915: Clean up integer 
types in color code
git bisect good 73ce0969d1d0bc2cb53370017923640db72e70ec
# bad: [aa64f8e1cf235f2e36615dba57c2c50d06181f84] drm/i915: Add 
Wa_1209644611:icl,ehl
git bisect bad aa64f8e1cf235f2e36615dba57c2c50d06181f84
# good: [32fc2849a3d59dc10efda38ef88e8f9052f711be] drm/i915/dsb: convert to 
drm_device based logging macros.
git bisect good 32fc2849a3d59dc10efda38ef88e8f9052f711be
# good: [4aea5a9e6521c1ad484992d490f1cefa7d73d1ec] drm/i915/gem: Mark up the 
racy read of the mmap_singleton
git bisect good 4aea5a9e6521c1ad484992d490f1cefa7d73d1ec
# bad: [7dc8f1143778a35b190f9413f228b3cf28f67f8d] drm/i915/gem: Drop relocation 
slowpath
git bisect bad 7dc8f1143778a35b190f9413f228b3cf28f67f8d
# good: [c02aac25f150d1b7215b9481f8cdd30cc607bedf] drm/i915/gem: Mark up 
sw-fence notify function
git bisect good c02aac25f150d1b7215b9481f8cdd30cc607bedf
# good: [07bcfd1291de77ffa9b627b4442783aba1335229] drm/i915/gen12: Disable 
preemption timeout
git bisect good 07bcfd1291de77ffa9b627b4442783aba1335229
# first bad commit: [7dc8f1143778a35b190f9413f228b3cf28f67f8d] drm/i915/gem: 
Drop relocation slowpath

Any ideas?
Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [bisected] Re: 7dc8f11437: regression in 5.7-rc0, hangs while attempting to run X

2020-04-03 Thread Pavel Machek
Hi!

7dc8f1143778a35b190f9413f228b3cf28f67f8d

drm/i915/gem: Drop relocation slowpath

Since the relocations are no longer performed under a global
struct_mutex, or any other lock, that is also held by pagefault handlers,
we can relax and allow our fast path to take a fault. As we no longer
need to abort the fast path for lock avoidance, we no longer need the
slow path handling at all.

causes regression on thinkpad x220: instead of starting X, I'm looking
at blinking cursor.

Reverting the patch on too of 919dce24701f7b3 fixes things for me.

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/gem: Utilize rcu iteration of context engines (rev3)

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915/gem: Utilize rcu iteration of context engines (rev3)
URL   : https://patchwork.freedesktop.org/series/75270/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8238_full -> Patchwork_17181_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17181_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17181_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17181_full:

### IGT changes ###

 Possible regressions 

  * igt@gem_mmap_gtt@cpuset-basic-small-copy-odd:
- shard-skl:  [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl5/igt@gem_mmap_...@cpuset-basic-small-copy-odd.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl8/igt@gem_mmap_...@cpuset-basic-small-copy-odd.html

  * igt@gem_mmap_gtt@hang:
- shard-iclb: [PASS][3] -> [FAIL][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb1/igt@gem_mmap_...@hang.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-iclb2/igt@gem_mmap_...@hang.html

  

### Piglit changes ###

 Possible regressions 

  * spec@glsl-1.20@execution@tex-miplevel-selection gl2:texture(bias) 1d (NEW):
- pig-snb-2600:   NOTRUN -> [FAIL][5]
   [5]: None

  
New tests
-

  New tests have been introduced between CI_DRM_8238_full and 
Patchwork_17181_full:

### New Piglit tests (1) ###

  * spec@glsl-1.20@execution@tex-miplevel-selection gl2:texture(bias) 1d:
- Statuses : 1 fail(s)
- Exec time: [7.83] s

  

Known issues


  Here are the changes found in Patchwork_17181_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@i915_pm_backlight@fade_with_suspend:
- shard-skl:  [PASS][6] -> [INCOMPLETE][7] ([i915#69])
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl7/igt@i915_pm_backlight@fade_with_suspend.html
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl10/igt@i915_pm_backlight@fade_with_suspend.html

  * igt@i915_selftest@live@requests:
- shard-tglb: [PASS][8] -> [INCOMPLETE][9] ([i915#1531])
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-tglb7/igt@i915_selftest@l...@requests.html
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-tglb3/igt@i915_selftest@l...@requests.html

  * igt@i915_suspend@sysfs-reader:
- shard-apl:  [PASS][10] -> [DMESG-WARN][11] ([i915#180])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl1/igt@i915_susp...@sysfs-reader.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-apl6/igt@i915_susp...@sysfs-reader.html

  * igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled:
- shard-glk:  [PASS][12] -> [FAIL][13] ([i915#52] / [i915#54])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk1/igt@kms_draw_...@draw-method-rgb565-pwrite-xtiled.html
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-glk9/igt@kms_draw_...@draw-method-rgb565-pwrite-xtiled.html

  * igt@kms_flip@plain-flip-fb-recreate-interruptible:
- shard-skl:  [PASS][14] -> [FAIL][15] ([i915#34])
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl3/igt@kms_f...@plain-flip-fb-recreate-interruptible.html
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl7/igt@kms_f...@plain-flip-fb-recreate-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl:  [PASS][16] -> [DMESG-WARN][17] ([i915#180] / 
[i915#93] / [i915#95]) +1 similar issue
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl3/igt@kms_frontbuffer_track...@fbc-suspend.html
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-kbl6/igt@kms_frontbuffer_track...@fbc-suspend.html

  * igt@kms_hdr@bpc-switch-suspend:
- shard-skl:  [PASS][18] -> [FAIL][19] ([i915#1188])
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl10/igt@kms_...@bpc-switch-suspend.html
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-skl4/igt@kms_...@bpc-switch-suspend.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-skl:  [PASS][20] -> [INCOMPLETE][21] ([i915#648] / 
[i915#69])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl4/igt@kms_pl...@plane-panning-bottom-right-suspend-pipe-a-planes.html
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17181/shard-

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Check current i915_vma.pin_count status first on unbind (rev6)

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915: Check current i915_vma.pin_count status first on unbind (rev6)
URL   : https://patchwork.freedesktop.org/series/72529/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8244 -> Patchwork_17199


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17199/index.html

Known issues


  Here are the changes found in Patchwork_17199 that come from known issues:

### IGT changes ###

 Possible fixes 

  * igt@kms_chamelium@common-hpd-after-suspend:
- fi-cml-u2:  [DMESG-WARN][1] ([IGT#4]) -> [PASS][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8244/fi-cml-u2/igt@kms_chamel...@common-hpd-after-suspend.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17199/fi-cml-u2/igt@kms_chamel...@common-hpd-after-suspend.html

  * igt@kms_chamelium@dp-crc-fast:
- fi-icl-u2:  [FAIL][3] ([i915#262]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8244/fi-icl-u2/igt@kms_chamel...@dp-crc-fast.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17199/fi-icl-u2/igt@kms_chamel...@dp-crc-fast.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-cml-u2:  [FAIL][5] ([fdo#103375]) -> [PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8244/fi-cml-u2/igt@kms_pipe_crc_ba...@suspend-read-crc-pipe-a.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17199/fi-cml-u2/igt@kms_pipe_crc_ba...@suspend-read-crc-pipe-a.html

  
  {name}: This element is suppressed. This means it is ignored when computing
  the status of the difference (SUCCESS, WARNING, or FAILURE).

  [IGT#4]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/4
  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
  [i915#34]: https://gitlab.freedesktop.org/drm/intel/issues/34


Participating hosts (48 -> 44)
--

  Additional (2): fi-kbl-7560u fi-bwr-2160 
  Missing(6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan 
fi-bsw-kefka fi-bdw-samus 


Build changes
-

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_8244 -> Patchwork_17199

  CI-20190529: 20190529
  CI_DRM_8244: 55348aac86bd6f0c4ce4d3d8a0e227f6a20a72f9 @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5560: 213062c7dcf0cbc8069cbb5f91acbc494def33fd @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_17199: 959059739471c0b4afb54f2bc9ddba88a9d7da12 @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

959059739471 drm/i915: Check current i915_vma.pin_count status first on unbind

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17199/index.html
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v8 04/12] perf tool: extend Perf tool with CAP_PERFMON capability support

2020-04-03 Thread Alexey Budankov


On 03.04.2020 14:08, Jiri Olsa wrote:
> On Thu, Apr 02, 2020 at 11:47:35AM +0300, Alexey Budankov wrote:
>>
>> Extend error messages to mention CAP_PERFMON capability as an option
>> to substitute CAP_SYS_ADMIN capability for secure system performance
>> monitoring and observability operations. Make perf_event_paranoid_check()
>> and __cmd_ftrace() to be aware of CAP_PERFMON capability.
>>
>> CAP_PERFMON implements the principal of least privilege for performance
>> monitoring and observability operations (POSIX IEEE 1003.1e 2.2.2.39
>> principle of least privilege: A security design principle that states
>> that a process or program be granted only those privileges (e.g.,
>> capabilities) necessary to accomplish its legitimate function, and only
>> for the time that such privileges are actually required)
>>
>> For backward compatibility reasons access to perf_events subsystem remains
>> open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for
>> secure perf_events monitoring is discouraged with respect to CAP_PERFMON
>> capability.
>>
>> Signed-off-by: Alexey Budankov 
>> Reviewed-by: James Morris 
> 
> Acked-by: Jiri Olsa 

Thanks! I appreciate you support.

~Alexey

> 
> thanks,
> jirka
> 
>> ---
>>  tools/perf/builtin-ftrace.c |  5 +++--
>>  tools/perf/design.txt   |  3 ++-
>>  tools/perf/util/cap.h   |  4 
>>  tools/perf/util/evsel.c | 10 +-
>>  tools/perf/util/util.c  |  1 +
>>  5 files changed, 15 insertions(+), 8 deletions(-)
>>
>> diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
>> index d5adc417a4ca..55eda54240fb 100644
>> --- a/tools/perf/builtin-ftrace.c
>> +++ b/tools/perf/builtin-ftrace.c
>> @@ -284,10 +284,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, 
>> int argc, const char **argv)
>>  .events = POLLIN,
>>  };
>>  
>> -if (!perf_cap__capable(CAP_SYS_ADMIN)) {
>> +if (!(perf_cap__capable(CAP_PERFMON) ||
>> +  perf_cap__capable(CAP_SYS_ADMIN))) {
>>  pr_err("ftrace only works for %s!\n",
>>  #ifdef HAVE_LIBCAP_SUPPORT
>> -"users with the SYS_ADMIN capability"
>> +"users with the CAP_PERFMON or CAP_SYS_ADMIN capability"
>>  #else
>>  "root"
>>  #endif
>> diff --git a/tools/perf/design.txt b/tools/perf/design.txt
>> index 0453ba26cdbd..a42fab308ff6 100644
>> --- a/tools/perf/design.txt
>> +++ b/tools/perf/design.txt
>> @@ -258,7 +258,8 @@ gets schedule to. Per task counters can be created by 
>> any user, for
>>  their own tasks.
>>  
>>  A 'pid == -1' and 'cpu == x' counter is a per CPU counter that counts
>> -all events on CPU-x. Per CPU counters need CAP_SYS_ADMIN privilege.
>> +all events on CPU-x. Per CPU counters need CAP_PERFMON or CAP_SYS_ADMIN
>> +privilege.
>>  
>>  The 'flags' parameter is currently unused and must be zero.
>>  
>> diff --git a/tools/perf/util/cap.h b/tools/perf/util/cap.h
>> index 051dc590ceee..ae52878c0b2e 100644
>> --- a/tools/perf/util/cap.h
>> +++ b/tools/perf/util/cap.h
>> @@ -29,4 +29,8 @@ static inline bool perf_cap__capable(int cap 
>> __maybe_unused)
>>  #define CAP_SYSLOG  34
>>  #endif
>>  
>> +#ifndef CAP_PERFMON
>> +#define CAP_PERFMON 38
>> +#endif
>> +
>>  #endif /* __PERF_CAP_H */
>> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
>> index 816d930d774e..2696922f06bc 100644
>> --- a/tools/perf/util/evsel.c
>> +++ b/tools/perf/util/evsel.c
>> @@ -2507,14 +2507,14 @@ int perf_evsel__open_strerror(struct evsel *evsel, 
>> struct target *target,
>>   "You may not have permission to collect %sstats.\n\n"
>>   "Consider tweaking /proc/sys/kernel/perf_event_paranoid,\n"
>>   "which controls use of the performance events system by\n"
>> - "unprivileged users (without CAP_SYS_ADMIN).\n\n"
>> + "unprivileged users (without CAP_PERFMON or 
>> CAP_SYS_ADMIN).\n\n"
>>   "The current value is %d:\n\n"
>>   "  -1: Allow use of (almost) all events by all users\n"
>>   "  Ignore mlock limit after perf_event_mlock_kb without 
>> CAP_IPC_LOCK\n"
>> - ">= 0: Disallow ftrace function tracepoint by users without 
>> CAP_SYS_ADMIN\n"
>> - "  Disallow raw tracepoint access by users without 
>> CAP_SYS_ADMIN\n"
>> - ">= 1: Disallow CPU event access by users without 
>> CAP_SYS_ADMIN\n"
>> - ">= 2: Disallow kernel profiling by users without 
>> CAP_SYS_ADMIN\n\n"
>> + ">= 0: Disallow ftrace function tracepoint by users without 
>> CAP_PERFMON or CAP_SYS_ADMIN\n"
>> + "  Disallow raw tracepoint access by users without 
>> CAP_SYS_PERFMON or CAP_SYS_ADMIN\n"
>> + ">= 1: Disallow CPU event access by users without CAP_PERFMON 
>> or CAP_SYS_ADMIN\n"
>> + ">= 2: Disallow kernel profiling by users without CAP_PERFMON 
>> or CAP_SYS_ADMIN\n\n"
>>   "To make this setting permanent, edit /etc/sysctl.co

[Intel-gfx] ✗ Fi.CI.IGT: failure for perf/core: Only copy-to-user after completely unlocking all locks, v2.

2020-04-03 Thread Patchwork
== Series Details ==

Series: perf/core: Only copy-to-user after completely unlocking all locks, v2.
URL   : https://patchwork.freedesktop.org/series/75422/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8238_full -> Patchwork_17183_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17183_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17183_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17183_full:

### IGT changes ###

 Possible regressions 

  * igt@gem_mmap_gtt@cpuset-big-copy-xy:
- shard-glk:  [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk3/igt@gem_mmap_...@cpuset-big-copy-xy.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-glk7/igt@gem_mmap_...@cpuset-big-copy-xy.html
- shard-skl:  [PASS][3] -> [FAIL][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl2/igt@gem_mmap_...@cpuset-big-copy-xy.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-skl5/igt@gem_mmap_...@cpuset-big-copy-xy.html

  * igt@gem_mmap_gtt@hang:
- shard-iclb: [PASS][5] -> [FAIL][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb1/igt@gem_mmap_...@hang.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-iclb5/igt@gem_mmap_...@hang.html

  * igt@i915_pm_rc6_residency@rc6-idle:
- shard-snb:  [PASS][7] -> [FAIL][8] +1 similar issue
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-snb6/igt@i915_pm_rc6_reside...@rc6-idle.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-snb5/igt@i915_pm_rc6_reside...@rc6-idle.html

  
 Suppressed 

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * {igt@gem_wait@wait@rcs0}:
- shard-skl:  [PASS][9] -> [FAIL][10]
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl2/igt@gem_wait@w...@rcs0.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-skl5/igt@gem_wait@w...@rcs0.html

  
Known issues


  Here are the changes found in Patchwork_17183_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_cs_tlb@vcs1:
- shard-iclb: [PASS][11] -> [SKIP][12] ([fdo#112080])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb4/igt@gem_cs_...@vcs1.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-iclb6/igt@gem_cs_...@vcs1.html

  * igt@gem_ctx_persistence@legacy-engines-mixed-process@blt:
- shard-apl:  [PASS][13] -> [FAIL][14] ([i915#1528])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl1/igt@gem_ctx_persistence@legacy-engines-mixed-proc...@blt.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-apl3/igt@gem_ctx_persistence@legacy-engines-mixed-proc...@blt.html

  * igt@i915_selftest@live@execlists:
- shard-tglb: [PASS][15] -> [DMESG-FAIL][16] ([i915#1314])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-tglb7/igt@i915_selftest@l...@execlists.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-tglb8/igt@i915_selftest@l...@execlists.html

  * igt@i915_suspend@debugfs-reader:
- shard-kbl:  [PASS][17] -> [DMESG-WARN][18] ([i915#180]) +1 
similar issue
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl6/igt@i915_susp...@debugfs-reader.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-kbl3/igt@i915_susp...@debugfs-reader.html

  * igt@kms_cursor_crc@pipe-a-cursor-64x21-offscreen:
- shard-skl:  [PASS][19] -> [FAIL][20] ([i915#54])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl6/igt@kms_cursor_...@pipe-a-cursor-64x21-offscreen.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-skl1/igt@kms_cursor_...@pipe-a-cursor-64x21-offscreen.html

  * igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled:
- shard-glk:  [PASS][21] -> [FAIL][22] ([i915#52] / [i915#54])
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk1/igt@kms_draw_...@draw-method-rgb565-pwrite-xtiled.html
   [22]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17183/shard-glk6/igt@kms_draw_...@draw-method-rgb565-pwrite-xtiled.html

  * igt@kms_flip@2x-wf_vblank-ts-check:
- shard-glk:  [PASS][23] -> [FAIL][24] ([i915#34])
   [23]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8

[Intel-gfx] [PATCH i-g-t] lib: Bump estimates for object overhead

2020-04-03 Thread Chris Wilson
We are dramatically underestimating the overhead for an active object
and its inodes.

Signed-off-by: Chris Wilson 
---
 lib/intel_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/intel_os.c b/lib/intel_os.c
index 8458d39a1..2bb0c981a 100644
--- a/lib/intel_os.c
+++ b/lib/intel_os.c
@@ -306,7 +306,7 @@ int __intel_check_memory(uint64_t count, uint64_t size, 
unsigned mode,
 uint64_t *out_required, uint64_t *out_total)
 {
 /* rough estimate of how many bytes the kernel requires to track each object */
-#define KERNEL_BO_OVERHEAD 512
+#define KERNEL_BO_OVERHEAD 8192 /* 2k for an object, 2k for an inode, etc */
uint64_t required, total;
 
required = count;
-- 
2.26.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Use per-engine request pools (rev8)

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915: Use per-engine request pools (rev8)
URL   : https://patchwork.freedesktop.org/series/75415/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8238_full -> Patchwork_17187_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17187_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17187_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17187_full:

### IGT changes ###

 Possible regressions 

  * igt@gem_mmap_gtt@cpuset-basic-small-copy-odd:
- shard-glk:  [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk3/igt@gem_mmap_...@cpuset-basic-small-copy-odd.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-glk4/igt@gem_mmap_...@cpuset-basic-small-copy-odd.html

  * igt@gem_tiled_swapping@non-threaded:
- shard-snb:  [PASS][3] -> [FAIL][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-snb6/igt@gem_tiled_swapp...@non-threaded.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-snb2/igt@gem_tiled_swapp...@non-threaded.html

  
Known issues


  Here are the changes found in Patchwork_17187_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@i915_pm_rpm@system-suspend-execbuf:
- shard-skl:  [PASS][5] -> [INCOMPLETE][6] ([i915#151] / [i915#69])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl10/igt@i915_pm_...@system-suspend-execbuf.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-skl6/igt@i915_pm_...@system-suspend-execbuf.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl:  [PASS][7] -> [DMESG-WARN][8] ([i915#180]) +4 similar 
issues
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl2/igt@kms_cursor_...@pipe-a-cursor-suspend.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-kbl6/igt@kms_cursor_...@pipe-a-cursor-suspend.html

  * igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
- shard-glk:  [PASS][9] -> [FAIL][10] ([i915#34])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk1/igt@kms_f...@2x-plain-flip-fb-recreate-interruptible.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-glk9/igt@kms_f...@2x-plain-flip-fb-recreate-interruptible.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
- shard-apl:  [PASS][11] -> [DMESG-WARN][12] ([i915#180]) +2 
similar issues
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl2/igt@kms_f...@flip-vs-suspend-interruptible.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-apl1/igt@kms_f...@flip-vs-suspend-interruptible.html

  * igt@kms_flip@plain-flip-fb-recreate-interruptible:
- shard-skl:  [PASS][13] -> [FAIL][14] ([i915#34])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl3/igt@kms_f...@plain-flip-fb-recreate-interruptible.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-skl10/igt@kms_f...@plain-flip-fb-recreate-interruptible.html

  * igt@kms_frontbuffer_tracking@psr-suspend:
- shard-skl:  [PASS][15] -> [INCOMPLETE][16] ([i915#123] / 
[i915#69])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl2/igt@kms_frontbuffer_track...@psr-suspend.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-skl8/igt@kms_frontbuffer_track...@psr-suspend.html

  * igt@kms_hdr@bpc-switch-dpms:
- shard-skl:  [PASS][17] -> [FAIL][18] ([i915#1188])
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl6/igt@kms_...@bpc-switch-dpms.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-skl6/igt@kms_...@bpc-switch-dpms.html

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl:  [PASS][19] -> [FAIL][20] ([fdo#108145] / [i915#265]) 
+1 similar issue
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl5/igt@kms_plane_alpha_bl...@pipe-a-coverage-7efc.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-skl9/igt@kms_plane_alpha_bl...@pipe-a-coverage-7efc.html

  * igt@kms_plane_cursor@pipe-a-overlay-size-128:
- shard-kbl:  [PASS][21] -> [FAIL][22] ([i915#1559] / [i915#93] / 
[i915#95])
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl7/igt@kms_plane_cur...@pipe-a-overlay-size-128.html
   [22]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17187/shard-

[Intel-gfx] [PATCH 01/44] drivers/base: Always release devres on device_del

2020-04-03 Thread Daniel Vetter
In drm we've added nice drm_device (the main gpu driver thing, which
also represents the userspace interfaces and has everything else
dangling off it) init functions using devres, devm_drm_dev_init and
soon devm_drm_dev_alloc (this patch series adds that).

A slight trouble is that drm_device itself holds a reference on the
struct device it's sitting on top (for sysfs links and dmesg debug and
lots of other things), so there's a reference loop. For real drivers
this is broken at remove/unplug time, where all devres resources are
released device_release_driver(), before the final device reference is
dropped. So far so good.

There's 2 exceptions:
- drm/vkms|vgem: Virtual drivers for which we create a fake/virtual
  platform device to make them look more like normal devices to
  userspace. These aren't drivers in the driver model sense, we simple
  create a platform_device and register it.

- drm/i915/selftests, where we create minimal mock devices, and again
  the selftests aren't proper drivers in the driver model sense.

For these two cases the reference loop isn't broken, because devres is
only cleaned up when the last device reference is dropped. But that's
not happening, because the drm_device holds that last struct device
reference.

Thus far this wasn't a problem since the above cases simply
hand-rolled their cleanup code. But I want to convert all drivers over
to the devm_ versions, hence it would be really nice if these
virtual/fake/mock uses-cases could also be managed with devres
cleanup.

I see three possible approaches:

- Clean up devres from device_del (or platform_device_unregister) even
  when no driver is bound. This seems like the simplest solution, but
  also the one with the widest impact, and what this patch implements.
  We might want to include more of the cleanup than just
  devres_release_all, but this is all I need to get my use case going.

- Create a devres group and release that when we unbind. The code in
  virtual drivers gets a bit ugly, since every error case has a
  different cleanup code until we've chained everything
  (platform_device, devres group and then drm_device) together and a
  devres_release_group takes care of everything. Doable, but a bit
  confusing when I typed it out.

- Convert the virtual drivers to real (in the device model sense)
  drivers. Feels like too much boilerplate for not much gain. And
  especially with the mock objects minimal mocking is kinda the goal,
  to limit the amount of accidentally pulled in code into our unit
  tests as much as possible.

Either way I think time to discuss this a bit and figure out what's
the recommended approach here.

Signed-off-by: Daniel Vetter 
Cc: Greg Kroah-Hartman 
Cc: "Rafael J. Wysocki" 
---
 drivers/base/dd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index b25bcab2a26b..1bcfb0ff5f44 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -1155,6 +1155,8 @@ static void __device_release_driver(struct device *dev, 
struct device *parent)
 dev);
 
kobject_uevent(&dev->kobj, KOBJ_UNBIND);
+   } else {
+   devres_release_all(dev);
}
 }
 
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 08/44] drm/vboxvideo: Stop using drm_device->dev_private

2020-04-03 Thread Daniel Vetter
We use the baseclass pattern here, so lets to the proper (and more
typesafe) upcasting.

Signed-off-by: Daniel Vetter 
Cc: Hans de Goede 
---
 drivers/gpu/drm/vboxvideo/vbox_drv.c  |  1 -
 drivers/gpu/drm/vboxvideo/vbox_drv.h  |  1 +
 drivers/gpu/drm/vboxvideo/vbox_irq.c  |  2 +-
 drivers/gpu/drm/vboxvideo/vbox_mode.c | 10 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c 
b/drivers/gpu/drm/vboxvideo/vbox_drv.c
index be0600b22cf5..d34cddd809fd 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_drv.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c
@@ -52,7 +52,6 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
return PTR_ERR(vbox);
 
vbox->ddev.pdev = pdev;
-   vbox->ddev.dev_private = vbox;
pci_set_drvdata(pdev, vbox);
mutex_init(&vbox->hw_mutex);
 
diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.h 
b/drivers/gpu/drm/vboxvideo/vbox_drv.h
index 87421903816c..ac7c2effc46f 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_drv.h
+++ b/drivers/gpu/drm/vboxvideo/vbox_drv.h
@@ -127,6 +127,7 @@ struct vbox_encoder {
 #define to_vbox_crtc(x) container_of(x, struct vbox_crtc, base)
 #define to_vbox_connector(x) container_of(x, struct vbox_connector, base)
 #define to_vbox_encoder(x) container_of(x, struct vbox_encoder, base)
+#define to_vbox_dev(x) container_of(x, struct vbox_private, ddev)
 
 bool vbox_check_supported(u16 id);
 int vbox_hw_init(struct vbox_private *vbox);
diff --git a/drivers/gpu/drm/vboxvideo/vbox_irq.c 
b/drivers/gpu/drm/vboxvideo/vbox_irq.c
index 16a1e29f5292..631657fa554f 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_irq.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_irq.c
@@ -34,7 +34,7 @@ void vbox_report_hotplug(struct vbox_private *vbox)
 irqreturn_t vbox_irq_handler(int irq, void *arg)
 {
struct drm_device *dev = (struct drm_device *)arg;
-   struct vbox_private *vbox = (struct vbox_private *)dev->dev_private;
+   struct vbox_private *vbox = to_vbox_dev(dev);
u32 host_flags = vbox_get_flags(vbox);
 
if (!(host_flags & HGSMIHOSTFLAGS_IRQ))
diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c 
b/drivers/gpu/drm/vboxvideo/vbox_mode.c
index 0883a435e62b..d9a5af62af89 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_mode.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c
@@ -36,7 +36,7 @@ static void vbox_do_modeset(struct drm_crtc *crtc)
u16 flags;
s32 x_offset, y_offset;
 
-   vbox = crtc->dev->dev_private;
+   vbox = to_vbox_dev(crtc->dev);
width = vbox_crtc->width ? vbox_crtc->width : 640;
height = vbox_crtc->height ? vbox_crtc->height : 480;
bpp = fb ? fb->format->cpp[0] * 8 : 32;
@@ -77,7 +77,7 @@ static void vbox_do_modeset(struct drm_crtc *crtc)
 static int vbox_set_view(struct drm_crtc *crtc)
 {
struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
-   struct vbox_private *vbox = crtc->dev->dev_private;
+   struct vbox_private *vbox = to_vbox_dev(crtc->dev);
struct vbva_infoview *p;
 
/*
@@ -174,7 +174,7 @@ static void vbox_crtc_set_base_and_mode(struct drm_crtc 
*crtc,
int x, int y)
 {
struct drm_gem_vram_object *gbo = drm_gem_vram_of_gem(fb->obj[0]);
-   struct vbox_private *vbox = crtc->dev->dev_private;
+   struct vbox_private *vbox = to_vbox_dev(crtc->dev);
struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
bool needs_modeset = drm_atomic_crtc_needs_modeset(crtc->state);
 
@@ -272,7 +272,7 @@ static void vbox_primary_atomic_update(struct drm_plane 
*plane,
 {
struct drm_crtc *crtc = plane->state->crtc;
struct drm_framebuffer *fb = plane->state->fb;
-   struct vbox_private *vbox = fb->dev->dev_private;
+   struct vbox_private *vbox = to_vbox_dev(fb->dev);
struct drm_mode_rect *clips;
uint32_t num_clips, i;
 
@@ -704,7 +704,7 @@ static int vbox_get_modes(struct drm_connector *connector)
int preferred_width, preferred_height;
 
vbox_connector = to_vbox_connector(connector);
-   vbox = connector->dev->dev_private;
+   vbox = to_vbox_dev(connector->dev);
 
hgsmi_report_flags_location(vbox->guest_pool, GUEST_HEAP_OFFSET(vbox) +
HOST_FLAGS_OFFSET);
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 00/44] devm_drm_dev_alloc, no more drmm_add_final_kfree

2020-04-03 Thread Daniel Vetter
Hi all,

Here's the promised follow-up to get rid of the drmm_add_final_kfree calls
from drivers. I've also sprinkled in a bunch of cleanups for the drivers
I've had to touch anyway. I think with devm_drm_dev_alloc we now have a
very neat and clean way to init the drm_device, and all the interim stage
with drm_dev_init and devm_drm_dev_init are unexported.

For reading, documenation changes are all concentrated in the last patch,
because the interim state would result in way too much shuffling and
readjusting.

The driver core patch is only required for vkms, vgem and i915/selftest
patches, everything else only needs the patch to add devm_drm_dev_alloc.
Once that's landed we can merge driver patches in any order, only the
final patch needs to wait until everything has landed.

As usual, review, testing and comments very much appreciated.

Cheers, Daniel

Daniel Vetter (44):
  drivers/base: Always release devres on device_del
  drm: Add devm_drm_dev_alloc macro
  drm/device: Deprecate dev_private harder
  drm/vgem: Use devm_drm_dev_alloc
  drm/vkms: Use devm_drm_dev_alloc
  drm/vboxvideo: drop DRM_MTRR_WC #define
  drm/vboxvideo: Use devm_drm_dev_alloc
  drm/vboxvideo: Stop using drm_device->dev_private
  drm/vboxvidoe: use managed pci functions
  drm/vboxvideo: Use devm_gen_pool_create
  drm/v3d: Don't set drm_device->dev_private
  drm/v3d: Use devm_drm_dev_alloc
  drm/v3d: Delete v3d_dev->dev
  drm/v3d: Delete v3d_dev->pdev
  drm/udl: Use demv_drm_dev_alloc
  drm/udl: don't set drm_device->dev_private
  drm/st7735r: Use devm_drm_dev_alloc
  drm/st7586: Use devm_drm_dev_alloc
  drm/repaper: Use devm_drm_dev_alloc
  drm/mi0283qt: Use devm_drm_dev_alloc
  drm/ili9486: Use devm_drm_dev_alloc
  drm/ili9341: Use devm_drm_dev_alloc
  drm/ili9225: Use devm_drm_dev_alloc
  drm/hx8357d: Use devm_drm_dev_alloc
  drm/gm12u320: Use devm_drm_dev_alloc
  drm/gm12u320: Don't use drm_device->dev_private
  drm/tidss: Use devm_drm_dev_alloc
  drm/tidss: Don't use drm_device->dev_private
  drm/tidss: Delete tidss->saved_state
  drm/qxl: Use devm_drm_dev_alloc
  drm/qxl: Don't use drm_device->dev_private
  drm/mcde: Use devm_drm_dev_alloc
  drm/mcde: Don't use drm_device->dev_private
  drm/ingenic: Use devm_drm_dev_alloc
  drm/ingenic: Don't set drm_device->dev_private
  drm/komeda: use devm_drm_dev_alloc
  drm/armada: Use devm_drm_dev_alloc
  drm/armada: Don't use drm_device->dev_private
  drm/cirrus: Use devm_drm_dev_alloc
  drm/cirrus: Don't use drm_device->dev_private
  drm/i915: Use devm_drm_dev_alloc
  drm/i915/selftest: Create mock_destroy_device
  drm/i915/selftests: align more to real device lifetimes
  drm/managed: Cleanup of unused functions and polishing docs

 .../driver-api/driver-model/devres.rst|   2 +-
 drivers/base/dd.c |   2 +
 .../gpu/drm/arm/display/komeda/komeda_kms.c   |  16 +-
 drivers/gpu/drm/armada/armada_crtc.c  |   4 +-
 drivers/gpu/drm/armada/armada_debugfs.c   |   2 +-
 drivers/gpu/drm/armada/armada_drm.h   |   2 +
 drivers/gpu/drm/armada/armada_drv.c   |  30 +---
 drivers/gpu/drm/armada/armada_fbdev.c |   4 +-
 drivers/gpu/drm/armada/armada_gem.c   |   4 +-
 drivers/gpu/drm/armada/armada_overlay.c   |   8 +-
 drivers/gpu/drm/cirrus/cirrus.c   |  22 ++-
 drivers/gpu/drm/drm_drv.c | 142 ++
 drivers/gpu/drm/drm_internal.h|   1 +
 drivers/gpu/drm/drm_managed.c |  15 +-
 .../gpu/drm/i915/gem/selftests/huge_pages.c   |   2 +-
 .../drm/i915/gem/selftests/i915_gem_context.c |   2 +-
 .../drm/i915/gem/selftests/i915_gem_dmabuf.c  |   2 +-
 .../drm/i915/gem/selftests/i915_gem_object.c  |   2 +-
 .../drm/i915/gem/selftests/i915_gem_phys.c|   2 +-
 drivers/gpu/drm/i915/gt/selftest_timeline.c   |   2 +-
 drivers/gpu/drm/i915/i915_drv.c   |  17 +--
 drivers/gpu/drm/i915/i915_pci.c   |   2 -
 .../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_request.c |   2 +-
 drivers/gpu/drm/i915/selftests/i915_vma.c |   2 +-
 .../drm/i915/selftests/intel_memory_region.c  |   2 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |  33 ++--
 .../gpu/drm/i915/selftests/mock_gem_device.h  |   5 +
 drivers/gpu/drm/ingenic/ingenic-drm.c |  15 +-
 drivers/gpu/drm/mcde/mcde_display.c   |  10 +-
 drivers/gpu/drm/mcde/mcde_drm.h   |   2 +
 drivers/gpu/drm/mcde/mcde_drv.c   |  21 +--
 drivers/gpu/drm/mcde/mcde_dsi.c   |   2 +-
 drivers/gpu/drm/qxl/qxl_debugfs.c |   7 +-
 drivers/gpu/drm/qxl/qxl_display.c |  32 ++--
 drivers/gpu/drm/qxl/qxl_drv.c |  23 +--
 drivers/gpu/drm/qxl/qxl_drv.h |   7 +-
 drivers/gpu/drm/qxl/qxl_dumb.c|   2 +-
 drivers/gpu/drm/qxl/qxl_gem.c |   2 +-
 drivers/gpu/drm/qxl/qxl_ioctl.c  

[Intel-gfx] [PATCH 05/44] drm/vkms: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
This means we also need to slightly restructure the exit code, so that
final cleanup of the drm_device is triggered by unregistering the
platform device. Note that devres is both clean up when the driver is
unbound (not the case for vkms, we don't bind), and also when unregistering
the device (very much the case for vkms). Therefore we can rely on devres
even though vkms isn't a proper platform device driver.

This also somewhat untangles the load code, since the drm and platform device
setup are no longer interleaved, but two distinct steps.

Signed-off-by: Daniel Vetter 
Cc: Rodrigo Siqueira 
Cc: Haneen Mohammed 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/vkms/vkms_drv.c | 48 +++--
 1 file changed, 16 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index eef85f1a0ce5..fec2a4b91c4d 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -61,9 +61,6 @@ static void vkms_release(struct drm_device *dev)
 {
struct vkms_device *vkms = container_of(dev, struct vkms_device, drm);
 
-   platform_device_unregister(vkms->platform);
-   drm_atomic_helper_shutdown(&vkms->drm);
-   drm_mode_config_cleanup(&vkms->drm);
destroy_workqueue(vkms->output.composer_workq);
 }
 
@@ -142,30 +139,26 @@ static int vkms_modeset_init(struct vkms_device *vkmsdev)
 static int __init vkms_init(void)
 {
int ret;
+   struct platform_device *pdev;
 
-   vkms_device = kzalloc(sizeof(*vkms_device), GFP_KERNEL);
-   if (!vkms_device)
-   return -ENOMEM;
+   pdev = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
+   if (IS_ERR(pdev))
+   return PTR_ERR(pdev);
 
-   vkms_device->platform =
-   platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
-   if (IS_ERR(vkms_device->platform)) {
-   ret = PTR_ERR(vkms_device->platform);
-   goto out_free;
+   vkms_device = devm_drm_dev_alloc(&pdev->dev, &vkms_driver,
+struct vkms_device, drm);
+   if (IS_ERR(vkms_device)) {
+   platform_device_unregister(pdev);
+   return PTR_ERR(vkms_device);
}
-
-   ret = drm_dev_init(&vkms_device->drm, &vkms_driver,
-  &vkms_device->platform->dev);
-   if (ret)
-   goto out_unregister;
-   drmm_add_final_kfree(&vkms_device->drm, vkms_device);
+   vkms_device->platform = pdev;
 
ret = dma_coerce_mask_and_coherent(vkms_device->drm.dev,
   DMA_BIT_MASK(64));
 
if (ret) {
DRM_ERROR("Could not initialize DMA support\n");
-   goto out_put;
+   return ret;
}
 
vkms_device->drm.irq_enabled = true;
@@ -173,28 +166,18 @@ static int __init vkms_init(void)
ret = drm_vblank_init(&vkms_device->drm, 1);
if (ret) {
DRM_ERROR("Failed to vblank\n");
-   goto out_put;
+   return ret;
}
 
ret = vkms_modeset_init(vkms_device);
if (ret)
-   goto out_put;
+   return ret;
 
ret = drm_dev_register(&vkms_device->drm, 0);
if (ret)
-   goto out_put;
+   return ret;
 
return 0;
-
-out_put:
-   drm_dev_put(&vkms_device->drm);
-   return ret;
-
-out_unregister:
-   platform_device_unregister(vkms_device->platform);
-out_free:
-   kfree(vkms_device);
-   return ret;
 }
 
 static void __exit vkms_exit(void)
@@ -205,7 +188,8 @@ static void __exit vkms_exit(void)
}
 
drm_dev_unregister(&vkms_device->drm);
-   drm_dev_put(&vkms_device->drm);
+   drm_atomic_helper_shutdown(&vkms_device->drm);
+   platform_device_unregister(vkms_device->platform);
 }
 
 module_init(vkms_init);
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 06/44] drm/vboxvideo: drop DRM_MTRR_WC #define

2020-04-03 Thread Daniel Vetter
Doesn't apply to upstream kernels since a rather long time.

Signed-off-by: Daniel Vetter 
Cc: Hans de Goede 
---
 drivers/gpu/drm/vboxvideo/vbox_ttm.c | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/gpu/drm/vboxvideo/vbox_ttm.c 
b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
index 976423d0c3cc..f5a06675da43 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_ttm.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
@@ -24,25 +24,13 @@ int vbox_mm_init(struct vbox_private *vbox)
return ret;
}
 
-#ifdef DRM_MTRR_WC
-   vbox->fb_mtrr = drm_mtrr_add(pci_resource_start(dev->pdev, 0),
-pci_resource_len(dev->pdev, 0),
-DRM_MTRR_WC);
-#else
vbox->fb_mtrr = arch_phys_wc_add(pci_resource_start(dev->pdev, 0),
 pci_resource_len(dev->pdev, 0));
-#endif
return 0;
 }
 
 void vbox_mm_fini(struct vbox_private *vbox)
 {
-#ifdef DRM_MTRR_WC
-   drm_mtrr_del(vbox->fb_mtrr,
-pci_resource_start(vbox->ddev.pdev, 0),
-pci_resource_len(vbox->ddev.pdev, 0), DRM_MTRR_WC);
-#else
arch_phys_wc_del(vbox->fb_mtrr);
-#endif
drm_vram_helper_release_mm(&vbox->ddev);
 }
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 04/44] drm/vgem: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
This means we also need to slightly restructure the exit code, so that
final cleanup of the drm_device is triggered by unregistering the
platform device. Note that devres is both clean up when the driver is
unbound (not the case for vgem, we don't bind), and also when unregistering
the device (very much the case for vgem). Therefore we can rely on devres
even though vgem isn't a proper platform device driver.

This also somewhat untangles the load code, since the drm and platform device
setup are no longer interleaved, but two distinct steps.

Signed-off-by: Daniel Vetter 
Cc: Daniel Vetter 
Cc: Emil Velikov 
Cc: Sean Paul 
Cc: Chris Wilson 
Cc: Sam Ravnborg 
Cc: Rob Clark 
---
 drivers/gpu/drm/vgem/vgem_drv.c | 51 ++---
 1 file changed, 15 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index ec1a8ebb6f1b..2ce3b547312a 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -427,16 +427,8 @@ static int vgem_prime_mmap(struct drm_gem_object *obj,
return 0;
 }
 
-static void vgem_release(struct drm_device *dev)
-{
-   struct vgem_device *vgem = container_of(dev, typeof(*vgem), drm);
-
-   platform_device_unregister(vgem->platform);
-}
-
 static struct drm_driver vgem_driver = {
.driver_features= DRIVER_GEM | DRIVER_RENDER,
-   .release= vgem_release,
.open   = vgem_open,
.postclose  = vgem_postclose,
.gem_free_object_unlocked   = vgem_gem_free_object,
@@ -469,48 +461,35 @@ static struct drm_driver vgem_driver = {
 static int __init vgem_init(void)
 {
int ret;
+   struct platform_device *pdev;
 
-   vgem_device = kzalloc(sizeof(*vgem_device), GFP_KERNEL);
-   if (!vgem_device)
-   return -ENOMEM;
-
-   vgem_device->platform =
-   platform_device_register_simple("vgem", -1, NULL, 0);
-   if (IS_ERR(vgem_device->platform)) {
-   ret = PTR_ERR(vgem_device->platform);
-   goto out_free;
-   }
+   pdev = platform_device_register_simple("vgem", -1, NULL, 0);
+   if (IS_ERR(pdev))
+   return PTR_ERR(vgem_device->platform);
 
-   dma_coerce_mask_and_coherent(&vgem_device->platform->dev,
+   dma_coerce_mask_and_coherent(&pdev->dev,
 DMA_BIT_MASK(64));
-   ret = drm_dev_init(&vgem_device->drm, &vgem_driver,
-  &vgem_device->platform->dev);
-   if (ret)
-   goto out_unregister;
-   drmm_add_final_kfree(&vgem_device->drm, vgem_device);
+
+   vgem_device = devm_drm_dev_alloc(&pdev->dev, &vgem_driver,
+struct vgem_device, drm);
+   if (IS_ERR(vgem_device)) {
+   platform_device_unregister(pdev);
+   return PTR_ERR(vgem_device);
+   }
+   vgem_device->platform = pdev;
 
/* Final step: expose the device/driver to userspace */
ret = drm_dev_register(&vgem_device->drm, 0);
if (ret)
-   goto out_put;
+   return ret;
 
return 0;
-
-out_put:
-   drm_dev_put(&vgem_device->drm);
-   return ret;
-
-out_unregister:
-   platform_device_unregister(vgem_device->platform);
-out_free:
-   kfree(vgem_device);
-   return ret;
 }
 
 static void __exit vgem_exit(void)
 {
drm_dev_unregister(&vgem_device->drm);
-   drm_dev_put(&vgem_device->drm);
+   platform_device_unregister(vgem_device->platform);
 }
 
 module_init(vgem_init);
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 03/44] drm/device: Deprecate dev_private harder

2020-04-03 Thread Daniel Vetter
We've had lots of conversions to embeddeding, but didn't stop using
->dev_private. Which defeats the point of this.

Signed-off-by: Daniel Vetter 
---
 include/drm/drm_device.h | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index d39132b477dd..a55874db9dd4 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -88,9 +88,12 @@ struct drm_device {
/**
 * @dev_private:
 *
-* DRM driver private data. Instead of using this pointer it is
-* recommended that drivers use drm_dev_init() and embed struct
-* &drm_device in their larger per-device structure.
+* DRM driver private data. This is deprecated and should be left set to
+* NULL.
+*
+* Instead of using this pointer it is recommended that drivers use
+* drm_dev_init() and embed struct &drm_device in their larger
+* per-device structure.
 */
void *dev_private;
 
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 09/44] drm/vboxvidoe: use managed pci functions

2020-04-03 Thread Daniel Vetter
Allows us to drop the cleanup code on the floor.

Signed-off-by: Daniel Vetter 
Cc: Hans de Goede 
---
 drivers/gpu/drm/vboxvideo/vbox_drv.c  | 6 ++
 drivers/gpu/drm/vboxvideo/vbox_main.c | 7 +--
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c 
b/drivers/gpu/drm/vboxvideo/vbox_drv.c
index d34cddd809fd..c80695c2f6c0 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_drv.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c
@@ -55,13 +55,13 @@ static int vbox_pci_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
pci_set_drvdata(pdev, vbox);
mutex_init(&vbox->hw_mutex);
 
-   ret = pci_enable_device(pdev);
+   ret = pcim_enable_device(pdev);
if (ret)
return ret;
 
ret = vbox_hw_init(vbox);
if (ret)
-   goto err_pci_disable;
+   return ret;
 
ret = vbox_mm_init(vbox);
if (ret)
@@ -93,8 +93,6 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
vbox_mm_fini(vbox);
 err_hw_fini:
vbox_hw_fini(vbox);
-err_pci_disable:
-   pci_disable_device(pdev);
return ret;
 }
 
diff --git a/drivers/gpu/drm/vboxvideo/vbox_main.c 
b/drivers/gpu/drm/vboxvideo/vbox_main.c
index 9dcab115a261..1336ab9795fc 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_main.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_main.c
@@ -71,8 +71,6 @@ static void vbox_accel_fini(struct vbox_private *vbox)
 
for (i = 0; i < vbox->num_crtcs; ++i)
vbva_disable(&vbox->vbva_info[i], vbox->guest_pool, i);
-
-   pci_iounmap(vbox->ddev.pdev, vbox->vbva_buffers);
 }
 
 /* Do we support the 4.3 plus mode hint reporting interface? */
@@ -125,7 +123,7 @@ int vbox_hw_init(struct vbox_private *vbox)
/* Create guest-heap mem-pool use 2^4 = 16 byte chunks */
vbox->guest_pool = gen_pool_create(4, -1);
if (!vbox->guest_pool)
-   goto err_unmap_guest_heap;
+   return -ENOMEM;
 
ret = gen_pool_add_virt(vbox->guest_pool,
(unsigned long)vbox->guest_heap,
@@ -168,8 +166,6 @@ int vbox_hw_init(struct vbox_private *vbox)
 
 err_destroy_guest_pool:
gen_pool_destroy(vbox->guest_pool);
-err_unmap_guest_heap:
-   pci_iounmap(vbox->ddev.pdev, vbox->guest_heap);
return ret;
 }
 
@@ -177,5 +173,4 @@ void vbox_hw_fini(struct vbox_private *vbox)
 {
vbox_accel_fini(vbox);
gen_pool_destroy(vbox->guest_pool);
-   pci_iounmap(vbox->ddev.pdev, vbox->guest_heap);
 }
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 02/44] drm: Add devm_drm_dev_alloc macro

2020-04-03 Thread Daniel Vetter
The kerneldoc is only added for this new function. Existing kerneldoc
and examples will be udated at the very end, since once all drivers
are converted over to devm_drm_dev_alloc we can unexport a lot of
interim functions and make the documentation for driver authors a lot
cleaner and less confusing. There will be only one true way to
initialize a drm_device at the end of this, which is going to be
devm_drm_dev_alloc.

Cc: Paul Kocialkowski 
Cc: Laurent Pinchart 
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/drm_drv.c | 23 +++
 include/drm/drm_drv.h | 33 +
 2 files changed, 56 insertions(+)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 1bb4f636b83c..9e60b784b3ac 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -739,6 +739,29 @@ int devm_drm_dev_init(struct device *parent,
 }
 EXPORT_SYMBOL(devm_drm_dev_init);
 
+void* __devm_drm_dev_alloc(struct device *parent, struct drm_driver *driver,
+  size_t size, size_t offset)
+{
+   void *container;
+   struct drm_device *drm;
+   int ret;
+
+   container = kzalloc(size, GFP_KERNEL);
+   if (!container)
+   return ERR_PTR(-ENOMEM);
+
+   drm = container + offset;
+   ret = devm_drm_dev_init(parent, drm, driver);
+   if (ret) {
+   kfree(container);
+   return ERR_PTR(ret);
+   }
+   drmm_add_final_kfree(drm, container);
+
+   return container;
+}
+EXPORT_SYMBOL(__devm_drm_dev_alloc);
+
 /**
  * drm_dev_alloc - Allocate new DRM device
  * @driver: DRM driver to allocate device for
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index e7c6ea261ed1..26776be5a21e 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -626,6 +626,39 @@ int devm_drm_dev_init(struct device *parent,
  struct drm_device *dev,
  struct drm_driver *driver);
 
+void* __devm_drm_dev_alloc(struct device *parent, struct drm_driver *driver,
+  size_t size, size_t offset);
+
+/**
+ * devm_drm_dev_alloc - Resource managed allocation of a &drm_device instance
+ * @parent: Parent device object
+ * @driver: DRM driver
+ * @type: the type of the struct which contains struct &drm_device
+ * @member: the name of the &drm_device within @type.
+ *
+ * This allocates and initialize a new DRM device. No device registration is 
done.
+ * Call drm_dev_register() to advertice the device to user space and register 
it
+ * with other core subsystems. This should be done last in the device
+ * initialization sequence to make sure userspace can't access an inconsistent
+ * state.
+ *
+ * The initial ref-count of the object is 1. Use drm_dev_get() and
+ * drm_dev_put() to take and drop further ref-counts.
+ *
+ * It is recommended that drivers embed &struct drm_device into their own 
device
+ * structure.
+ *
+ * Note that this manages the lifetime of the resulting &drm_device
+ * automatically using devres. The DRM device initialized with this function is
+ * automatically put on driver detach using drm_dev_put().
+ *
+ * RETURNS:
+ * Pointer to new DRM device, or ERR_PTR on failure.
+ */
+#define devm_drm_dev_alloc(parent, driver, type, member) \
+   ((type *) __devm_drm_dev_alloc(parent, driver, sizeof(type), \
+  offsetof(type, member)))
+
 struct drm_device *drm_dev_alloc(struct drm_driver *driver,
 struct device *parent);
 int drm_dev_register(struct drm_device *dev, unsigned long flags);
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 11/44] drm/v3d: Don't set drm_device->dev_private

2020-04-03 Thread Daniel Vetter
And switch the helper over to container_of, which is a bunch faster
than chasing a pointer. Plus allows gcc to see through this maze.

Signed-off-by: Daniel Vetter 
Cc: Eric Anholt 
---
 drivers/gpu/drm/v3d/v3d_drv.c | 1 -
 drivers/gpu/drm/v3d/v3d_drv.h | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index 8d0c0daaac81..ead62a15d48f 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -265,7 +265,6 @@ static int v3d_platform_drm_probe(struct platform_device 
*pdev)
}
 
platform_set_drvdata(pdev, drm);
-   drm->dev_private = v3d;
drmm_add_final_kfree(drm, v3d);
 
ret = map_regs(v3d, &v3d->hub_regs, "hub");
diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h
index e0775c884553..112d80aed5f6 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.h
+++ b/drivers/gpu/drm/v3d/v3d_drv.h
@@ -121,7 +121,7 @@ struct v3d_dev {
 static inline struct v3d_dev *
 to_v3d_dev(struct drm_device *dev)
 {
-   return (struct v3d_dev *)dev->dev_private;
+   return container_of(dev, struct v3d_dev, drm);
 }
 
 static inline bool
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 10/44] drm/vboxvideo: Use devm_gen_pool_create

2020-04-03 Thread Daniel Vetter
Aside from deleting all the cleanup code we're now also setting a name
for the pool

Signed-off-by: Daniel Vetter 
Cc: Hans de Goede 
---
 drivers/gpu/drm/vboxvideo/vbox_main.c | 22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/vboxvideo/vbox_main.c 
b/drivers/gpu/drm/vboxvideo/vbox_main.c
index 1336ab9795fc..d68d9bad7674 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_main.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_main.c
@@ -121,7 +121,8 @@ int vbox_hw_init(struct vbox_private *vbox)
return -ENOMEM;
 
/* Create guest-heap mem-pool use 2^4 = 16 byte chunks */
-   vbox->guest_pool = gen_pool_create(4, -1);
+   vbox->guest_pool = devm_gen_pool_create(vbox->ddev.dev, 4, -1,
+   "vboxvideo-accel");
if (!vbox->guest_pool)
return -ENOMEM;
 
@@ -130,12 +131,12 @@ int vbox_hw_init(struct vbox_private *vbox)
GUEST_HEAP_OFFSET(vbox),
GUEST_HEAP_USABLE_SIZE, -1);
if (ret)
-   goto err_destroy_guest_pool;
+   return ret;
 
ret = hgsmi_test_query_conf(vbox->guest_pool);
if (ret) {
DRM_ERROR("vboxvideo: hgsmi_test_query_conf failed\n");
-   goto err_destroy_guest_pool;
+   return ret;
}
 
/* Reduce available VRAM size to reflect the guest heap. */
@@ -147,30 +148,23 @@ int vbox_hw_init(struct vbox_private *vbox)
 
if (!have_hgsmi_mode_hints(vbox)) {
ret = -ENOTSUPP;
-   goto err_destroy_guest_pool;
+   return ret;
}
 
vbox->last_mode_hints = devm_kcalloc(vbox->ddev.dev, vbox->num_crtcs,
 sizeof(struct vbva_modehint),
 GFP_KERNEL);
-   if (!vbox->last_mode_hints) {
-   ret = -ENOMEM;
-   goto err_destroy_guest_pool;
-   }
+   if (!vbox->last_mode_hints)
+   return -ENOMEM;
 
ret = vbox_accel_init(vbox);
if (ret)
-   goto err_destroy_guest_pool;
+   return ret;
 
return 0;
-
-err_destroy_guest_pool:
-   gen_pool_destroy(vbox->guest_pool);
-   return ret;
 }
 
 void vbox_hw_fini(struct vbox_private *vbox)
 {
vbox_accel_fini(vbox);
-   gen_pool_destroy(vbox->guest_pool);
 }
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 07/44] drm/vboxvideo: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Straightforward conversion.

Signed-off-by: Daniel Vetter 
Cc: Hans de Goede 
---
 drivers/gpu/drm/vboxvideo/vbox_drv.c | 19 +--
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c 
b/drivers/gpu/drm/vboxvideo/vbox_drv.c
index d685ec197fa0..be0600b22cf5 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_drv.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c
@@ -46,25 +46,19 @@ static int vbox_pci_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
if (ret)
return ret;
 
-   vbox = kzalloc(sizeof(*vbox), GFP_KERNEL);
-   if (!vbox)
-   return -ENOMEM;
-
-   ret = drm_dev_init(&vbox->ddev, &driver, &pdev->dev);
-   if (ret) {
-   kfree(vbox);
-   return ret;
-   }
+   vbox = devm_drm_dev_alloc(&pdev->dev, &driver,
+ struct vbox_private, ddev);
+   if (IS_ERR(vbox))
+   return PTR_ERR(vbox);
 
vbox->ddev.pdev = pdev;
vbox->ddev.dev_private = vbox;
pci_set_drvdata(pdev, vbox);
-   drmm_add_final_kfree(&vbox->ddev, vbox);
mutex_init(&vbox->hw_mutex);
 
ret = pci_enable_device(pdev);
if (ret)
-   goto err_dev_put;
+   return ret;
 
ret = vbox_hw_init(vbox);
if (ret)
@@ -102,8 +96,6 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
vbox_hw_fini(vbox);
 err_pci_disable:
pci_disable_device(pdev);
-err_dev_put:
-   drm_dev_put(&vbox->ddev);
return ret;
 }
 
@@ -116,7 +108,6 @@ static void vbox_pci_remove(struct pci_dev *pdev)
vbox_mode_fini(vbox);
vbox_mm_fini(vbox);
vbox_hw_fini(vbox);
-   drm_dev_put(&vbox->ddev);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 15/44] drm/udl: Use demv_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Also init the fbdev emulation before we register the device, that way
we can rely on the auto-cleanup and simplify the probe error code even
more.

Signed-off-by: Daniel Vetter 
Cc: Dave Airlie 
Cc: Sean Paul 
Cc: Thomas Zimmermann 
Cc: Daniel Vetter 
Cc: Emil Velikov 
Cc: Sam Ravnborg 
Cc: Thomas Gleixner 
---
 drivers/gpu/drm/udl/udl_drv.c | 36 +++
 1 file changed, 11 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
index 1ce2d865c36d..4ba5149fdd57 100644
--- a/drivers/gpu/drm/udl/udl_drv.c
+++ b/drivers/gpu/drm/udl/udl_drv.c
@@ -57,27 +57,20 @@ static struct udl_device *udl_driver_create(struct 
usb_interface *interface)
struct udl_device *udl;
int r;
 
-   udl = kzalloc(sizeof(*udl), GFP_KERNEL);
-   if (!udl)
-   return ERR_PTR(-ENOMEM);
-
-   r = drm_dev_init(&udl->drm, &driver, &interface->dev);
-   if (r) {
-   kfree(udl);
-   return ERR_PTR(r);
-   }
+   udl = devm_drm_dev_alloc(&interface->dev, &driver,
+struct udl_device, drm);
+   if (IS_ERR(udl))
+   return udl;
 
udl->udev = udev;
udl->drm.dev_private = udl;
-   drmm_add_final_kfree(&udl->drm, udl);
 
r = udl_init(udl);
-   if (r) {
-   drm_dev_put(&udl->drm);
+   if (r)
return ERR_PTR(r);
-   }
 
usb_set_intfdata(interface, udl);
+
return udl;
 }
 
@@ -91,23 +84,17 @@ static int udl_usb_probe(struct usb_interface *interface,
if (IS_ERR(udl))
return PTR_ERR(udl);
 
+   r = drm_fbdev_generic_setup(&udl->drm, 0);
+   if (r)
+   return r;
+
r = drm_dev_register(&udl->drm, 0);
if (r)
-   goto err_free;
+   return r;
 
DRM_INFO("Initialized udl on minor %d\n", udl->drm.primary->index);
 
-   r = drm_fbdev_generic_setup(&udl->drm, 0);
-   if (r)
-   goto err_drm_dev_unregister;
-
return 0;
-
-err_drm_dev_unregister:
-   drm_dev_unregister(&udl->drm);
-err_free:
-   drm_dev_put(&udl->drm);
-   return r;
 }
 
 static void udl_usb_disconnect(struct usb_interface *interface)
@@ -117,7 +104,6 @@ static void udl_usb_disconnect(struct usb_interface 
*interface)
drm_kms_helper_poll_fini(dev);
udl_drop_usb(dev);
drm_dev_unplug(dev);
-   drm_dev_put(dev);
 }
 
 /*
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 17/44] drm/st7735r: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Aside: There was an oddity in the old code, we allocated priv but in
the error path we've freed priv->dbidev ...

Signed-off-by: Daniel Vetter 
Cc: David Lechner 
---
 drivers/gpu/drm/tiny/st7735r.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/tiny/st7735r.c b/drivers/gpu/drm/tiny/st7735r.c
index 631801c36f46..ccbf49a53202 100644
--- a/drivers/gpu/drm/tiny/st7735r.c
+++ b/drivers/gpu/drm/tiny/st7735r.c
@@ -195,21 +195,16 @@ static int st7735r_probe(struct spi_device *spi)
if (!cfg)
cfg = (void *)spi_get_device_id(spi)->driver_data;
 
-   priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-   if (!priv)
-   return -ENOMEM;
+   priv = devm_drm_dev_alloc(dev, &st7735r_driver,
+ struct st7735r_priv, dbidev.drm);
+   if (IS_ERR(priv))
+   return PTR_ERR(priv);
 
dbidev = &priv->dbidev;
priv->cfg = cfg;
 
dbi = &dbidev->dbi;
drm = &dbidev->drm;
-   ret = devm_drm_dev_init(dev, drm, &st7735r_driver);
-   if (ret) {
-   kfree(dbidev);
-   return ret;
-   }
-   drmm_add_final_kfree(drm, dbidev);
 
dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(dbi->reset)) {
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 24/44] drm/hx8357d: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: Eric Anholt 
---
 drivers/gpu/drm/tiny/hx8357d.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/tiny/hx8357d.c b/drivers/gpu/drm/tiny/hx8357d.c
index af7f3d10aac3..b4bc358a3269 100644
--- a/drivers/gpu/drm/tiny/hx8357d.c
+++ b/drivers/gpu/drm/tiny/hx8357d.c
@@ -226,17 +226,12 @@ static int hx8357d_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;
 
-   dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
-   if (!dbidev)
-   return -ENOMEM;
+   dbidev = devm_drm_dev_alloc(dev, &hx8357d_driver,
+   struct mipi_dbi_dev, drm);
+   if (IS_ERR(dbidev))
+   return PTR_ERR(dbidev);
 
drm = &dbidev->drm;
-   ret = devm_drm_dev_init(dev, drm, &hx8357d_driver);
-   if (ret) {
-   kfree(dbidev);
-   return ret;
-   }
-   drmm_add_final_kfree(drm, dbidev);
 
dc = devm_gpiod_get(dev, "dc", GPIOD_OUT_LOW);
if (IS_ERR(dc)) {
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 30/44] drm/qxl: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Also need to remove the drm_dev_put from the remove hook.

Signed-off-by: Daniel Vetter 
Cc: Dave Airlie 
Cc: Gerd Hoffmann 
Cc: virtualizat...@lists.linux-foundation.org
Cc: spice-de...@lists.freedesktop.org
---
 drivers/gpu/drm/qxl/qxl_drv.c | 15 ---
 drivers/gpu/drm/qxl/qxl_drv.h |  3 +--
 drivers/gpu/drm/qxl/qxl_kms.c | 12 +---
 3 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index 09102e2efabc..6b4ae4c5fb76 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -81,13 +81,16 @@ qxl_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
return -EINVAL; /* TODO: ENODEV ? */
}
 
-   qdev = kzalloc(sizeof(struct qxl_device), GFP_KERNEL);
-   if (!qdev)
+   qdev = devm_drm_dev_alloc(&pdev->dev, &qxl_driver,
+ struct qxl_device, ddev);
+   if (IS_ERR(qdev)) {
+   pr_err("Unable to init drm dev");
return -ENOMEM;
+   }
 
ret = pci_enable_device(pdev);
if (ret)
-   goto free_dev;
+   return ret;
 
ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl");
if (ret)
@@ -101,7 +104,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
}
}
 
-   ret = qxl_device_init(qdev, &qxl_driver, pdev);
+   ret = qxl_device_init(qdev, pdev);
if (ret)
goto put_vga;
 
@@ -128,8 +131,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
vga_put(pdev, VGA_RSRC_LEGACY_IO);
 disable_pci:
pci_disable_device(pdev);
-free_dev:
-   kfree(qdev);
+
return ret;
 }
 
@@ -155,7 +157,6 @@ qxl_pci_remove(struct pci_dev *pdev)
drm_atomic_helper_shutdown(dev);
if (is_vga(pdev))
vga_put(pdev, VGA_RSRC_LEGACY_IO);
-   drm_dev_put(dev);
 }
 
 DEFINE_DRM_GEM_FOPS(qxl_fops);
diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h
index 435126facc9b..86ac191d9205 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.h
+++ b/drivers/gpu/drm/qxl/qxl_drv.h
@@ -276,8 +276,7 @@ struct qxl_device {
 extern const struct drm_ioctl_desc qxl_ioctls[];
 extern int qxl_max_ioctl;
 
-int qxl_device_init(struct qxl_device *qdev, struct drm_driver *drv,
-   struct pci_dev *pdev);
+int qxl_device_init(struct qxl_device *qdev, struct pci_dev *pdev);
 void qxl_device_fini(struct qxl_device *qdev);
 
 int qxl_modeset_init(struct qxl_device *qdev);
diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c
index 9eed1a375f24..91a34dd835d7 100644
--- a/drivers/gpu/drm/qxl/qxl_kms.c
+++ b/drivers/gpu/drm/qxl/qxl_kms.c
@@ -108,21 +108,13 @@ static void qxl_gc_work(struct work_struct *work)
 }
 
 int qxl_device_init(struct qxl_device *qdev,
-   struct drm_driver *drv,
struct pci_dev *pdev)
 {
int r, sb;
 
-   r = drm_dev_init(&qdev->ddev, drv, &pdev->dev);
-   if (r) {
-   pr_err("Unable to init drm dev");
-   goto error;
-   }
-
qdev->ddev.pdev = pdev;
pci_set_drvdata(pdev, &qdev->ddev);
qdev->ddev.dev_private = qdev;
-   drmm_add_final_kfree(&qdev->ddev, qdev);
 
mutex_init(&qdev->gem.mutex);
mutex_init(&qdev->update_area_mutex);
@@ -138,8 +130,7 @@ int qxl_device_init(struct qxl_device *qdev,
qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, 
pci_resource_len(pdev, 0));
if (!qdev->vram_mapping) {
pr_err("Unable to create vram_mapping");
-   r = -ENOMEM;
-   goto error;
+   return -ENOMEM;
}
 
if (pci_resource_len(pdev, 4) > 0) {
@@ -293,7 +284,6 @@ int qxl_device_init(struct qxl_device *qdev,
io_mapping_free(qdev->surface_mapping);
 vram_mapping_free:
io_mapping_free(qdev->vram_mapping);
-error:
return r;
 }
 
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Keep a per-engine request pools

2020-04-03 Thread Janusz Krzysztofik
On Thu, 2020-04-02 at 19:40 +0100, Chris Wilson wrote:
> Add a tiny per-engine request mempool so that we should always have a
> request available for powermanagement allocations from tricky
> contexts. This reserve is expected to be only used for kernel
> contexts when barriers must be emitted [almost] without fail.
> 
> The main consumer for this reserved request is expected to be engine-pm,
> for which we know that there will always be at least the previous pm
> request that we can reuse under mempressure (so there should always be
> a spare request for engine_park()).
> 
> This is an alternative to using a comparatively bulky mempool, which
> requires custom handling for both our reserved allocation requirement
> and to protect our TYPESAFE_BY_RCU slab cache.

This change resolves the issue for me, and being more simple than the
mempool approach, looks still better.

Reviewed-and-Tested-by: Janusz Krzysztofik 

Thanks,
Janusz

> 
> Signed-off-by: Chris Wilson 
> Cc: Janusz Krzysztofik 
> Cc: Tvrtko Ursulin 
> ---
>  drivers/gpu/drm/i915/gt/intel_engine_cs.c|  7 +
>  drivers/gpu/drm/i915/gt/intel_engine_types.h |  3 +++
>  drivers/gpu/drm/i915/i915_request.c  | 27 
>  drivers/gpu/drm/i915/i915_request.h  |  2 ++
>  4 files changed, 34 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c 
> b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> index 843cb6f2f696..5f45c8274203 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> @@ -431,7 +431,14 @@ void intel_engines_free(struct intel_gt *gt)
>   struct intel_engine_cs *engine;
>   enum intel_engine_id id;
>  
> + /* Free the requests! dma-resv keeps fences around for an eternity */
> + rcu_barrier();
> +
>   for_each_engine(engine, gt, id) {
> + if (engine->request_pool)
> + kmem_cache_free(i915_request_slab_cache(),
> + engine->request_pool);
> +
>   kfree(engine);
>   gt->engine[id] = NULL;
>   }
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h 
> b/drivers/gpu/drm/i915/gt/intel_engine_types.h
> index 80cdde712842..de8e6edcf999 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_types.h
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h
> @@ -308,6 +308,9 @@ struct intel_engine_cs {
>   struct list_head hold; /* ready requests, but on hold */
>   } active;
>  
> + /* keep a request in reserve for a [pm] barrier under oom */
> + struct i915_request *request_pool;
> +
>   struct llist_head barrier_tasks;
>  
>   struct intel_context *kernel_context; /* pinned */
> diff --git a/drivers/gpu/drm/i915/i915_request.c 
> b/drivers/gpu/drm/i915/i915_request.c
> index 3388c5b610c5..22635bbabf06 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -101,6 +101,11 @@ static signed long i915_fence_wait(struct dma_fence 
> *fence,
>timeout);
>  }
>  
> +struct kmem_cache *i915_request_slab_cache(void)
> +{
> + return global.slab_requests;
> +}
> +
>  static void i915_fence_release(struct dma_fence *fence)
>  {
>   struct i915_request *rq = to_request(fence);
> @@ -115,6 +120,10 @@ static void i915_fence_release(struct dma_fence *fence)
>   i915_sw_fence_fini(&rq->submit);
>   i915_sw_fence_fini(&rq->semaphore);
>  
> + /* Keep one request on each engine for reserved use under mempressure */
> + if (!cmpxchg(&rq->engine->request_pool, NULL, rq))
> + return;
> +
>   kmem_cache_free(global.slab_requests, rq);
>  }
>  
> @@ -629,14 +638,22 @@ static void retire_requests(struct intel_timeline *tl)
>  }
>  
>  static noinline struct i915_request *
> -request_alloc_slow(struct intel_timeline *tl, gfp_t gfp)
> +request_alloc_slow(struct intel_timeline *tl,
> +struct i915_request **rsvd,
> +gfp_t gfp)
>  {
>   struct i915_request *rq;
>  
> - if (list_empty(&tl->requests))
> - goto out;
> + /* If we cannot wait, dip into our reserves */
> + if (!gfpflags_allow_blocking(gfp)) {
> + rq = xchg(rsvd, NULL);
> + if (!rq) /* Use the normal failure path for one final WARN */
> + goto out;
>  
> - if (!gfpflags_allow_blocking(gfp))
> + return rq;
> + }
> +
> + if (list_empty(&tl->requests))
>   goto out;
>  
>   /* Move our oldest request to the slab-cache (if not in use!) */
> @@ -721,7 +738,7 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp)
>   rq = kmem_cache_alloc(global.slab_requests,
> gfp | __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
>   if (unlikely(!rq)) {
> - rq = request_alloc_slow(tl, gfp);
> + rq = request_alloc_slow(tl, &ce->engine->request_pool, gfp);
>

[Intel-gfx] [PATCH 16/44] drm/udl: don't set drm_device->dev_private

2020-04-03 Thread Daniel Vetter
We're mostly there already, just a handful of places that didn't use
the to_udl container_of cast. To make sure no new appear, don't set
->dev_private.

Signed-off-by: Daniel Vetter 
Cc: Dave Airlie 
Cc: Sean Paul 
Cc: Emil Velikov 
Cc: Thomas Zimmermann 
Cc: Daniel Vetter 
Cc: Alexios Zavras 
Cc: Laurent Pinchart 
Cc: Thomas Gleixner 
Cc: "José Roberto de Souza" 
Cc: Sam Ravnborg 
Cc: Gerd Hoffmann 
Cc: Allison Randal 
---
 drivers/gpu/drm/udl/udl_connector.c | 4 ++--
 drivers/gpu/drm/udl/udl_drv.c   | 1 -
 drivers/gpu/drm/udl/udl_modeset.c   | 6 +++---
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_connector.c 
b/drivers/gpu/drm/udl/udl_connector.c
index 0afdfb0d1fe1..cdc1c42e1669 100644
--- a/drivers/gpu/drm/udl/udl_connector.c
+++ b/drivers/gpu/drm/udl/udl_connector.c
@@ -59,7 +59,7 @@ static int udl_get_modes(struct drm_connector *connector)
 static enum drm_mode_status udl_mode_valid(struct drm_connector *connector,
  struct drm_display_mode *mode)
 {
-   struct udl_device *udl = connector->dev->dev_private;
+   struct udl_device *udl = to_udl(connector->dev);
if (!udl->sku_pixel_limit)
return 0;
 
@@ -72,7 +72,7 @@ static enum drm_mode_status udl_mode_valid(struct 
drm_connector *connector,
 static enum drm_connector_status
 udl_detect(struct drm_connector *connector, bool force)
 {
-   struct udl_device *udl = connector->dev->dev_private;
+   struct udl_device *udl = to_udl(connector->dev);
struct udl_drm_connector *udl_connector =
container_of(connector,
struct udl_drm_connector,
diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
index 4ba5149fdd57..126545428895 100644
--- a/drivers/gpu/drm/udl/udl_drv.c
+++ b/drivers/gpu/drm/udl/udl_drv.c
@@ -63,7 +63,6 @@ static struct udl_device *udl_driver_create(struct 
usb_interface *interface)
return udl;
 
udl->udev = udev;
-   udl->drm.dev_private = udl;
 
r = udl_init(udl);
if (r)
diff --git a/drivers/gpu/drm/udl/udl_modeset.c 
b/drivers/gpu/drm/udl/udl_modeset.c
index 8cad01f3d163..99518a826435 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -215,7 +215,7 @@ static char *udl_dummy_render(char *wrptr)
 static int udl_crtc_write_mode_to_hw(struct drm_crtc *crtc)
 {
struct drm_device *dev = crtc->dev;
-   struct udl_device *udl = dev->dev_private;
+   struct udl_device *udl = to_udl(dev);
struct urb *urb;
char *buf;
int retval;
@@ -369,7 +369,7 @@ udl_simple_display_pipe_enable(struct 
drm_simple_display_pipe *pipe,
struct drm_crtc *crtc = &pipe->crtc;
struct drm_device *dev = crtc->dev;
struct drm_framebuffer *fb = plane_state->fb;
-   struct udl_device *udl = dev->dev_private;
+   struct udl_device *udl = to_udl(dev);
struct drm_display_mode *mode = &crtc_state->mode;
char *buf;
char *wrptr;
@@ -464,7 +464,7 @@ static const struct drm_mode_config_funcs udl_mode_funcs = {
 int udl_modeset_init(struct drm_device *dev)
 {
size_t format_count = ARRAY_SIZE(udl_simple_display_pipe_formats);
-   struct udl_device *udl = dev->dev_private;
+   struct udl_device *udl = to_udl(dev);
struct drm_connector *connector;
int ret;
 
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 20/44] drm/mi0283qt: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: "Noralf Trønnes" 
---
 drivers/gpu/drm/tiny/mi0283qt.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/tiny/mi0283qt.c b/drivers/gpu/drm/tiny/mi0283qt.c
index decaf57053ff..08ac549ab0f7 100644
--- a/drivers/gpu/drm/tiny/mi0283qt.c
+++ b/drivers/gpu/drm/tiny/mi0283qt.c
@@ -187,18 +187,13 @@ static int mi0283qt_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;
 
-   dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
-   if (!dbidev)
-   return -ENOMEM;
+   dbidev = devm_drm_dev_alloc(dev, &mi0283qt_driver,
+   struct mipi_dbi_dev, drm);
+   if (IS_ERR(dbidev))
+   return PTR_ERR(dbidev);
 
dbi = &dbidev->dbi;
drm = &dbidev->drm;
-   ret = devm_drm_dev_init(dev, drm, &mi0283qt_driver);
-   if (ret) {
-   kfree(dbidev);
-   return ret;
-   }
-   drmm_add_final_kfree(drm, dbidev);
 
dbi->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(dbi->reset)) {
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 31/44] drm/qxl: Don't use drm_device->dev_private

2020-04-03 Thread Daniel Vetter
Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Signed-off-by: Daniel Vetter 
Cc: Dave Airlie 
Cc: Gerd Hoffmann 
Cc: virtualizat...@lists.linux-foundation.org
Cc: spice-de...@lists.freedesktop.org
---
 drivers/gpu/drm/qxl/qxl_debugfs.c |  7 +++
 drivers/gpu/drm/qxl/qxl_display.c | 32 +++
 drivers/gpu/drm/qxl/qxl_drv.c |  8 
 drivers/gpu/drm/qxl/qxl_drv.h |  4 ++--
 drivers/gpu/drm/qxl/qxl_dumb.c|  2 +-
 drivers/gpu/drm/qxl/qxl_gem.c |  2 +-
 drivers/gpu/drm/qxl/qxl_ioctl.c   | 14 +++---
 drivers/gpu/drm/qxl/qxl_irq.c |  2 +-
 drivers/gpu/drm/qxl/qxl_kms.c |  1 -
 drivers/gpu/drm/qxl/qxl_object.c  |  2 +-
 drivers/gpu/drm/qxl/qxl_release.c |  2 +-
 drivers/gpu/drm/qxl/qxl_ttm.c |  2 +-
 12 files changed, 38 insertions(+), 40 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c 
b/drivers/gpu/drm/qxl/qxl_debugfs.c
index 88123047fdd4..524d35b648d8 100644
--- a/drivers/gpu/drm/qxl/qxl_debugfs.c
+++ b/drivers/gpu/drm/qxl/qxl_debugfs.c
@@ -39,7 +39,7 @@ static int
 qxl_debugfs_irq_received(struct seq_file *m, void *data)
 {
struct drm_info_node *node = (struct drm_info_node *) m->private;
-   struct qxl_device *qdev = node->minor->dev->dev_private;
+   struct qxl_device *qdev = to_qxl(node->minor->dev);
 
seq_printf(m, "%d\n", atomic_read(&qdev->irq_received));
seq_printf(m, "%d\n", atomic_read(&qdev->irq_received_display));
@@ -53,7 +53,7 @@ static int
 qxl_debugfs_buffers_info(struct seq_file *m, void *data)
 {
struct drm_info_node *node = (struct drm_info_node *) m->private;
-   struct qxl_device *qdev = node->minor->dev->dev_private;
+   struct qxl_device *qdev = to_qxl(node->minor->dev);
struct qxl_bo *bo;
 
list_for_each_entry(bo, &qdev->gem.objects, list) {
@@ -83,8 +83,7 @@ void
 qxl_debugfs_init(struct drm_minor *minor)
 {
 #if defined(CONFIG_DEBUG_FS)
-   struct qxl_device *dev =
-   (struct qxl_device *) minor->dev->dev_private;
+   struct qxl_device *dev = to_qxl(minor->dev);
 
drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES,
 minor->debugfs_root, minor);
diff --git a/drivers/gpu/drm/qxl/qxl_display.c 
b/drivers/gpu/drm/qxl/qxl_display.c
index 09583a08e141..1082cd5d2fd4 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -221,7 +221,7 @@ static int qxl_add_mode(struct drm_connector *connector,
bool preferred)
 {
struct drm_device *dev = connector->dev;
-   struct qxl_device *qdev = dev->dev_private;
+   struct qxl_device *qdev = to_qxl(dev);
struct drm_display_mode *mode = NULL;
int rc;
 
@@ -242,7 +242,7 @@ static int qxl_add_mode(struct drm_connector *connector,
 static int qxl_add_monitors_config_modes(struct drm_connector *connector)
 {
struct drm_device *dev = connector->dev;
-   struct qxl_device *qdev = dev->dev_private;
+   struct qxl_device *qdev = to_qxl(dev);
struct qxl_output *output = drm_connector_to_qxl_output(connector);
int h = output->index;
struct qxl_head *head;
@@ -310,7 +310,7 @@ static void qxl_crtc_update_monitors_config(struct drm_crtc 
*crtc,
const char *reason)
 {
struct drm_device *dev = crtc->dev;
-   struct qxl_device *qdev = dev->dev_private;
+   struct qxl_device *qdev = to_qxl(dev);
struct qxl_crtc *qcrtc = to_qxl_crtc(crtc);
struct qxl_head head;
int oldcount, i = qcrtc->index;
@@ -400,7 +400,7 @@ static int qxl_framebuffer_surface_dirty(struct 
drm_framebuffer *fb,
 unsigned int num_clips)
 {
/* TODO: vmwgfx where this was cribbed from had locking. Why? */
-   struct qxl_device *qdev = fb->dev->dev_private;
+   struct qxl_device *qdev = to_qxl(fb->dev);
struct drm_clip_rect norect;
struct qxl_bo *qobj;
bool is_primary;
@@ -462,7 +462,7 @@ static const struct drm_crtc_helper_funcs 
qxl_crtc_helper_funcs = {
 static int qxl_primary_atomic_check(struct drm_plane *plane,
struct drm_plane_state *state)
 {
-   struct qxl_device *qdev = plane->dev->dev_private;
+   struct qxl_device *qdev = to_qxl(plane->dev);
struct qxl_bo *bo;
 
if (!state->crtc || !state->fb)
@@ -476,7 +476,7 @@ static int qxl_primary_atomic_check(struct drm_plane *plane,
 static int qxl_primary_apply_cursor(struct drm_plane *plane)
 {
struct drm_device *dev = plane->dev;
-   struct qxl_device *qdev = dev->dev_private;
+   struct qxl_device *qdev = to_qxl(dev);
struct drm_framebuffer *fb = plane->state->fb;
struct qxl_crtc *qcrtc = to_qxl_crtc(plane->state->crtc);
struct qxl_cursor_cmd *cmd;
@@ -523,7 +523,7 @@ static int qxl_primary_appl

[Intel-gfx] [PATCH 23/44] drm/ili9225: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: David Lechner 
---
 drivers/gpu/drm/tiny/ili9225.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/tiny/ili9225.c b/drivers/gpu/drm/tiny/ili9225.c
index 118477af4491..d1a5ab6747d5 100644
--- a/drivers/gpu/drm/tiny/ili9225.c
+++ b/drivers/gpu/drm/tiny/ili9225.c
@@ -376,18 +376,13 @@ static int ili9225_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;
 
-   dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
-   if (!dbidev)
-   return -ENOMEM;
+   dbidev = devm_drm_dev_alloc(dev, &ili9225_driver,
+   struct mipi_dbi_dev, drm);
+   if (IS_ERR(dbidev))
+   return PTR_ERR(dbidev);
 
dbi = &dbidev->dbi;
drm = &dbidev->drm;
-   ret = devm_drm_dev_init(dev, drm, &ili9225_driver);
-   if (ret) {
-   kfree(dbidev);
-   return ret;
-   }
-   drmm_add_final_kfree(drm, dbidev);
 
dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(dbi->reset)) {
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 28/44] drm/tidss: Don't use drm_device->dev_private

2020-04-03 Thread Daniel Vetter
Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Signed-off-by: Daniel Vetter 
Cc: Jyri Sarha 
Cc: Tomi Valkeinen 
---
 drivers/gpu/drm/tidss/tidss_crtc.c  | 16 
 drivers/gpu/drm/tidss/tidss_drv.c   |  2 --
 drivers/gpu/drm/tidss/tidss_drv.h   |  2 ++
 drivers/gpu/drm/tidss/tidss_irq.c   | 12 ++--
 drivers/gpu/drm/tidss/tidss_kms.c   |  2 +-
 drivers/gpu/drm/tidss/tidss_plane.c |  6 +++---
 6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c 
b/drivers/gpu/drm/tidss/tidss_crtc.c
index d4ce9bab8c7e..2396262c09e4 100644
--- a/drivers/gpu/drm/tidss/tidss_crtc.c
+++ b/drivers/gpu/drm/tidss/tidss_crtc.c
@@ -24,7 +24,7 @@
 static void tidss_crtc_finish_page_flip(struct tidss_crtc *tcrtc)
 {
struct drm_device *ddev = tcrtc->crtc.dev;
-   struct tidss_device *tidss = ddev->dev_private;
+   struct tidss_device *tidss = to_tidss(ddev);
struct drm_pending_vblank_event *event;
unsigned long flags;
bool busy;
@@ -88,7 +88,7 @@ static int tidss_crtc_atomic_check(struct drm_crtc *crtc,
   struct drm_crtc_state *state)
 {
struct drm_device *ddev = crtc->dev;
-   struct tidss_device *tidss = ddev->dev_private;
+   struct tidss_device *tidss = to_tidss(ddev);
struct dispc_device *dispc = tidss->dispc;
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
u32 hw_videoport = tcrtc->hw_videoport;
@@ -165,7 +165,7 @@ static void tidss_crtc_atomic_flush(struct drm_crtc *crtc,
 {
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
struct drm_device *ddev = crtc->dev;
-   struct tidss_device *tidss = ddev->dev_private;
+   struct tidss_device *tidss = to_tidss(ddev);
unsigned long flags;
 
dev_dbg(ddev->dev,
@@ -216,7 +216,7 @@ static void tidss_crtc_atomic_enable(struct drm_crtc *crtc,
 {
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
struct drm_device *ddev = crtc->dev;
-   struct tidss_device *tidss = ddev->dev_private;
+   struct tidss_device *tidss = to_tidss(ddev);
const struct drm_display_mode *mode = &crtc->state->adjusted_mode;
unsigned long flags;
int r;
@@ -259,7 +259,7 @@ static void tidss_crtc_atomic_disable(struct drm_crtc *crtc,
 {
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
struct drm_device *ddev = crtc->dev;
-   struct tidss_device *tidss = ddev->dev_private;
+   struct tidss_device *tidss = to_tidss(ddev);
unsigned long flags;
 
dev_dbg(ddev->dev, "%s, event %p\n", __func__, crtc->state->event);
@@ -295,7 +295,7 @@ enum drm_mode_status tidss_crtc_mode_valid(struct drm_crtc 
*crtc,
 {
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
struct drm_device *ddev = crtc->dev;
-   struct tidss_device *tidss = ddev->dev_private;
+   struct tidss_device *tidss = to_tidss(ddev);
 
return dispc_vp_mode_valid(tidss->dispc, tcrtc->hw_videoport, mode);
 }
@@ -314,7 +314,7 @@ static const struct drm_crtc_helper_funcs 
tidss_crtc_helper_funcs = {
 static int tidss_crtc_enable_vblank(struct drm_crtc *crtc)
 {
struct drm_device *ddev = crtc->dev;
-   struct tidss_device *tidss = ddev->dev_private;
+   struct tidss_device *tidss = to_tidss(ddev);
 
dev_dbg(ddev->dev, "%s\n", __func__);
 
@@ -328,7 +328,7 @@ static int tidss_crtc_enable_vblank(struct drm_crtc *crtc)
 static void tidss_crtc_disable_vblank(struct drm_crtc *crtc)
 {
struct drm_device *ddev = crtc->dev;
-   struct tidss_device *tidss = ddev->dev_private;
+   struct tidss_device *tidss = to_tidss(ddev);
 
dev_dbg(ddev->dev, "%s\n", __func__);
 
diff --git a/drivers/gpu/drm/tidss/tidss_drv.c 
b/drivers/gpu/drm/tidss/tidss_drv.c
index 7d4465d58be8..99edc66ebdef 100644
--- a/drivers/gpu/drm/tidss/tidss_drv.c
+++ b/drivers/gpu/drm/tidss/tidss_drv.c
@@ -147,8 +147,6 @@ static int tidss_probe(struct platform_device *pdev)
 
platform_set_drvdata(pdev, tidss);
 
-   ddev->dev_private = tidss;
-
ret = dispc_init(tidss);
if (ret) {
dev_err(dev, "failed to initialize dispc: %d\n", ret);
diff --git a/drivers/gpu/drm/tidss/tidss_drv.h 
b/drivers/gpu/drm/tidss/tidss_drv.h
index e2aa6436ad18..b23cd95c8d78 100644
--- a/drivers/gpu/drm/tidss/tidss_drv.h
+++ b/drivers/gpu/drm/tidss/tidss_drv.h
@@ -33,6 +33,8 @@ struct tidss_device {
struct drm_atomic_state *saved_state;
 };
 
+#define to_tidss(__dev) container_of(__dev, struct tidss_device, ddev)
+
 int tidss_runtime_get(struct tidss_device *tidss);
 void tidss_runtime_put(struct tidss_device *tidss);
 
diff --git a/drivers/gpu/drm/tidss/tidss_irq.c 
b/drivers/gpu/drm/tidss/tidss_irq.c
index 612c046738e5..1b80f2d62e0a 100644
--- a/drivers/gpu/drm/tidss/tidss_irq.c
+++ b/drivers/gpu/drm/tidss/tidss_irq.c
@@ -23,7 +23,7 @@ static void tidss_irq_update(struct

[Intel-gfx] [PATCH 13/44] drm/v3d: Delete v3d_dev->dev

2020-04-03 Thread Daniel Vetter
We already have it in v3d_dev->drm.dev with zero additional pointer
chasing. Personally I don't like duplicated pointers like this
because:
- reviewers need to check whether the pointer is for the same or
  different objects if there's multiple
- compilers have an easier time too

But also a bit a bikeshed, so feel free to ignore.

Signed-off-by: Daniel Vetter 
Cc: Eric Anholt 
---
 drivers/gpu/drm/v3d/v3d_debugfs.c | 12 ++--
 drivers/gpu/drm/v3d/v3d_drv.c | 12 ++--
 drivers/gpu/drm/v3d/v3d_drv.h |  2 --
 drivers/gpu/drm/v3d/v3d_gem.c | 17 +
 drivers/gpu/drm/v3d/v3d_irq.c | 12 ++--
 drivers/gpu/drm/v3d/v3d_mmu.c | 10 +-
 drivers/gpu/drm/v3d/v3d_sched.c   | 10 +-
 7 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/v3d/v3d_debugfs.c 
b/drivers/gpu/drm/v3d/v3d_debugfs.c
index 2b0ea5f8febd..e76b24bb8828 100644
--- a/drivers/gpu/drm/v3d/v3d_debugfs.c
+++ b/drivers/gpu/drm/v3d/v3d_debugfs.c
@@ -132,7 +132,7 @@ static int v3d_v3d_debugfs_ident(struct seq_file *m, void 
*unused)
u32 ident0, ident1, ident2, ident3, cores;
int ret, core;
 
-   ret = pm_runtime_get_sync(v3d->dev);
+   ret = pm_runtime_get_sync(v3d->drm.dev);
if (ret < 0)
return ret;
 
@@ -187,8 +187,8 @@ static int v3d_v3d_debugfs_ident(struct seq_file *m, void 
*unused)
   (misccfg & V3D_MISCCFG_OVRTMUOUT) != 0);
}
 
-   pm_runtime_mark_last_busy(v3d->dev);
-   pm_runtime_put_autosuspend(v3d->dev);
+   pm_runtime_mark_last_busy(v3d->drm.dev);
+   pm_runtime_put_autosuspend(v3d->drm.dev);
 
return 0;
 }
@@ -219,7 +219,7 @@ static int v3d_measure_clock(struct seq_file *m, void 
*unused)
int measure_ms = 1000;
int ret;
 
-   ret = pm_runtime_get_sync(v3d->dev);
+   ret = pm_runtime_get_sync(v3d->drm.dev);
if (ret < 0)
return ret;
 
@@ -245,8 +245,8 @@ static int v3d_measure_clock(struct seq_file *m, void 
*unused)
   cycles / (measure_ms * 1000),
   (cycles / (measure_ms * 100)) % 10);
 
-   pm_runtime_mark_last_busy(v3d->dev);
-   pm_runtime_put_autosuspend(v3d->dev);
+   pm_runtime_mark_last_busy(v3d->drm.dev);
+   pm_runtime_put_autosuspend(v3d->drm.dev);
 
return 0;
 }
diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index f57d408ef371..37cb880f2826 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -105,7 +105,7 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void 
*data,
if (args->value != 0)
return -EINVAL;
 
-   ret = pm_runtime_get_sync(v3d->dev);
+   ret = pm_runtime_get_sync(v3d->drm.dev);
if (ret < 0)
return ret;
if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
@@ -114,8 +114,8 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void 
*data,
} else {
args->value = V3D_READ(offset);
}
-   pm_runtime_mark_last_busy(v3d->dev);
-   pm_runtime_put_autosuspend(v3d->dev);
+   pm_runtime_mark_last_busy(v3d->drm.dev);
+   pm_runtime_put_autosuspend(v3d->drm.dev);
return 0;
}
 
@@ -237,7 +237,7 @@ map_regs(struct v3d_dev *v3d, void __iomem **regs, const 
char *name)
struct resource *res =
platform_get_resource_byname(v3d->pdev, IORESOURCE_MEM, name);
 
-   *regs = devm_ioremap_resource(v3d->dev, res);
+   *regs = devm_ioremap_resource(v3d->drm.dev, res);
return PTR_ERR_OR_ZERO(*regs);
 }
 
@@ -255,7 +255,6 @@ static int v3d_platform_drm_probe(struct platform_device 
*pdev)
if (IS_ERR(v3d))
return PTR_ERR(v3d);
 
-   v3d->dev = dev;
v3d->pdev = pdev;
drm = &v3d->drm;
 
@@ -345,7 +344,8 @@ static int v3d_platform_drm_remove(struct platform_device 
*pdev)
 
v3d_gem_destroy(drm);
 
-   dma_free_wc(v3d->dev, 4096, v3d->mmu_scratch, v3d->mmu_scratch_paddr);
+   dma_free_wc(v3d->drm.dev, 4096, v3d->mmu_scratch,
+   v3d->mmu_scratch_paddr);
 
return 0;
 }
diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h
index 112d80aed5f6..4d2d1f2fe1af 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.h
+++ b/drivers/gpu/drm/v3d/v3d_drv.h
@@ -14,7 +14,6 @@
 #include "uapi/drm/v3d_drm.h"
 
 struct clk;
-struct device;
 struct platform_device;
 struct reset_control;
 
@@ -47,7 +46,6 @@ struct v3d_dev {
int ver;
bool single_irq_line;
 
-   struct device *dev;
struct platform_device *pdev;
void __iomem *hub_regs;
void __iomem *core_regs[3];
diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index 549dde83408b..09a7639cf161 100644
--- a/drivers/gpu

[Intel-gfx] [PATCH 12/44] drm/v3d: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Also allows us to simplify the unroll code since the drm_dev_put
disappears.

Signed-off-by: Daniel Vetter 
Cc: Eric Anholt 
---
 drivers/gpu/drm/v3d/v3d_drv.c | 31 ++-
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index ead62a15d48f..f57d408ef371 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -251,29 +251,23 @@ static int v3d_platform_drm_probe(struct platform_device 
*pdev)
u32 ident1;
 
 
-   v3d = kzalloc(sizeof(*v3d), GFP_KERNEL);
-   if (!v3d)
-   return -ENOMEM;
+   v3d = devm_drm_dev_alloc(dev, &v3d_drm_driver, struct v3d_dev, drm);
+   if (IS_ERR(v3d))
+   return PTR_ERR(v3d);
+
v3d->dev = dev;
v3d->pdev = pdev;
drm = &v3d->drm;
 
-   ret = drm_dev_init(&v3d->drm, &v3d_drm_driver, dev);
-   if (ret) {
-   kfree(v3d);
-   return ret;
-   }
-
platform_set_drvdata(pdev, drm);
-   drmm_add_final_kfree(drm, v3d);
 
ret = map_regs(v3d, &v3d->hub_regs, "hub");
if (ret)
-   goto dev_destroy;
+   return ret;
 
ret = map_regs(v3d, &v3d->core_regs[0], "core0");
if (ret)
-   goto dev_destroy;
+   return ret;
 
mmu_debug = V3D_READ(V3D_MMU_DEBUG_INFO);
dev->coherent_dma_mask =
@@ -291,29 +285,28 @@ static int v3d_platform_drm_probe(struct platform_device 
*pdev)
ret = PTR_ERR(v3d->reset);
 
if (ret == -EPROBE_DEFER)
-   goto dev_destroy;
+   return ret;
 
v3d->reset = NULL;
ret = map_regs(v3d, &v3d->bridge_regs, "bridge");
if (ret) {
dev_err(dev,
"Failed to get reset control or bridge regs\n");
-   goto dev_destroy;
+   return ret;
}
}
 
if (v3d->ver < 41) {
ret = map_regs(v3d, &v3d->gca_regs, "gca");
if (ret)
-   goto dev_destroy;
+   return ret;
}
 
v3d->mmu_scratch = dma_alloc_wc(dev, 4096, &v3d->mmu_scratch_paddr,
GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO);
if (!v3d->mmu_scratch) {
dev_err(dev, "Failed to allocate MMU scratch page\n");
-   ret = -ENOMEM;
-   goto dev_destroy;
+   return -ENOMEM;
}
 
pm_runtime_use_autosuspend(dev);
@@ -340,8 +333,6 @@ static int v3d_platform_drm_probe(struct platform_device 
*pdev)
v3d_gem_destroy(drm);
 dma_free:
dma_free_wc(dev, 4096, v3d->mmu_scratch, v3d->mmu_scratch_paddr);
-dev_destroy:
-   drm_dev_put(drm);
return ret;
 }
 
@@ -354,8 +345,6 @@ static int v3d_platform_drm_remove(struct platform_device 
*pdev)
 
v3d_gem_destroy(drm);
 
-   drm_dev_put(drm);
-
dma_free_wc(v3d->dev, 4096, v3d->mmu_scratch, v3d->mmu_scratch_paddr);
 
return 0;
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 34/44] drm/ingenic: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: Paul Cercueil 
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c 
b/drivers/gpu/drm/ingenic/ingenic-drm.c
index a9bc6623b488..bb62d8e93985 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -614,9 +614,10 @@ static int ingenic_drm_probe(struct platform_device *pdev)
return -EINVAL;
}
 
-   priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-   if (!priv)
-   return -ENOMEM;
+   priv = devm_drm_dev_alloc(dev, &ingenic_drm_driver_data,
+ struct ingenic_drm, drm);
+   if (IS_ERR(priv))
+   return PTR_ERR(priv);
 
priv->soc_info = soc_info;
priv->dev = dev;
@@ -625,13 +626,6 @@ static int ingenic_drm_probe(struct platform_device *pdev)
 
platform_set_drvdata(pdev, priv);
 
-   ret = devm_drm_dev_init(dev, drm, &ingenic_drm_driver_data);
-   if (ret) {
-   kfree(priv);
-   return ret;
-   }
-   drmm_add_final_kfree(drm, priv);
-
ret = drmm_mode_config_init(drm);
if (ret)
return ret;
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 33/44] drm/mcde: Don't use drm_device->dev_private

2020-04-03 Thread Daniel Vetter
Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Signed-off-by: Daniel Vetter 
Cc: Linus Walleij 
---
 drivers/gpu/drm/mcde/mcde_display.c | 10 +-
 drivers/gpu/drm/mcde/mcde_drm.h |  2 ++
 drivers/gpu/drm/mcde/mcde_drv.c |  5 ++---
 drivers/gpu/drm/mcde/mcde_dsi.c |  2 +-
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_display.c 
b/drivers/gpu/drm/mcde/mcde_display.c
index e59907e68854..04e1d38d41f7 100644
--- a/drivers/gpu/drm/mcde/mcde_display.c
+++ b/drivers/gpu/drm/mcde/mcde_display.c
@@ -948,7 +948,7 @@ static void mcde_display_disable(struct 
drm_simple_display_pipe *pipe)
 {
struct drm_crtc *crtc = &pipe->crtc;
struct drm_device *drm = crtc->dev;
-   struct mcde *mcde = drm->dev_private;
+   struct mcde *mcde = to_mcde(drm);
struct drm_pending_vblank_event *event;
 
drm_crtc_vblank_off(crtc);
@@ -1020,7 +1020,7 @@ static void mcde_display_update(struct 
drm_simple_display_pipe *pipe,
 {
struct drm_crtc *crtc = &pipe->crtc;
struct drm_device *drm = crtc->dev;
-   struct mcde *mcde = drm->dev_private;
+   struct mcde *mcde = to_mcde(drm);
struct drm_pending_vblank_event *event = crtc->state->event;
struct drm_plane *plane = &pipe->plane;
struct drm_plane_state *pstate = plane->state;
@@ -1078,7 +1078,7 @@ static int mcde_display_enable_vblank(struct 
drm_simple_display_pipe *pipe)
 {
struct drm_crtc *crtc = &pipe->crtc;
struct drm_device *drm = crtc->dev;
-   struct mcde *mcde = drm->dev_private;
+   struct mcde *mcde = to_mcde(drm);
u32 val;
 
/* Enable all VBLANK IRQs */
@@ -1097,7 +1097,7 @@ static void mcde_display_disable_vblank(struct 
drm_simple_display_pipe *pipe)
 {
struct drm_crtc *crtc = &pipe->crtc;
struct drm_device *drm = crtc->dev;
-   struct mcde *mcde = drm->dev_private;
+   struct mcde *mcde = to_mcde(drm);
 
/* Disable all VBLANK IRQs */
writel(0, mcde->regs + MCDE_IMSCPP);
@@ -1117,7 +1117,7 @@ static struct drm_simple_display_pipe_funcs 
mcde_display_funcs = {
 
 int mcde_display_init(struct drm_device *drm)
 {
-   struct mcde *mcde = drm->dev_private;
+   struct mcde *mcde = to_mcde(drm);
int ret;
static const u32 formats[] = {
DRM_FORMAT_ARGB,
diff --git a/drivers/gpu/drm/mcde/mcde_drm.h b/drivers/gpu/drm/mcde/mcde_drm.h
index 80edd6628979..679c2c4e6d9d 100644
--- a/drivers/gpu/drm/mcde/mcde_drm.h
+++ b/drivers/gpu/drm/mcde/mcde_drm.h
@@ -34,6 +34,8 @@ struct mcde {
struct regulator *vana;
 };
 
+#define to_mcde(dev) container_of(dev, struct mcde, drm)
+
 bool mcde_dsi_irq(struct mipi_dsi_device *mdsi);
 void mcde_dsi_te_request(struct mipi_dsi_device *mdsi);
 extern struct platform_driver mcde_dsi_driver;
diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index bdb525e3c5d7..84f3e2dbd77b 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -164,7 +164,7 @@ static irqreturn_t mcde_irq(int irq, void *data)
 static int mcde_modeset_init(struct drm_device *drm)
 {
struct drm_mode_config *mode_config;
-   struct mcde *mcde = drm->dev_private;
+   struct mcde *mcde = to_mcde(drm);
int ret;
 
if (!mcde->bridge) {
@@ -311,7 +311,6 @@ static int mcde_probe(struct platform_device *pdev)
if (IS_ERR(mcde))
return PTR_ERR(mcde);
drm = &mcde->drm;
-   drm->dev_private = mcde;
mcde->dev = dev;
platform_set_drvdata(pdev, drm);
 
@@ -486,7 +485,7 @@ static int mcde_probe(struct platform_device *pdev)
 static int mcde_remove(struct platform_device *pdev)
 {
struct drm_device *drm = platform_get_drvdata(pdev);
-   struct mcde *mcde = drm->dev_private;
+   struct mcde *mcde = to_mcde(drm);
 
component_master_del(&pdev->dev, &mcde_drm_comp_ops);
clk_disable_unprepare(mcde->mcde_clk);
diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index 7af5ebb0c436..1baa2324cdb9 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -1020,7 +1020,7 @@ static int mcde_dsi_bind(struct device *dev, struct 
device *master,
 void *data)
 {
struct drm_device *drm = data;
-   struct mcde *mcde = drm->dev_private;
+   struct mcde *mcde = to_mcde(drm);
struct mcde_dsi *d = dev_get_drvdata(dev);
struct device_node *child;
struct drm_panel *panel = NULL;
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 27/44] drm/tidss: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: Jyri Sarha 
Cc: Tomi Valkeinen 
---
 drivers/gpu/drm/tidss/tidss_drv.c | 15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/tidss/tidss_drv.c 
b/drivers/gpu/drm/tidss/tidss_drv.c
index ad449d104306..7d4465d58be8 100644
--- a/drivers/gpu/drm/tidss/tidss_drv.c
+++ b/drivers/gpu/drm/tidss/tidss_drv.c
@@ -135,20 +135,13 @@ static int tidss_probe(struct platform_device *pdev)
 
dev_dbg(dev, "%s\n", __func__);
 
-   /* Can't use devm_* since drm_device's lifetime may exceed dev's */
-   tidss = kzalloc(sizeof(*tidss), GFP_KERNEL);
-   if (!tidss)
-   return -ENOMEM;
+   tidss = devm_drm_dev_alloc(&pdev->dev, &tidss_driver,
+  struct tidss_device, ddev);
+   if (IS_ERR(tidss))
+   return PTR_ERR(tidss);
 
ddev = &tidss->ddev;
 
-   ret = devm_drm_dev_init(&pdev->dev, ddev, &tidss_driver);
-   if (ret) {
-   kfree(ddev);
-   return ret;
-   }
-   drmm_add_final_kfree(ddev, tidss);
-
tidss->dev = dev;
tidss->feat = of_device_get_match_data(dev);
 
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 18/44] drm/st7586: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: David Lechner 
---
 drivers/gpu/drm/tiny/st7586.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/tiny/st7586.c b/drivers/gpu/drm/tiny/st7586.c
index c3295c717ba6..2a1fae422f7a 100644
--- a/drivers/gpu/drm/tiny/st7586.c
+++ b/drivers/gpu/drm/tiny/st7586.c
@@ -317,18 +317,13 @@ static int st7586_probe(struct spi_device *spi)
size_t bufsize;
int ret;
 
-   dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
-   if (!dbidev)
-   return -ENOMEM;
+   dbidev = devm_drm_dev_alloc(dev, &st7586_driver,
+   struct mipi_dbi_dev, drm);
+   if (IS_ERR(dbidev))
+   return PTR_ERR(dbidev);
 
dbi = &dbidev->dbi;
drm = &dbidev->drm;
-   ret = devm_drm_dev_init(dev, drm, &st7586_driver);
-   if (ret) {
-   kfree(dbidev);
-   return ret;
-   }
-   drmm_add_final_kfree(drm, dbidev);
 
bufsize = (st7586_mode.vdisplay + 2) / 3 * st7586_mode.hdisplay;
 
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 32/44] drm/mcde: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: Linus Walleij 
---
 drivers/gpu/drm/mcde/mcde_drv.c | 16 
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index 88cc6b4a7a64..bdb525e3c5d7 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -307,24 +307,16 @@ static int mcde_probe(struct platform_device *pdev)
int ret;
int i;
 
-   mcde = kzalloc(sizeof(*mcde), GFP_KERNEL);
-   if (!mcde)
-   return -ENOMEM;
-   mcde->dev = dev;
-
-   ret = devm_drm_dev_init(dev, &mcde->drm, &mcde_drm_driver);
-   if (ret) {
-   kfree(mcde);
-   return ret;
-   }
+   mcde = devm_drm_dev_alloc(dev, &mcde_drm_driver, struct mcde, drm);
+   if (IS_ERR(mcde))
+   return PTR_ERR(mcde);
drm = &mcde->drm;
drm->dev_private = mcde;
-   drmm_add_final_kfree(drm, mcde);
+   mcde->dev = dev;
platform_set_drvdata(pdev, drm);
 
/* Enable continuous updates: this is what Linux' framebuffer expects */
mcde->oneshot_mode = false;
-   drm->dev_private = mcde;
 
/* First obtain and turn on the main power */
mcde->epod = devm_regulator_get(dev, "epod");
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 22/44] drm/ili9341: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: "Noralf Trønnes" 
Cc: Sam Ravnborg 
Cc: Daniel Vetter 
Cc: Eric Anholt 
Cc: David Lechner 
---
 drivers/gpu/drm/tiny/ili9341.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/tiny/ili9341.c b/drivers/gpu/drm/tiny/ili9341.c
index e152de369019..bb819f45a5d3 100644
--- a/drivers/gpu/drm/tiny/ili9341.c
+++ b/drivers/gpu/drm/tiny/ili9341.c
@@ -183,18 +183,13 @@ static int ili9341_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;
 
-   dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
-   if (!dbidev)
-   return -ENOMEM;
+   dbidev = devm_drm_dev_alloc(dev, &ili9341_driver,
+   struct mipi_dbi_dev, drm);
+   if (IS_ERR(dbidev))
+   return PTR_ERR(dbidev);
 
dbi = &dbidev->dbi;
drm = &dbidev->drm;
-   ret = devm_drm_dev_init(dev, drm, &ili9341_driver);
-   if (ret) {
-   kfree(dbidev);
-   return ret;
-   }
-   drmm_add_final_kfree(drm, dbidev);
 
dbi->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(dbi->reset)) {
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 25/44] drm/gm12u320: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: Hans de Goede 
---
 drivers/gpu/drm/tiny/gm12u320.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
index 6f0ea2827d62..907739a67bf6 100644
--- a/drivers/gpu/drm/tiny/gm12u320.c
+++ b/drivers/gpu/drm/tiny/gm12u320.c
@@ -631,22 +631,17 @@ static int gm12u320_usb_probe(struct usb_interface 
*interface,
if (interface->cur_altsetting->desc.bInterfaceNumber != 0)
return -ENODEV;
 
-   gm12u320 = kzalloc(sizeof(*gm12u320), GFP_KERNEL);
-   if (gm12u320 == NULL)
-   return -ENOMEM;
+   gm12u320 = devm_drm_dev_alloc(&interface->dev, &gm12u320_drm_driver,
+ struct gm12u320_device, dev);
+   if (IS_ERR(gm12u320))
+   return PTR_ERR(gm12u320);
 
gm12u320->udev = interface_to_usbdev(interface);
INIT_DELAYED_WORK(&gm12u320->fb_update.work, gm12u320_fb_update_work);
mutex_init(&gm12u320->fb_update.lock);
 
dev = &gm12u320->dev;
-   ret = devm_drm_dev_init(&interface->dev, dev, &gm12u320_drm_driver);
-   if (ret) {
-   kfree(gm12u320);
-   return ret;
-   }
dev->dev_private = gm12u320;
-   drmm_add_final_kfree(dev, gm12u320);
 
ret = drmm_mode_config_init(dev);
if (ret)
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 29/44] drm/tidss: Delete tidss->saved_state

2020-04-03 Thread Daniel Vetter
Not used anymore since the switch to suspend/resume helpers.

Signed-off-by: Daniel Vetter 
Cc: Jyri Sarha 
Cc: Tomi Valkeinen 
---
 drivers/gpu/drm/tidss/tidss_drv.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/tidss/tidss_drv.h 
b/drivers/gpu/drm/tidss/tidss_drv.h
index b23cd95c8d78..3b0a3d87b7c4 100644
--- a/drivers/gpu/drm/tidss/tidss_drv.h
+++ b/drivers/gpu/drm/tidss/tidss_drv.h
@@ -29,8 +29,6 @@ struct tidss_device {
 
spinlock_t wait_lock;   /* protects the irq masks */
dispc_irq_t irq_mask;   /* enabled irqs in addition to wait_list */
-
-   struct drm_atomic_state *saved_state;
 };
 
 #define to_tidss(__dev) container_of(__dev, struct tidss_device, ddev)
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 21/44] drm/ili9486: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: Kamlesh Gurudasani 
---
 drivers/gpu/drm/tiny/ili9486.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/tiny/ili9486.c b/drivers/gpu/drm/tiny/ili9486.c
index c4079bf9e2c8..2702ea557d29 100644
--- a/drivers/gpu/drm/tiny/ili9486.c
+++ b/drivers/gpu/drm/tiny/ili9486.c
@@ -197,18 +197,13 @@ static int ili9486_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;
 
-   dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
-   if (!dbidev)
-   return -ENOMEM;
+   dbidev = devm_drm_dev_alloc(dev, &ili9486_driver,
+   struct mipi_dbi_dev, drm);
+   if (IS_ERR(dbidev))
+   return PTR_ERR(dbidev);
 
dbi = &dbidev->dbi;
drm = &dbidev->drm;
-   ret = devm_drm_dev_init(dev, drm, &ili9486_driver);
-   if (ret) {
-   kfree(dbidev);
-   return ret;
-   }
-   drmm_add_final_kfree(drm, dbidev);
 
dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(dbi->reset)) {
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 14/44] drm/v3d: Delete v3d_dev->pdev

2020-04-03 Thread Daniel Vetter
We already have it in v3d_dev->drm.dev with zero additional pointer
chasing. Personally I don't like duplicated pointers like this
because:
- reviewers need to check whether the pointer is for the same or
different objects if there's multiple
- compilers have an easier time too

To avoid having to pull in some big headers I implemented the casting
function as a macro instead of a static inline. Typechecking thanks to
container_of still assured.

But also a bit a bikeshed, so feel free to ignore.

Signed-off-by: Daniel Vetter 
Cc: Eric Anholt 
---
 drivers/gpu/drm/v3d/v3d_drv.c | 3 +--
 drivers/gpu/drm/v3d/v3d_drv.h | 3 ++-
 drivers/gpu/drm/v3d/v3d_irq.c | 8 +---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index 37cb880f2826..82a7dfdd14c2 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -235,7 +235,7 @@ static int
 map_regs(struct v3d_dev *v3d, void __iomem **regs, const char *name)
 {
struct resource *res =
-   platform_get_resource_byname(v3d->pdev, IORESOURCE_MEM, name);
+   platform_get_resource_byname(v3d_to_pdev(v3d), IORESOURCE_MEM, 
name);
 
*regs = devm_ioremap_resource(v3d->drm.dev, res);
return PTR_ERR_OR_ZERO(*regs);
@@ -255,7 +255,6 @@ static int v3d_platform_drm_probe(struct platform_device 
*pdev)
if (IS_ERR(v3d))
return PTR_ERR(v3d);
 
-   v3d->pdev = pdev;
drm = &v3d->drm;
 
platform_set_drvdata(pdev, drm);
diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h
index 4d2d1f2fe1af..935f23b524b2 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.h
+++ b/drivers/gpu/drm/v3d/v3d_drv.h
@@ -46,7 +46,6 @@ struct v3d_dev {
int ver;
bool single_irq_line;
 
-   struct platform_device *pdev;
void __iomem *hub_regs;
void __iomem *core_regs[3];
void __iomem *bridge_regs;
@@ -128,6 +127,8 @@ v3d_has_csd(struct v3d_dev *v3d)
return v3d->ver >= 41;
 }
 
+#define v3d_to_pdev(v3d) to_platform_device(v3d->drm.dev)
+
 /* The per-fd struct, which tracks the MMU mappings. */
 struct v3d_file_priv {
struct v3d_dev *v3d;
diff --git a/drivers/gpu/drm/v3d/v3d_irq.c b/drivers/gpu/drm/v3d/v3d_irq.c
index f4ce6d057c90..51b65263c657 100644
--- a/drivers/gpu/drm/v3d/v3d_irq.c
+++ b/drivers/gpu/drm/v3d/v3d_irq.c
@@ -217,7 +217,7 @@ v3d_irq_init(struct v3d_dev *v3d)
V3D_CORE_WRITE(core, V3D_CTL_INT_CLR, V3D_CORE_IRQS);
V3D_WRITE(V3D_HUB_INT_CLR, V3D_HUB_IRQS);
 
-   irq1 = platform_get_irq(v3d->pdev, 1);
+   irq1 = platform_get_irq(v3d_to_pdev(v3d), 1);
if (irq1 == -EPROBE_DEFER)
return irq1;
if (irq1 > 0) {
@@ -226,7 +226,8 @@ v3d_irq_init(struct v3d_dev *v3d)
   "v3d_core0", v3d);
if (ret)
goto fail;
-   ret = devm_request_irq(v3d->drm.dev, 
platform_get_irq(v3d->pdev, 0),
+   ret = devm_request_irq(v3d->drm.dev,
+  platform_get_irq(v3d_to_pdev(v3d), 0),
   v3d_hub_irq, IRQF_SHARED,
   "v3d_hub", v3d);
if (ret)
@@ -234,7 +235,8 @@ v3d_irq_init(struct v3d_dev *v3d)
} else {
v3d->single_irq_line = true;
 
-   ret = devm_request_irq(v3d->drm.dev, 
platform_get_irq(v3d->pdev, 0),
+   ret = devm_request_irq(v3d->drm.dev,
+  platform_get_irq(v3d_to_pdev(v3d), 0),
   v3d_irq, IRQF_SHARED,
   "v3d", v3d);
if (ret)
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 35/44] drm/ingenic: Don't set drm_device->dev_private

2020-04-03 Thread Daniel Vetter
Entirely not used, just copypasta.

Signed-off-by: Daniel Vetter 
Cc: Paul Cercueil 
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c 
b/drivers/gpu/drm/ingenic/ingenic-drm.c
index bb62d8e93985..3386270cb8a3 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -622,7 +622,6 @@ static int ingenic_drm_probe(struct platform_device *pdev)
priv->soc_info = soc_info;
priv->dev = dev;
drm = &priv->drm;
-   drm->dev_private = priv;
 
platform_set_drvdata(pdev, priv);
 
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 26/44] drm/gm12u320: Don't use drm_device->dev_private

2020-04-03 Thread Daniel Vetter
Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Signed-off-by: Daniel Vetter 
Cc: Hans de Goede 
---
 drivers/gpu/drm/tiny/gm12u320.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
index 907739a67bf6..cc397671f689 100644
--- a/drivers/gpu/drm/tiny/gm12u320.c
+++ b/drivers/gpu/drm/tiny/gm12u320.c
@@ -98,6 +98,8 @@ struct gm12u320_device {
} fb_update;
 };
 
+#define to_gm12u320(__dev) container_of(__dev, struct gm12u320_device, dev)
+
 static const char cmd_data[CMD_SIZE] = {
0x55, 0x53, 0x42, 0x43, 0x00, 0x00, 0x00, 0x00,
0x68, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x10, 0xff,
@@ -408,7 +410,7 @@ static void gm12u320_fb_update_work(struct work_struct 
*work)
 static void gm12u320_fb_mark_dirty(struct drm_framebuffer *fb,
   struct drm_rect *dirty)
 {
-   struct gm12u320_device *gm12u320 = fb->dev->dev_private;
+   struct gm12u320_device *gm12u320 = to_gm12u320(fb->dev);
struct drm_framebuffer *old_fb = NULL;
bool wakeup = false;
 
@@ -558,7 +560,7 @@ static void gm12u320_pipe_enable(struct 
drm_simple_display_pipe *pipe,
 struct drm_plane_state *plane_state)
 {
struct drm_rect rect = { 0, 0, GM12U320_USER_WIDTH, GM12U320_HEIGHT };
-   struct gm12u320_device *gm12u320 = pipe->crtc.dev->dev_private;
+   struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
 
gm12u320->fb_update.draw_status_timeout = FIRST_FRAME_TIMEOUT;
gm12u320_fb_mark_dirty(plane_state->fb, &rect);
@@ -566,7 +568,7 @@ static void gm12u320_pipe_enable(struct 
drm_simple_display_pipe *pipe,
 
 static void gm12u320_pipe_disable(struct drm_simple_display_pipe *pipe)
 {
-   struct gm12u320_device *gm12u320 = pipe->crtc.dev->dev_private;
+   struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
 
gm12u320_stop_fb_update(gm12u320);
 }
@@ -641,7 +643,6 @@ static int gm12u320_usb_probe(struct usb_interface 
*interface,
mutex_init(&gm12u320->fb_update.lock);
 
dev = &gm12u320->dev;
-   dev->dev_private = gm12u320;
 
ret = drmm_mode_config_init(dev);
if (ret)
@@ -706,7 +707,7 @@ static __maybe_unused int gm12u320_suspend(struct 
usb_interface *interface,
 static __maybe_unused int gm12u320_resume(struct usb_interface *interface)
 {
struct drm_device *dev = usb_get_intfdata(interface);
-   struct gm12u320_device *gm12u320 = dev->dev_private;
+   struct gm12u320_device *gm12u320 = to_gm12u320(dev);
 
gm12u320_set_ecomode(gm12u320);
 
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 19/44] drm/repaper: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: "Noralf Trønnes" 
---
 drivers/gpu/drm/tiny/repaper.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
index 862c3ee6055d..1c0e7169545b 100644
--- a/drivers/gpu/drm/tiny/repaper.c
+++ b/drivers/gpu/drm/tiny/repaper.c
@@ -1002,19 +1002,13 @@ static int repaper_probe(struct spi_device *spi)
}
}
 
-   epd = kzalloc(sizeof(*epd), GFP_KERNEL);
-   if (!epd)
-   return -ENOMEM;
+   epd = devm_drm_dev_alloc(dev, &repaper_driver,
+struct repaper_epd, drm);
+   if (IS_ERR(epd))
+   return PTR_ERR(epd);
 
drm = &epd->drm;
 
-   ret = devm_drm_dev_init(dev, drm, &repaper_driver);
-   if (ret) {
-   kfree(epd);
-   return ret;
-   }
-   drmm_add_final_kfree(drm, epd);
-
ret = drmm_mode_config_init(drm);
if (ret)
return ret;
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 40/44] drm/cirrus: Don't use drm_device->dev_private

2020-04-03 Thread Daniel Vetter
Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Signed-off-by: Daniel Vetter 
Cc: Dave Airlie 
Cc: Gerd Hoffmann 
Cc: Daniel Vetter 
Cc: "Noralf Trønnes" 
Cc: Sam Ravnborg 
Cc: Eric Anholt 
Cc: Thomas Zimmermann 
Cc: virtualizat...@lists.linux-foundation.org
---
 drivers/gpu/drm/cirrus/cirrus.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index 4b65637147ba..744a8e337e41 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -59,6 +59,8 @@ struct cirrus_device {
void __iomem   *mmio;
 };
 
+#define to_cirrus(_dev) container_of(_dev, struct cirrus_device, dev)
+
 /* -- */
 /*
  * The meat of this driver. The core passes us a mode and we have to program
@@ -311,7 +313,7 @@ static int cirrus_mode_set(struct cirrus_device *cirrus,
 static int cirrus_fb_blit_rect(struct drm_framebuffer *fb,
   struct drm_rect *rect)
 {
-   struct cirrus_device *cirrus = fb->dev->dev_private;
+   struct cirrus_device *cirrus = to_cirrus(fb->dev);
void *vmap;
int idx, ret;
 
@@ -436,7 +438,7 @@ static void cirrus_pipe_enable(struct 
drm_simple_display_pipe *pipe,
   struct drm_crtc_state *crtc_state,
   struct drm_plane_state *plane_state)
 {
-   struct cirrus_device *cirrus = pipe->crtc.dev->dev_private;
+   struct cirrus_device *cirrus = to_cirrus(pipe->crtc.dev);
 
cirrus_mode_set(cirrus, &crtc_state->mode, plane_state->fb);
cirrus_fb_blit_fullscreen(plane_state->fb);
@@ -445,7 +447,7 @@ static void cirrus_pipe_enable(struct 
drm_simple_display_pipe *pipe,
 static void cirrus_pipe_update(struct drm_simple_display_pipe *pipe,
   struct drm_plane_state *old_state)
 {
-   struct cirrus_device *cirrus = pipe->crtc.dev->dev_private;
+   struct cirrus_device *cirrus = to_cirrus(pipe->crtc.dev);
struct drm_plane_state *state = pipe->plane.state;
struct drm_crtc *crtc = &pipe->crtc;
struct drm_rect rect;
@@ -573,7 +575,6 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
return PTR_ERR(cirrus);
 
dev = &cirrus->dev;
-   dev->dev_private = cirrus;
 
cirrus->vram = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 38/44] drm/armada: Don't use drm_device->dev_private

2020-04-03 Thread Daniel Vetter
Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.

Signed-off-by: Daniel Vetter 
Cc: Russell King 
---
 drivers/gpu/drm/armada/armada_crtc.c| 4 ++--
 drivers/gpu/drm/armada/armada_debugfs.c | 2 +-
 drivers/gpu/drm/armada/armada_drm.h | 2 ++
 drivers/gpu/drm/armada/armada_drv.c | 4 +---
 drivers/gpu/drm/armada/armada_fbdev.c   | 4 ++--
 drivers/gpu/drm/armada/armada_gem.c | 4 ++--
 drivers/gpu/drm/armada/armada_overlay.c | 8 
 7 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_crtc.c 
b/drivers/gpu/drm/armada/armada_crtc.c
index c2b92acd1e9a..8686e50226a5 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -757,7 +757,7 @@ static int armada_drm_crtc_cursor_move(struct drm_crtc 
*crtc, int x, int y)
 static void armada_drm_crtc_destroy(struct drm_crtc *crtc)
 {
struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
-   struct armada_private *priv = crtc->dev->dev_private;
+   struct armada_private *priv = drm_to_armada_dev(crtc->dev);
 
if (dcrtc->cursor_obj)
drm_gem_object_put_unlocked(&dcrtc->cursor_obj->obj);
@@ -901,7 +901,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, 
struct device *dev,
struct resource *res, int irq, const struct armada_variant *variant,
struct device_node *port)
 {
-   struct armada_private *priv = drm->dev_private;
+   struct armada_private *priv = drm_to_armada_dev(drm);
struct armada_crtc *dcrtc;
struct drm_plane *primary;
void __iomem *base;
diff --git a/drivers/gpu/drm/armada/armada_debugfs.c 
b/drivers/gpu/drm/armada/armada_debugfs.c
index c6fc2f1d58e9..29f4b52e3c8d 100644
--- a/drivers/gpu/drm/armada/armada_debugfs.c
+++ b/drivers/gpu/drm/armada/armada_debugfs.c
@@ -19,7 +19,7 @@ static int armada_debugfs_gem_linear_show(struct seq_file *m, 
void *data)
 {
struct drm_info_node *node = m->private;
struct drm_device *dev = node->minor->dev;
-   struct armada_private *priv = dev->dev_private;
+   struct armada_private *priv = drm_to_armada_dev(dev);
struct drm_printer p = drm_seq_file_printer(m);
 
mutex_lock(&priv->linear_lock);
diff --git a/drivers/gpu/drm/armada/armada_drm.h 
b/drivers/gpu/drm/armada/armada_drm.h
index a11bdaccbb33..6a5a87932576 100644
--- a/drivers/gpu/drm/armada/armada_drm.h
+++ b/drivers/gpu/drm/armada/armada_drm.h
@@ -73,6 +73,8 @@ struct armada_private {
 #endif
 };
 
+#define drm_to_armada_dev(dev) container_of(dev, struct armada_private, drm)
+
 int armada_fbdev_init(struct drm_device *);
 void armada_fbdev_fini(struct drm_device *);
 
diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index 2546ff9d1c92..2a9ee76ee585 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -106,8 +106,6 @@ static int armada_drm_bind(struct device *dev)
return ret;
}
 
-   priv->drm.dev_private = priv;
-
dev_set_drvdata(dev, &priv->drm);
 
/* Mode setting support */
@@ -169,7 +167,7 @@ static int armada_drm_bind(struct device *dev)
 static void armada_drm_unbind(struct device *dev)
 {
struct drm_device *drm = dev_get_drvdata(dev);
-   struct armada_private *priv = drm->dev_private;
+   struct armada_private *priv = drm_to_armada_dev(drm);
 
drm_kms_helper_poll_fini(&priv->drm);
armada_fbdev_fini(&priv->drm);
diff --git a/drivers/gpu/drm/armada/armada_fbdev.c 
b/drivers/gpu/drm/armada/armada_fbdev.c
index f2dc371bd8e5..c9a414b3a8c4 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -117,7 +117,7 @@ static const struct drm_fb_helper_funcs 
armada_fb_helper_funcs = {
 
 int armada_fbdev_init(struct drm_device *dev)
 {
-   struct armada_private *priv = dev->dev_private;
+   struct armada_private *priv = drm_to_armada_dev(dev);
struct drm_fb_helper *fbh;
int ret;
 
@@ -151,7 +151,7 @@ int armada_fbdev_init(struct drm_device *dev)
 
 void armada_fbdev_fini(struct drm_device *dev)
 {
-   struct armada_private *priv = dev->dev_private;
+   struct armada_private *priv = drm_to_armada_dev(dev);
struct drm_fb_helper *fbh = priv->fbdev;
 
if (fbh) {
diff --git a/drivers/gpu/drm/armada/armada_gem.c 
b/drivers/gpu/drm/armada/armada_gem.c
index 976685f2939e..2c7d5f71e715 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -39,7 +39,7 @@ static size_t roundup_gem_size(size_t size)
 void armada_gem_free_object(struct drm_gem_object *obj)
 {
struct armada_gem_object *dobj = drm_to_armada_gem(obj);
-   struct armada_private *priv = obj->dev->dev_private;
+   struct armada_private *priv = drm_to_armada_dev(obj->dev);
 
DRM_DEBUG_DRIVER("release obj %p\n", dobj);
 
@@ -77,7 +77,7 @@ 

[Intel-gfx] [PATCH 44/44] drm/managed: Cleanup of unused functions and polishing docs

2020-04-03 Thread Daniel Vetter
Following functions are only used internally, not by drivers:
- drm_dev_init
- devm_drm_dev_init
- drmm_add_final_kfree

Also, now that we have a very slick and polished way to allocate a
drm_device with devm_drm_dev_alloc, update all the docs to reflect the
new reality. Mostly this consists of deleting old and misleading
hints. Two main ones:

- it is no longer required that the drm_device base class is first in
  the structure. devm_drm_dev_alloc can cope with it being anywhere

- obviously embedded no needs devm_drm_dev_alloc

Signed-off-by: Daniel Vetter 
---
 .../driver-api/driver-model/devres.rst|   2 +-
 drivers/gpu/drm/drm_drv.c | 119 --
 drivers/gpu/drm/drm_internal.h|   1 +
 drivers/gpu/drm/drm_managed.c |  15 +--
 include/drm/drm_device.h  |   2 +-
 include/drm/drm_drv.h |  20 +--
 6 files changed, 34 insertions(+), 125 deletions(-)

diff --git a/Documentation/driver-api/driver-model/devres.rst 
b/Documentation/driver-api/driver-model/devres.rst
index 46c13780994c..74a4a3fa8c52 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -263,7 +263,7 @@ DMA
   dmam_pool_destroy()
 
 DRM
-  devm_drm_dev_init()
+  devm_drm_dev_alloc()
 
 GPIO
   devm_gpiod_get()
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 9e60b784b3ac..64e20c630aa7 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -240,13 +240,13 @@ void drm_minor_release(struct drm_minor *minor)
  * DOC: driver instance overview
  *
  * A device instance for a drm driver is represented by &struct drm_device. 
This
- * is initialized with drm_dev_init(), usually from bus-specific ->probe()
- * callbacks implemented by the driver. The driver then needs to initialize all
- * the various subsystems for the drm device like memory management, vblank
- * handling, modesetting support and intial output configuration plus obviously
- * initialize all the corresponding hardware bits. Finally when everything is 
up
- * and running and ready for userspace the device instance can be published
- * using drm_dev_register().
+ * is allocated and initialized with devm_drm_dev_alloc(), usually from
+ * bus-specific ->probe() callbacks implemented by the driver. The driver then
+ * needs to initialize all the various subsystems for the drm device like 
memory
+ * management, vblank handling, modesetting support and intial output
+ * configuration plus obviously initialize all the corresponding hardware bits.
+ * Finally when everything is up and running and ready for userspace the device
+ * instance can be published using drm_dev_register().
  *
  * There is also deprecated support for initalizing device instances using
  * bus-specific helpers and the &drm_driver.load callback. But due to
@@ -274,7 +274,7 @@ void drm_minor_release(struct drm_minor *minor)
  *
  * The following example shows a typical structure of a DRM display driver.
  * The example focus on the probe() function and the other functions that is
- * almost always present and serves as a demonstration of devm_drm_dev_init().
+ * almost always present and serves as a demonstration of devm_drm_dev_alloc().
  *
  * .. code-block:: c
  *
@@ -294,22 +294,12 @@ void drm_minor_release(struct drm_minor *minor)
  * struct drm_device *drm;
  * int ret;
  *
- * // devm_kzalloc() can't be used here because the drm_device '
- * // lifetime can exceed the device lifetime if driver unbind
- * // happens when userspace still has open file descriptors.
- * priv = kzalloc(sizeof(*priv), GFP_KERNEL);
- * if (!priv)
- * return -ENOMEM;
- *
+ * priv = devm_drm_dev_alloc(&pdev->dev, &driver_drm_driver,
+ *   struct driver_device, drm);
+ * if (IS_ERR(priv))
+ * return PTR_ERR(priv);
  * drm = &priv->drm;
  *
- * ret = devm_drm_dev_init(&pdev->dev, drm, &driver_drm_driver);
- * if (ret) {
- * kfree(priv);
- * return ret;
- * }
- * drmm_add_final_kfree(drm, priv);
- *
  * ret = drmm_mode_config_init(drm);
  * if (ret)
  * return ret;
@@ -550,9 +540,9 @@ static void drm_fs_inode_free(struct inode *inode)
  * following guidelines apply:
  *
  *  - The entire device initialization procedure should be run from the
- *&component_master_ops.master_bind callback, starting with drm_dev_init(),
- *then binding all components with component_bind_all() and finishing with
- *drm_dev_register().
+ *&component_master_ops.master_bind callback, starting with
+ *devm_drm_dev_alloc(), then binding all components with
+ *component_bind_all() and finishing with drm_de

[Intel-gfx] [PATCH 36/44] drm/komeda: use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Komeda uses the component framework, which does open/close a new
devres group around all the bind callbacks. Which means we can use
devm_ functions for managing the drm_device cleanup, with leaking
stuff in case of deferred probes or other reasons to unbind
components, or the component_master.

Also note that this fixes a double-free in the probe unroll code, bot
drm_dev_put and kfree(kms) result in the kms allocation getting freed.

Aside: komeda_bind could be cleaned up a lot, devm_kfree is a bit
redundant. Plus I'm not clear on why there's suballocations for
mdrv->mdev and mdrv->kms. Plus I'm not sure the lifetimes are correct
with all that devm_kzalloc usage ... That structure layout is also the
reason why komeda still uses drm_device->dev_private and can't easily
be replaced with a proper container_of upcasting. I'm pretty sure that
there's endless amounts of hotunplug/hotremove bugs in there with all
the unprotected dereferencing of drm_device->dev_private.

Signed-off-by: Daniel Vetter 
Cc: "James (Qian) Wang" 
Cc: Liviu Dudau 
Cc: Mihail Atanassov 
---
 drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 16 +---
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c 
b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
index 16dfd5cdb66c..6b85d5f4caa8 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
@@ -261,18 +261,16 @@ static void komeda_kms_mode_config_init(struct 
komeda_kms_dev *kms,
 
 struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
 {
-   struct komeda_kms_dev *kms = kzalloc(sizeof(*kms), GFP_KERNEL);
+   struct komeda_kms_dev *kms;
struct drm_device *drm;
int err;
 
-   if (!kms)
-   return ERR_PTR(-ENOMEM);
+   kms = devm_drm_dev_alloc(mdev->dev, &komeda_kms_driver,
+struct komeda_kms_dev, base);
+   if (IS_ERR(kms))
+   return kms;
 
drm = &kms->base;
-   err = drm_dev_init(drm, &komeda_kms_driver, mdev->dev);
-   if (err)
-   goto free_kms;
-   drmm_add_final_kfree(drm, kms);
 
drm->dev_private = mdev;
 
@@ -329,9 +327,6 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev 
*mdev)
drm_mode_config_cleanup(drm);
komeda_kms_cleanup_private_objs(kms);
drm->dev_private = NULL;
-   drm_dev_put(drm);
-free_kms:
-   kfree(kms);
return ERR_PTR(err);
 }
 
@@ -348,5 +343,4 @@ void komeda_kms_detach(struct komeda_kms_dev *kms)
drm_mode_config_cleanup(drm);
komeda_kms_cleanup_private_objs(kms);
drm->dev_private = NULL;
-   drm_dev_put(drm);
 }
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 42/44] drm/i915/selftest: Create mock_destroy_device

2020-04-03 Thread Daniel Vetter
Just some prep work before we rework the lifetime handling, which
requires replacing all the drm_dev_put in selftests by something else.

Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c   | 2 +-
 drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 2 +-
 drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c  | 2 +-
 drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c  | 2 +-
 drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c| 2 +-
 drivers/gpu/drm/i915/gt/selftest_timeline.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_request.c | 2 +-
 drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
 drivers/gpu/drm/i915/selftests/intel_memory_region.c  | 2 +-
 drivers/gpu/drm/i915/selftests/mock_gem_device.c  | 2 +-
 drivers/gpu/drm/i915/selftests/mock_gem_device.h  | 5 +
 13 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c 
b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index 2d0fd50c5312..d19bb011fc6b 100644
--- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
@@ -1789,7 +1789,7 @@ int i915_gem_huge_page_mock_selftests(void)
i915_vm_put(&ppgtt->vm);
 
 out_unlock:
-   drm_dev_put(&dev_priv->drm);
+   mock_destroy_device(dev_priv);
return err;
 }
 
diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c 
b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
index f4f933240b39..d9d96d23e37e 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
@@ -1986,7 +1986,7 @@ int i915_gem_context_mock_selftests(void)
 
err = i915_subtests(tests, i915);
 
-   drm_dev_put(&i915->drm);
+   mock_destroy_device(i915);
return err;
 }
 
diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c 
b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c
index 2a52b92586b9..0845ce1ae37c 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c
@@ -272,7 +272,7 @@ int i915_gem_dmabuf_mock_selftests(void)
 
err = i915_subtests(tests, i915);
 
-   drm_dev_put(&i915->drm);
+   mock_destroy_device(i915);
return err;
 }
 
diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c 
b/drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c
index 2b6db6f799de..085644edebfc 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c
@@ -85,7 +85,7 @@ int i915_gem_object_mock_selftests(void)
 
err = i915_subtests(tests, i915);
 
-   drm_dev_put(&i915->drm);
+   mock_destroy_device(i915);
return err;
 }
 
diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c 
b/drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c
index 34932871b3a5..2a9709eb5a42 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c
@@ -73,6 +73,6 @@ int i915_gem_phys_mock_selftests(void)
 
err = i915_subtests(tests, i915);
 
-   drm_dev_put(&i915->drm);
+   mock_destroy_device(i915);
return err;
 }
diff --git a/drivers/gpu/drm/i915/gt/selftest_timeline.c 
b/drivers/gpu/drm/i915/gt/selftest_timeline.c
index c2578a0f2f14..1c0865227714 100644
--- a/drivers/gpu/drm/i915/gt/selftest_timeline.c
+++ b/drivers/gpu/drm/i915/gt/selftest_timeline.c
@@ -157,7 +157,7 @@ static int mock_hwsp_freelist(void *arg)
__mock_hwsp_record(&state, na, NULL);
kfree(state.history);
 err_put:
-   drm_dev_put(&i915->drm);
+   mock_destroy_device(i915);
return err;
 }
 
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c 
b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
index 028baae9631f..f88473d396f4 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
@@ -536,7 +536,7 @@ int i915_gem_evict_mock_selftests(void)
with_intel_runtime_pm(&i915->runtime_pm, wakeref)
err = i915_subtests(tests, &i915->gt);
 
-   drm_dev_put(&i915->drm);
+   mock_destroy_device(i915);
return err;
 }
 
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c 
b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 5d2a02fcf595..035e4f77f06f 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1714,7 +1714,7 @@ int i915_gem_gtt_mock_selftests(void)
mock_fini_ggtt(ggtt);
kfree(ggtt);
 out_put:
-   drm_dev_put(&i915->drm);
+   mock_destroy_device(i915);
return err;
 }
 
diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c 
b/drivers/gpu/drm/i915/selftests

[Intel-gfx] [PATCH 37/44] drm/armada: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Also remove the now no longer needed build bug on since that's already
not needed anymore with drmm_add_final_kfree. Conversion to managed
drm_device cleanup is easy, the final drm_dev_put() is already the
last thing in both the bind unbind as in the unbind flow.

Also, this relies on component.c correctly wrapping bind&unbind in
separate devres groups, which it does.

Signed-off-by: Daniel Vetter 
Cc: Russell King 
---
 drivers/gpu/drm/armada/armada_drv.c | 26 ++
 1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index dd9ed71ed942..2546ff9d1c92 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -87,24 +87,13 @@ static int armada_drm_bind(struct device *dev)
 "armada-drm"))
return -EBUSY;
 
-   priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-   if (!priv)
-   return -ENOMEM;
-
-   /*
-* The drm_device structure must be at the start of
-* armada_private for drm_dev_put() to work correctly.
-*/
-   BUILD_BUG_ON(offsetof(struct armada_private, drm) != 0);
-
-   ret = drm_dev_init(&priv->drm, &armada_drm_driver, dev);
-   if (ret) {
-   dev_err(dev, "[" DRM_NAME ":%s] drm_dev_init failed: %d\n",
-   __func__, ret);
-   kfree(priv);
-   return ret;
+   priv = devm_drm_dev_alloc(dev, &armada_drm_driver,
+ struct armada_private, drm);
+   if (IS_ERR(priv)) {
+   dev_err(dev, "[" DRM_NAME ":%s] devm_drm_dev_alloc failed: 
%li\n",
+   __func__, PTR_ERR(priv));
+   return PTR_ERR(priv);
}
-   drmm_add_final_kfree(&priv->drm, priv);
 
/* Remove early framebuffers */
ret = drm_fb_helper_remove_conflicting_framebuffers(NULL,
@@ -174,7 +163,6 @@ static int armada_drm_bind(struct device *dev)
  err_kms:
drm_mode_config_cleanup(&priv->drm);
drm_mm_takedown(&priv->linear);
-   drm_dev_put(&priv->drm);
return ret;
 }
 
@@ -194,8 +182,6 @@ static void armada_drm_unbind(struct device *dev)
 
drm_mode_config_cleanup(&priv->drm);
drm_mm_takedown(&priv->linear);
-
-   drm_dev_put(&priv->drm);
 }
 
 static int compare_of(struct device *dev, void *data)
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 39/44] drm/cirrus: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Already using devm_drm_dev_init, so very simple replacment.

Signed-off-by: Daniel Vetter 
Cc: Dave Airlie 
Cc: Gerd Hoffmann 
Cc: Daniel Vetter 
Cc: Sam Ravnborg 
Cc: "Noralf Trønnes" 
Cc: Rob Herring 
Cc: Thomas Zimmermann 
Cc: virtualizat...@lists.linux-foundation.org
Cc: Emil Velikov 
---
 drivers/gpu/drm/cirrus/cirrus.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index a36269717c3b..4b65637147ba 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -567,18 +567,13 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
return ret;
 
ret = -ENOMEM;
-   cirrus = kzalloc(sizeof(*cirrus), GFP_KERNEL);
-   if (cirrus == NULL)
-   return ret;
+   cirrus = devm_drm_dev_alloc(&pdev->dev, &cirrus_driver,
+   struct cirrus_device, dev);
+   if (IS_ERR(cirrus))
+   return PTR_ERR(cirrus);
 
dev = &cirrus->dev;
-   ret = devm_drm_dev_init(&pdev->dev, dev, &cirrus_driver);
-   if (ret) {
-   kfree(cirrus);
-   return ret;
-   }
dev->dev_private = cirrus;
-   drmm_add_final_kfree(dev, cirrus);
 
cirrus->vram = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 43/44] drm/i915/selftests: align more to real device lifetimes

2020-04-03 Thread Daniel Vetter
The big change is device_add so that device_del can auto-cleanup
devres resources. This allows us to use devm_drm_dev_alloc, which
removes the last user of drm_dev_init.

Signed-off-by: Daniel Vetter 
---
 .../gpu/drm/i915/selftests/mock_gem_device.c  | 31 +--
 .../gpu/drm/i915/selftests/mock_gem_device.h  |  2 +-
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c 
b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
index 03607647cdeb..ea73d1f7cf12 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@ -123,12 +123,6 @@ struct drm_i915_private *mock_gem_device(void)
pdev = kzalloc(sizeof(*pdev), GFP_KERNEL);
if (!pdev)
return NULL;
-   i915 = kzalloc(sizeof(*i915), GFP_KERNEL);
-   if (!i915) {
-   kfree(pdev);
-   return NULL;
-   }
-
device_initialize(&pdev->dev);
pdev->class = PCI_BASE_CLASS_DISPLAY << 16;
pdev->dev.release = release_dev;
@@ -139,8 +133,23 @@ struct drm_i915_private *mock_gem_device(void)
/* hack to disable iommu for the fake device; force identity mapping */
pdev->dev.archdata.iommu = (void *)-1;
 #endif
+   err = device_add(&pdev->dev);
+   if (err) {
+   kfree(pdev);
+   return NULL;
+   }
+
+   i915 = devm_drm_dev_alloc(&pdev->dev, &mock_driver,
+ struct drm_i915_private, drm);
+   if (err) {
+   pr_err("Failed to allocate mock GEM device: err=%d\n", err);
+   put_device(&pdev->dev);
+
+   return NULL;
+   }
 
pci_set_drvdata(pdev, i915);
+   i915->drm.pdev = pdev;
 
dev_pm_domain_set(&pdev->dev, &pm_domain);
pm_runtime_enable(&pdev->dev);
@@ -148,16 +157,6 @@ struct drm_i915_private *mock_gem_device(void)
if (pm_runtime_enabled(&pdev->dev))
WARN_ON(pm_runtime_get_sync(&pdev->dev));
 
-   err = drm_dev_init(&i915->drm, &mock_driver, &pdev->dev);
-   if (err) {
-   pr_err("Failed to initialise mock GEM device: err=%d\n", err);
-   put_device(&pdev->dev);
-   kfree(i915);
-
-   return NULL;
-   }
-   i915->drm.pdev = pdev;
-   drmm_add_final_kfree(&i915->drm, i915);
 
intel_runtime_pm_init_early(&i915->runtime_pm);
 
diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.h 
b/drivers/gpu/drm/i915/selftests/mock_gem_device.h
index 2e3c7585a7bb..4f309a05c85a 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.h
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.h
@@ -9,7 +9,7 @@ void mock_device_flush(struct drm_i915_private *i915);
 
 static inline void mock_destroy_device(struct drm_i915_private *i915)
 {
-   drm_dev_put(&i915->drm);
+   device_del(i915->drm.dev);
 }
 
 #endif /* !__MOCK_GEM_DEVICE_H__ */
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 41/44] drm/i915: Use devm_drm_dev_alloc

2020-04-03 Thread Daniel Vetter
Luckily we're already well set up in the main driver, with
drm_dev_put() being the last thing in both the unload error case and
the pci remove function.

Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_drv.c | 17 -
 drivers/gpu/drm/i915/i915_pci.c |  2 --
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index a7a3b4b98572..9c0ff25c5d41 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -879,19 +879,11 @@ i915_driver_create(struct pci_dev *pdev, const struct 
pci_device_id *ent)
(struct intel_device_info *)ent->driver_data;
struct intel_device_info *device_info;
struct drm_i915_private *i915;
-   int err;
 
-   i915 = kzalloc(sizeof(*i915), GFP_KERNEL);
-   if (!i915)
-   return ERR_PTR(-ENOMEM);
-
-   err = drm_dev_init(&i915->drm, &driver, &pdev->dev);
-   if (err) {
-   kfree(i915);
-   return ERR_PTR(err);
-   }
-
-   drmm_add_final_kfree(&i915->drm, i915);
+   i915 = devm_drm_dev_alloc(&pdev->dev, &driver,
+ struct drm_i915_private, drm);
+   if (IS_ERR(i915))
+   return i915;
 
i915->drm.pdev = pdev;
pci_set_drvdata(pdev, i915);
@@ -1008,7 +1000,6 @@ int i915_driver_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
pci_disable_device(pdev);
 out_fini:
i915_probe_error(i915, "Device initialization failed (%d)\n", ret);
-   drm_dev_put(&i915->drm);
return ret;
 }
 
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 2c80a0194c80..0f8b439d6fd5 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -920,8 +920,6 @@ static void i915_pci_remove(struct pci_dev *pdev)
 
i915_driver_remove(i915);
pci_set_drvdata(pdev, NULL);
-
-   drm_dev_put(&i915->drm);
 }
 
 /* is device_id present in comma separated list of ids */
-- 
2.25.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Keep a per-engine request pools

2020-04-03 Thread Chris Wilson
Quoting Janusz Krzysztofik (2020-04-03 14:58:47)
> On Thu, 2020-04-02 at 19:40 +0100, Chris Wilson wrote:
> > Add a tiny per-engine request mempool so that we should always have a
> > request available for powermanagement allocations from tricky
> > contexts. This reserve is expected to be only used for kernel
> > contexts when barriers must be emitted [almost] without fail.
> > 
> > The main consumer for this reserved request is expected to be engine-pm,
> > for which we know that there will always be at least the previous pm
> > request that we can reuse under mempressure (so there should always be
> > a spare request for engine_park()).
> > 
> > This is an alternative to using a comparatively bulky mempool, which
> > requires custom handling for both our reserved allocation requirement
> > and to protect our TYPESAFE_BY_RCU slab cache.
> 
> This change resolves the issue for me, and being more simple than the
> mempool approach, looks still better.

Cool. I couldn't decide if mempool was worth it or not. If we needed
more than a single slot, definitely, but the impedance mismatch and that
the general advice is not to add more mempools suggest no.

Thanks,
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/gt: move remaining debugfs interfaces into gt (rev3)

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915/gt: move remaining debugfs interfaces into gt (rev3)
URL   : https://patchwork.freedesktop.org/series/75333/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8238_full -> Patchwork_17188_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17188_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17188_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17188_full:

### IGT changes ###

 Possible regressions 

  * igt@i915_pm_rpm@debugfs-forcewake-user:
- shard-iclb: [PASS][1] -> [SKIP][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb7/igt@i915_pm_...@debugfs-forcewake-user.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-iclb3/igt@i915_pm_...@debugfs-forcewake-user.html
- shard-tglb: [PASS][3] -> [SKIP][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-tglb7/igt@i915_pm_...@debugfs-forcewake-user.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-tglb1/igt@i915_pm_...@debugfs-forcewake-user.html

  * igt@i915_suspend@forcewake:
- shard-snb:  [PASS][5] -> [FAIL][6] +1 similar issue
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-snb4/igt@i915_susp...@forcewake.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-snb4/igt@i915_susp...@forcewake.html

  * igt@perf_pmu@rc6:
- shard-apl:  [PASS][7] -> [FAIL][8] +3 similar issues
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl1/igt@perf_...@rc6.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-apl7/igt@perf_...@rc6.html
- shard-glk:  [PASS][9] -> [FAIL][10] +5 similar issues
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk6/igt@perf_...@rc6.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-glk1/igt@perf_...@rc6.html
- shard-tglb: [PASS][11] -> [FAIL][12] +3 similar issues
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-tglb5/igt@perf_...@rc6.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-tglb5/igt@perf_...@rc6.html
- shard-kbl:  [PASS][13] -> [FAIL][14] +4 similar issues
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl7/igt@perf_...@rc6.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-kbl2/igt@perf_...@rc6.html

  * igt@perf_pmu@rc6-runtime-pm:
- shard-skl:  [PASS][15] -> [FAIL][16] +2 similar issues
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl9/igt@perf_...@rc6-runtime-pm.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-skl8/igt@perf_...@rc6-runtime-pm.html

  * igt@perf_pmu@rc6-runtime-pm-long:
- shard-iclb: [PASS][17] -> [FAIL][18] +3 similar issues
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb6/igt@perf_...@rc6-runtime-pm-long.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-iclb6/igt@perf_...@rc6-runtime-pm-long.html
- shard-skl:  NOTRUN -> [FAIL][19]
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-skl3/igt@perf_...@rc6-runtime-pm-long.html

  
Known issues


  Here are the changes found in Patchwork_17188_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@gem_cs_tlb@vcs1:
- shard-iclb: [PASS][20] -> [SKIP][21] ([fdo#112080])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb4/igt@gem_cs_...@vcs1.html
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-iclb7/igt@gem_cs_...@vcs1.html

  * igt@i915_pm_rpm@debugfs-forcewake-user:
- shard-skl:  [PASS][22] -> [SKIP][23] ([fdo#109271])
   [22]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl8/igt@i915_pm_...@debugfs-forcewake-user.html
   [23]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-skl5/igt@i915_pm_...@debugfs-forcewake-user.html

  * igt@i915_pm_sseu@full-enable:
- shard-apl:  [PASS][24] -> [SKIP][25] ([fdo#109271]) +1 similar 
issue
   [24]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl8/igt@i915_pm_s...@full-enable.html
   [25]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17188/shard-apl4/igt@i915_pm_s...@full-enable.html
- shard-kbl:  [PASS][26] -> [SKIP][27] ([fdo#109271]) +1 similar 
issue
   [26]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl4/igt@i91

Re: [Intel-gfx] [Mesa-dev] gitlab.fd.o financial situation and impact on services

2020-04-03 Thread Michel Dänzer
On 2020-03-01 6:46 a.m., Marek Olšák wrote:
> For Mesa, we could run CI only when Marge pushes, so that it's a strictly
> pre-merge CI.

Thanks for the suggestion! I implemented something like this for Mesa:

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4432


-- 
Earthling Michel Dänzer   |   https://redhat.com
Libre software enthusiast | Mesa and X developer
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.BUILD: failure for devm_drm_dev_alloc, no more drmm_add_final_kfree

2020-04-03 Thread Patchwork
== Series Details ==

Series: devm_drm_dev_alloc, no more drmm_add_final_kfree
URL   : https://patchwork.freedesktop.org/series/75463/
State : failure

== Summary ==

CALLscripts/checksyscalls.sh
  CALLscripts/atomic/check-atomics.sh
  DESCEND  objtool
  CHK include/generated/compile.h
  HDRTEST drivers/gpu/drm/i915/selftests/mock_gem_device.h
In file included from :0:0:
./drivers/gpu/drm/i915/selftests/mock_gem_device.h: In function 
‘mock_destroy_device’:
./drivers/gpu/drm/i915/selftests/mock_gem_device.h:12:2: error: implicit 
declaration of function ‘device_del’ [-Werror=implicit-function-declaration]
  device_del(i915->drm.dev);
  ^~
./drivers/gpu/drm/i915/selftests/mock_gem_device.h:12:17: error: dereferencing 
pointer to incomplete type ‘struct drm_i915_private’
  device_del(i915->drm.dev);
 ^~
cc1: all warnings being treated as errors
drivers/gpu/drm/i915/Makefile:298: recipe for target 
'drivers/gpu/drm/i915/selftests/mock_gem_device.hdrtest' failed
make[4]: *** [drivers/gpu/drm/i915/selftests/mock_gem_device.hdrtest] Error 1
scripts/Makefile.build:505: recipe for target 'drivers/gpu/drm/i915' failed
make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:505: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:505: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1683: recipe for target 'drivers' failed
make: *** [drivers] Error 2

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 01/44] drivers/base: Always release devres on device_del

2020-04-03 Thread Greg Kroah-Hartman
On Fri, Apr 03, 2020 at 03:57:45PM +0200, Daniel Vetter wrote:
> In drm we've added nice drm_device (the main gpu driver thing, which
> also represents the userspace interfaces and has everything else
> dangling off it) init functions using devres, devm_drm_dev_init and
> soon devm_drm_dev_alloc (this patch series adds that).
> 
> A slight trouble is that drm_device itself holds a reference on the
> struct device it's sitting on top (for sysfs links and dmesg debug and
> lots of other things), so there's a reference loop. For real drivers
> this is broken at remove/unplug time, where all devres resources are
> released device_release_driver(), before the final device reference is
> dropped. So far so good.
> 
> There's 2 exceptions:
> - drm/vkms|vgem: Virtual drivers for which we create a fake/virtual
>   platform device to make them look more like normal devices to
>   userspace. These aren't drivers in the driver model sense, we simple
>   create a platform_device and register it.

That's a horrid abuse of platform devices, just use a "virtual" device
please, create/remove it when you need it, and all should be fine.

> - drm/i915/selftests, where we create minimal mock devices, and again
>   the selftests aren't proper drivers in the driver model sense.

Again, virtual devices are best to use for this.

> For these two cases the reference loop isn't broken, because devres is
> only cleaned up when the last device reference is dropped. But that's
> not happening, because the drm_device holds that last struct device
> reference.
> 
> Thus far this wasn't a problem since the above cases simply
> hand-rolled their cleanup code. But I want to convert all drivers over
> to the devm_ versions, hence it would be really nice if these
> virtual/fake/mock uses-cases could also be managed with devres
> cleanup.
> 
> I see three possible approaches:
> 
> - Clean up devres from device_del (or platform_device_unregister) even
>   when no driver is bound. This seems like the simplest solution, but
>   also the one with the widest impact, and what this patch implements.
>   We might want to include more of the cleanup than just
>   devres_release_all, but this is all I need to get my use case going.

After device_del, you should never be using that structure again anyway.
So why is there any "resource leak"?  You can't recycle the structure,
and you can't assign it to anything else, so eventually you have to do
a final put on the thing, which will free up the resources.

And then all should be fine, right?  But, by putting the freeing here,
you can still have a "live" device that thinks it has resources availble
that it can access, but yet they are now gone.  Yeah, it's probably not
ever going to really happen, but the lifecycles of dynamic devices are
tough to "prove" at times, and I worry that freeing things this early is
going to cause odd disconnect issues.

thanks,

greg k-h
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Keep a per-engine request pools (rev2)

2020-04-03 Thread Patchwork
== Series Details ==

Series: drm/i915: Keep a per-engine request pools (rev2)
URL   : https://patchwork.freedesktop.org/series/75427/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8238_full -> Patchwork_17189_full


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_17189_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17189_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_17189_full:

### IGT changes ###

 Possible regressions 

  * igt@gem_mmap_gtt@cpuset-basic-small-copy-xy:
- shard-skl:  [PASS][1] -> [FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl2/igt@gem_mmap_...@cpuset-basic-small-copy-xy.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-skl7/igt@gem_mmap_...@cpuset-basic-small-copy-xy.html

  * igt@gem_mmap_gtt@hang:
- shard-iclb: [PASS][3] -> [FAIL][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-iclb1/igt@gem_mmap_...@hang.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-iclb2/igt@gem_mmap_...@hang.html

  * igt@i915_pm_rc6_residency@rc6-idle:
- shard-snb:  [PASS][5] -> [FAIL][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-snb6/igt@i915_pm_rc6_reside...@rc6-idle.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-snb5/igt@i915_pm_rc6_reside...@rc6-idle.html

  
Known issues


  Here are the changes found in Patchwork_17189_full that come from known 
issues:

### IGT changes ###

 Issues hit 

  * igt@i915_selftest@live@execlists:
- shard-apl:  [PASS][7] -> [INCOMPLETE][8] ([i915#656])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl8/igt@i915_selftest@l...@execlists.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-apl6/igt@i915_selftest@l...@execlists.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl:  [PASS][9] -> [DMESG-WARN][10] ([i915#180]) +2 similar 
issues
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl2/igt@kms_cursor_...@pipe-a-cursor-suspend.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-kbl7/igt@kms_cursor_...@pipe-a-cursor-suspend.html

  * igt@kms_fbcon_fbt@fbc-suspend:
- shard-apl:  [PASS][11] -> [DMESG-WARN][12] ([i915#180] / 
[i915#95])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl1/igt@kms_fbcon_...@fbc-suspend.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-apl1/igt@kms_fbcon_...@fbc-suspend.html

  * igt@kms_hdr@bpc-switch-suspend:
- shard-skl:  [PASS][13] -> [FAIL][14] ([i915#1188])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-skl10/igt@kms_...@bpc-switch-suspend.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-skl6/igt@kms_...@bpc-switch-suspend.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- shard-apl:  [PASS][15] -> [DMESG-WARN][16] ([i915#180]) +1 
similar issue
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl1/igt@kms_pl...@plane-panning-bottom-right-suspend-pipe-b-planes.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-apl4/igt@kms_pl...@plane-panning-bottom-right-suspend-pipe-b-planes.html

  * igt@kms_plane_cursor@pipe-a-overlay-size-128:
- shard-kbl:  [PASS][17] -> [FAIL][18] ([i915#1559] / [i915#93] / 
[i915#95])
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-kbl7/igt@kms_plane_cur...@pipe-a-overlay-size-128.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-kbl3/igt@kms_plane_cur...@pipe-a-overlay-size-128.html
- shard-apl:  [PASS][19] -> [FAIL][20] ([i915#1559] / [i915#95])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-apl2/igt@kms_plane_cur...@pipe-a-overlay-size-128.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-apl8/igt@kms_plane_cur...@pipe-a-overlay-size-128.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-glk:  [PASS][21] -> [FAIL][22] ([i915#899])
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8238/shard-glk8/igt@kms_plane_low...@pipe-a-tiling-x.html
   [22]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17189/shard-glk7/igt@kms_plane_low...@pipe-a-tiling-x.html

  * igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][23] -> [SKIP][24] ([fdo#109441]) +2 similar 
issues
   [23]: 
https://intel-gfx-ci.01.org/tr

Re: [Intel-gfx] [PATCH 01/44] drivers/base: Always release devres on device_del

2020-04-03 Thread Daniel Vetter
On Fri, Apr 3, 2020 at 4:17 PM Greg Kroah-Hartman
 wrote:
>
> On Fri, Apr 03, 2020 at 03:57:45PM +0200, Daniel Vetter wrote:
> > In drm we've added nice drm_device (the main gpu driver thing, which
> > also represents the userspace interfaces and has everything else
> > dangling off it) init functions using devres, devm_drm_dev_init and
> > soon devm_drm_dev_alloc (this patch series adds that).
> >
> > A slight trouble is that drm_device itself holds a reference on the
> > struct device it's sitting on top (for sysfs links and dmesg debug and
> > lots of other things), so there's a reference loop. For real drivers
> > this is broken at remove/unplug time, where all devres resources are
> > released device_release_driver(), before the final device reference is
> > dropped. So far so good.
> >
> > There's 2 exceptions:
> > - drm/vkms|vgem: Virtual drivers for which we create a fake/virtual
> >   platform device to make them look more like normal devices to
> >   userspace. These aren't drivers in the driver model sense, we simple
> >   create a platform_device and register it.
>
> That's a horrid abuse of platform devices, just use a "virtual" device
> please, create/remove it when you need it, and all should be fine.
>
> > - drm/i915/selftests, where we create minimal mock devices, and again
> >   the selftests aren't proper drivers in the driver model sense.
>
> Again, virtual devices are best to use for this.

Hm yeah, I guess we should fix that. i915 selftests do use raw struct
device though, and it's not really the problem.

> > For these two cases the reference loop isn't broken, because devres is
> > only cleaned up when the last device reference is dropped. But that's
> > not happening, because the drm_device holds that last struct device
> > reference.
> >
> > Thus far this wasn't a problem since the above cases simply
> > hand-rolled their cleanup code. But I want to convert all drivers over
> > to the devm_ versions, hence it would be really nice if these
> > virtual/fake/mock uses-cases could also be managed with devres
> > cleanup.
> >
> > I see three possible approaches:
> >
> > - Clean up devres from device_del (or platform_device_unregister) even
> >   when no driver is bound. This seems like the simplest solution, but
> >   also the one with the widest impact, and what this patch implements.
> >   We might want to include more of the cleanup than just
> >   devres_release_all, but this is all I need to get my use case going.
>
> After device_del, you should never be using that structure again anyway.
> So why is there any "resource leak"?  You can't recycle the structure,
> and you can't assign it to anything else, so eventually you have to do
> a final put on the thing, which will free up the resources.

I guess I should have spent more time explaining this. There's two
references involved:

- drm_device->dev points at the underlying struct device. The
drm_device holds a reference until it's fully cleaned up, so that we
can do nice stuff like use dev_ versions of printk functions, and you
always know that there's not going to be a use-after free.

- now the other dependency is that as long as the device exists (not
just in memory, but in the device model, i.e. between device_add() and
device_del()) the drm_device should exist. So what we do in the
bus-specific remove/disconnect callback is that we call
drm_dev_unregister(). This drops the drm_device refcount that the drm
chardev was holding, to make sure that an open() on the chardev can
actually get at the memory without going boom. Then after the
drm_dev_unregister, again in the remove/disconnect callback of th
driver, there's a drm_dev_put(). Which might or might not be the final
drm_dev_put(), since if there's currently some open fd we keep the
refcount elevated, to avoid oopses and fun stuff like that. And
drm_device pointers get shared very widely, thanks to fun stuff like
dma_buf buffer sharing and dma_fence hw syncpt sharing across
processes and drivers.

Once the final drm_dev_put() is called we also end up calling
put_device() and everything is happy.

So far so good.

Now the problem is that refcount is hard, and most drm drivers get it
wrong in some fashion or another, so I'm trying to solve all this with
more magic.

Since all drivers need to have a drm_dev_put() at the end of their
driver's remove/disconnect callback we've added a devm_drm_dev_init
function which registers a devres action to do that drm_dev_put() at
device_del time (which might or might not be the final drm_dev_put()).
Nothing has changed thus far.

Now this works really well because when you have a real driver model
driver attached, then device_del ends up calling devres_release_all(),
which ends up triggering the multi-stage cleanup of drm_devices. But
if you do _not_ have a real driver attached, then device_del does
nothing wrt devres cleanup. Instead this is delayed until the final
put_device().

Unfortunately that final put_device() will never happen, bec

Re: [Intel-gfx] [PATCH 01/44] drivers/base: Always release devres on device_del

2020-04-03 Thread Daniel Vetter
On Fri, Apr 3, 2020 at 4:47 PM Daniel Vetter  wrote:
>
> On Fri, Apr 3, 2020 at 4:17 PM Greg Kroah-Hartman
>  wrote:
> >
> > On Fri, Apr 03, 2020 at 03:57:45PM +0200, Daniel Vetter wrote:
> > > In drm we've added nice drm_device (the main gpu driver thing, which
> > > also represents the userspace interfaces and has everything else
> > > dangling off it) init functions using devres, devm_drm_dev_init and
> > > soon devm_drm_dev_alloc (this patch series adds that).
> > >
> > > A slight trouble is that drm_device itself holds a reference on the
> > > struct device it's sitting on top (for sysfs links and dmesg debug and
> > > lots of other things), so there's a reference loop. For real drivers
> > > this is broken at remove/unplug time, where all devres resources are
> > > released device_release_driver(), before the final device reference is
> > > dropped. So far so good.
> > >
> > > There's 2 exceptions:
> > > - drm/vkms|vgem: Virtual drivers for which we create a fake/virtual
> > >   platform device to make them look more like normal devices to
> > >   userspace. These aren't drivers in the driver model sense, we simple
> > >   create a platform_device and register it.
> >
> > That's a horrid abuse of platform devices, just use a "virtual" device
> > please, create/remove it when you need it, and all should be fine.
> >
> > > - drm/i915/selftests, where we create minimal mock devices, and again
> > >   the selftests aren't proper drivers in the driver model sense.
> >
> > Again, virtual devices are best to use for this.
>
> Hm yeah, I guess we should fix that. i915 selftests do use raw struct
> device though, and it's not really the problem.
>
> > > For these two cases the reference loop isn't broken, because devres is
> > > only cleaned up when the last device reference is dropped. But that's
> > > not happening, because the drm_device holds that last struct device
> > > reference.
> > >
> > > Thus far this wasn't a problem since the above cases simply
> > > hand-rolled their cleanup code. But I want to convert all drivers over
> > > to the devm_ versions, hence it would be really nice if these
> > > virtual/fake/mock uses-cases could also be managed with devres
> > > cleanup.
> > >
> > > I see three possible approaches:
> > >
> > > - Clean up devres from device_del (or platform_device_unregister) even
> > >   when no driver is bound. This seems like the simplest solution, but
> > >   also the one with the widest impact, and what this patch implements.
> > >   We might want to include more of the cleanup than just
> > >   devres_release_all, but this is all I need to get my use case going.
> >
> > After device_del, you should never be using that structure again anyway.
> > So why is there any "resource leak"?  You can't recycle the structure,
> > and you can't assign it to anything else, so eventually you have to do
> > a final put on the thing, which will free up the resources.
>
> I guess I should have spent more time explaining this. There's two
> references involved:
>
> - drm_device->dev points at the underlying struct device. The
> drm_device holds a reference until it's fully cleaned up, so that we
> can do nice stuff like use dev_ versions of printk functions, and you
> always know that there's not going to be a use-after free.
>
> - now the other dependency is that as long as the device exists (not
> just in memory, but in the device model, i.e. between device_add() and
> device_del()) the drm_device should exist. So what we do in the
> bus-specific remove/disconnect callback is that we call
> drm_dev_unregister(). This drops the drm_device refcount that the drm
> chardev was holding, to make sure that an open() on the chardev can
> actually get at the memory without going boom. Then after the
> drm_dev_unregister, again in the remove/disconnect callback of th
> driver, there's a drm_dev_put(). Which might or might not be the final
> drm_dev_put(), since if there's currently some open fd we keep the
> refcount elevated, to avoid oopses and fun stuff like that. And
> drm_device pointers get shared very widely, thanks to fun stuff like
> dma_buf buffer sharing and dma_fence hw syncpt sharing across
> processes and drivers.
>
> Once the final drm_dev_put() is called we also end up calling
> put_device() and everything is happy.
>
> So far so good.
>
> Now the problem is that refcount is hard, and most drm drivers get it
> wrong in some fashion or another, so I'm trying to solve all this with
> more magic.
>
> Since all drivers need to have a drm_dev_put() at the end of their
> driver's remove/disconnect callback we've added a devm_drm_dev_init
> function which registers a devres action to do that drm_dev_put() at
> device_del time (which might or might not be the final drm_dev_put()).
> Nothing has changed thus far.
>
> Now this works really well because when you have a real driver model
> driver attached, then device_del ends up calling devres_release_all(),
> which ends up triggering the multi-st

Re: [Intel-gfx] [PATCH 01/44] drivers/base: Always release devres on device_del

2020-04-03 Thread Greg Kroah-Hartman
On Fri, Apr 03, 2020 at 04:51:33PM +0200, Daniel Vetter wrote:
> On Fri, Apr 3, 2020 at 4:47 PM Daniel Vetter  wrote:
> >
> > On Fri, Apr 3, 2020 at 4:17 PM Greg Kroah-Hartman
> >  wrote:
> > >
> > > On Fri, Apr 03, 2020 at 03:57:45PM +0200, Daniel Vetter wrote:
> > > > In drm we've added nice drm_device (the main gpu driver thing, which
> > > > also represents the userspace interfaces and has everything else
> > > > dangling off it) init functions using devres, devm_drm_dev_init and
> > > > soon devm_drm_dev_alloc (this patch series adds that).
> > > >
> > > > A slight trouble is that drm_device itself holds a reference on the
> > > > struct device it's sitting on top (for sysfs links and dmesg debug and
> > > > lots of other things), so there's a reference loop. For real drivers
> > > > this is broken at remove/unplug time, where all devres resources are
> > > > released device_release_driver(), before the final device reference is
> > > > dropped. So far so good.
> > > >
> > > > There's 2 exceptions:
> > > > - drm/vkms|vgem: Virtual drivers for which we create a fake/virtual
> > > >   platform device to make them look more like normal devices to
> > > >   userspace. These aren't drivers in the driver model sense, we simple
> > > >   create a platform_device and register it.
> > >
> > > That's a horrid abuse of platform devices, just use a "virtual" device
> > > please, create/remove it when you need it, and all should be fine.
> > >
> > > > - drm/i915/selftests, where we create minimal mock devices, and again
> > > >   the selftests aren't proper drivers in the driver model sense.
> > >
> > > Again, virtual devices are best to use for this.
> >
> > Hm yeah, I guess we should fix that. i915 selftests do use raw struct
> > device though, and it's not really the problem.
> >
> > > > For these two cases the reference loop isn't broken, because devres is
> > > > only cleaned up when the last device reference is dropped. But that's
> > > > not happening, because the drm_device holds that last struct device
> > > > reference.
> > > >
> > > > Thus far this wasn't a problem since the above cases simply
> > > > hand-rolled their cleanup code. But I want to convert all drivers over
> > > > to the devm_ versions, hence it would be really nice if these
> > > > virtual/fake/mock uses-cases could also be managed with devres
> > > > cleanup.
> > > >
> > > > I see three possible approaches:
> > > >
> > > > - Clean up devres from device_del (or platform_device_unregister) even
> > > >   when no driver is bound. This seems like the simplest solution, but
> > > >   also the one with the widest impact, and what this patch implements.
> > > >   We might want to include more of the cleanup than just
> > > >   devres_release_all, but this is all I need to get my use case going.
> > >
> > > After device_del, you should never be using that structure again anyway.
> > > So why is there any "resource leak"?  You can't recycle the structure,
> > > and you can't assign it to anything else, so eventually you have to do
> > > a final put on the thing, which will free up the resources.
> >
> > I guess I should have spent more time explaining this. There's two
> > references involved:
> >
> > - drm_device->dev points at the underlying struct device. The
> > drm_device holds a reference until it's fully cleaned up, so that we
> > can do nice stuff like use dev_ versions of printk functions, and you
> > always know that there's not going to be a use-after free.
> >
> > - now the other dependency is that as long as the device exists (not
> > just in memory, but in the device model, i.e. between device_add() and
> > device_del()) the drm_device should exist. So what we do in the
> > bus-specific remove/disconnect callback is that we call
> > drm_dev_unregister(). This drops the drm_device refcount that the drm
> > chardev was holding, to make sure that an open() on the chardev can
> > actually get at the memory without going boom. Then after the
> > drm_dev_unregister, again in the remove/disconnect callback of th
> > driver, there's a drm_dev_put(). Which might or might not be the final
> > drm_dev_put(), since if there's currently some open fd we keep the
> > refcount elevated, to avoid oopses and fun stuff like that. And
> > drm_device pointers get shared very widely, thanks to fun stuff like
> > dma_buf buffer sharing and dma_fence hw syncpt sharing across
> > processes and drivers.
> >
> > Once the final drm_dev_put() is called we also end up calling
> > put_device() and everything is happy.
> >
> > So far so good.
> >
> > Now the problem is that refcount is hard, and most drm drivers get it
> > wrong in some fashion or another, so I'm trying to solve all this with
> > more magic.
> >
> > Since all drivers need to have a drm_dev_put() at the end of their
> > driver's remove/disconnect callback we've added a devm_drm_dev_init
> > function which registers a devres action to do that drm_dev_put() at
> > device_del time (which might or mig

  1   2   >