[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/ehl: Allow combo PHY A to drive a third external display

2019-06-14 Thread Patchwork
== Series Details ==

Series: drm/i915/ehl: Allow combo PHY A to drive a third external display
URL   : https://patchwork.freedesktop.org/series/62131/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6277 -> Patchwork_13293


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13293/

Known issues


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

### IGT changes ###

 Issues hit 

  * igt@i915_selftest@live_evict:
- fi-bsw-kefka:   [PASS][1] -> [DMESG-WARN][2] ([fdo#107709])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-bsw-kefka/igt@i915_selftest@live_evict.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13293/fi-bsw-kefka/igt@i915_selftest@live_evict.html

  
 Possible fixes 

  * igt@gem_ctx_exec@basic:
- fi-icl-guc: [INCOMPLETE][3] ([fdo#107713]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-icl-guc/igt@gem_ctx_e...@basic.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13293/fi-icl-guc/igt@gem_ctx_e...@basic.html
- fi-icl-y:   [INCOMPLETE][5] ([fdo#107713]) -> [PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-icl-y/igt@gem_ctx_e...@basic.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13293/fi-icl-y/igt@gem_ctx_e...@basic.html

  * igt@i915_selftest@live_gtt:
- fi-glk-dsi: [INCOMPLETE][7] ([fdo#103359] / [k.org#198133]) -> 
[PASS][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-glk-dsi/igt@i915_selftest@live_gtt.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13293/fi-glk-dsi/igt@i915_selftest@live_gtt.html

  
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#107709]: https://bugs.freedesktop.org/show_bug.cgi?id=107709
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (50 -> 45)
--

  Additional (3): fi-kbl-7567u fi-skl-iommu fi-icl-u3 
  Missing(8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks 
fi-bsw-cyan fi-pnv-d510 fi-byt-clapper fi-bdw-samus 


Build changes
-

  * Linux: CI_DRM_6277 -> Patchwork_13293

  CI_DRM_6277: a0195925ba8732ffae5fed3c0b966ca331bae66c @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5057: 3b91c82b90d45c1a30569410c1142b541956740a @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_13293: 8742bede989c183b9c080134d6b27ebc7ed70f0f @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

8742bede989c drm/i915/ehl: Allow combo PHY A to drive a third external display

== Logs ==

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

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/ehl: Introduce Mule Creek Canyon PCH (rev2)

2019-06-14 Thread Patchwork
== Series Details ==

Series: drm/i915/ehl: Introduce Mule Creek Canyon PCH (rev2)
URL   : https://patchwork.freedesktop.org/series/61137/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6277 -> Patchwork_13292


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13292/

Known issues


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

### IGT changes ###

 Possible fixes 

  * igt@gem_ctx_exec@basic:
- fi-icl-guc: [INCOMPLETE][1] ([fdo#107713]) -> [PASS][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-icl-guc/igt@gem_ctx_e...@basic.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13292/fi-icl-guc/igt@gem_ctx_e...@basic.html
- fi-icl-y:   [INCOMPLETE][3] ([fdo#107713]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-icl-y/igt@gem_ctx_e...@basic.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13292/fi-icl-y/igt@gem_ctx_e...@basic.html

  * igt@i915_selftest@live_gtt:
- fi-glk-dsi: [INCOMPLETE][5] ([fdo#103359] / [k.org#198133]) -> 
[PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-glk-dsi/igt@i915_selftest@live_gtt.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13292/fi-glk-dsi/igt@i915_selftest@live_gtt.html

  
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (50 -> 46)
--

  Additional (3): fi-kbl-7567u fi-skl-iommu fi-icl-u3 
  Missing(7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks 
fi-bsw-cyan fi-byt-clapper fi-bdw-samus 


Build changes
-

  * Linux: CI_DRM_6277 -> Patchwork_13292

  CI_DRM_6277: a0195925ba8732ffae5fed3c0b966ca331bae66c @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5057: 3b91c82b90d45c1a30569410c1142b541956740a @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_13292: 1083bddbf692169fc375ae651bded13d9892932d @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

1083bddbf692 drm/i915/ehl: Introduce Mule Creek Canyon PCH

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13292/
___
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 [CI,1/3] drm/i915: Keep contexts pinned until after the next kernel context switch

2019-06-14 Thread Patchwork
== Series Details ==

Series: series starting with [CI,1/3] drm/i915: Keep contexts pinned until 
after the next kernel context switch
URL   : https://patchwork.freedesktop.org/series/62124/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6277 -> Patchwork_13290


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13290/

Known issues


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

### IGT changes ###

 Issues hit 

  * igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850:   [PASS][1] -> [INCOMPLETE][2] ([fdo#107718])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-blb-e6850/igt@gem_exec_susp...@basic-s3.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13290/fi-blb-e6850/igt@gem_exec_susp...@basic-s3.html

  
 Possible fixes 

  * igt@gem_ctx_exec@basic:
- fi-icl-guc: [INCOMPLETE][3] ([fdo#107713]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-icl-guc/igt@gem_ctx_e...@basic.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13290/fi-icl-guc/igt@gem_ctx_e...@basic.html
- fi-icl-y:   [INCOMPLETE][5] ([fdo#107713]) -> [PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-icl-y/igt@gem_ctx_e...@basic.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13290/fi-icl-y/igt@gem_ctx_e...@basic.html

  * igt@i915_selftest@live_gtt:
- fi-glk-dsi: [INCOMPLETE][7] ([fdo#103359] / [k.org#198133]) -> 
[PASS][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-glk-dsi/igt@i915_selftest@live_gtt.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13290/fi-glk-dsi/igt@i915_selftest@live_gtt.html

  
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (50 -> 46)
--

  Additional (3): fi-kbl-7567u fi-skl-iommu fi-icl-u3 
  Missing(7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks 
fi-bsw-cyan fi-byt-clapper fi-bdw-samus 


Build changes
-

  * Linux: CI_DRM_6277 -> Patchwork_13290

  CI_DRM_6277: a0195925ba8732ffae5fed3c0b966ca331bae66c @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5057: 3b91c82b90d45c1a30569410c1142b541956740a @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_13290: e912af39a65040eebc3b1842f5fcd4e728718bc8 @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

e912af39a650 drm/i915: Replace engine->timeline with a plain list
3fb65aa5d477 drm/i915: Stop retiring along engine
2c79543c29b3 drm/i915: Keep contexts pinned until after the next kernel context 
switch

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13290/
___
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/gtt: No need to zero the table for page dirs

2019-06-14 Thread Patchwork
== Series Details ==

Series: series starting with [01/10] drm/i915/gtt: No need to zero the table 
for page dirs
URL   : https://patchwork.freedesktop.org/series/62122/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6277 -> Patchwork_13289


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13289/

Known issues


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

### IGT changes ###

 Issues hit 

  * igt@kms_frontbuffer_tracking@basic:
- fi-hsw-peppy:   [PASS][1] -> [DMESG-WARN][2] ([fdo#102614])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-hsw-peppy/igt@kms_frontbuffer_track...@basic.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13289/fi-hsw-peppy/igt@kms_frontbuffer_track...@basic.html

  
 Possible fixes 

  * igt@gem_ctx_exec@basic:
- fi-icl-guc: [INCOMPLETE][3] ([fdo#107713]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-icl-guc/igt@gem_ctx_e...@basic.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13289/fi-icl-guc/igt@gem_ctx_e...@basic.html
- fi-icl-y:   [INCOMPLETE][5] ([fdo#107713]) -> [PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-icl-y/igt@gem_ctx_e...@basic.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13289/fi-icl-y/igt@gem_ctx_e...@basic.html

  * igt@i915_selftest@live_gtt:
- fi-glk-dsi: [INCOMPLETE][7] ([fdo#103359] / [k.org#198133]) -> 
[PASS][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6277/fi-glk-dsi/igt@i915_selftest@live_gtt.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13289/fi-glk-dsi/igt@i915_selftest@live_gtt.html

  
  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (50 -> 44)
--

  Additional (3): fi-kbl-7567u fi-skl-iommu fi-icl-u3 
  Missing(9): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks 
fi-bsw-cyan fi-gdg-551 fi-pnv-d510 fi-byt-clapper fi-bdw-samus 


Build changes
-

  * Linux: CI_DRM_6277 -> Patchwork_13289

  CI_DRM_6277: a0195925ba8732ffae5fed3c0b966ca331bae66c @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5057: 3b91c82b90d45c1a30569410c1142b541956740a @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_13289: f33418fc780b3aa9f3beaf73dc2586d42a045264 @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

f33418fc780b drm/i915/gtt: Setup phys pages for 3lvl pdps
a5962f1ec818 drm/i915/gtt: Tear down setup and cleanup macros for page dma
cf0c87dc8f77 drm/i915/gtt: Make swapping the pd entry generic
6bd860d004cd drm/i915/gtt: Check for physical page for pd entry always
ff23d85ebb8f drm/i915/gtt: pde entry encoding is identical
b8cb2f9e813d drm/i915/gtt: Generalize alloc_pd
464bd2d5e1a9 drm/i915/gtt: Introduce init_pd
a580ad51d6ce drm/i915/gtt: Introduce init_pd_with_page
0a2593a39056 drm/i915/gtt: Use a common type for page directories
a0c0d406ac14 drm/i915/gtt: No need to zero the table for page dirs

== Logs ==

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

Re: [Intel-gfx] [PATCH v5 3/3] drm/i915: Make PSR registers relative to transcoders

2019-06-14 Thread Dhinakaran Pandiyan

"drm/i915/psr" in the subject.

On Sat, 2019-04-20 at 13:55 -0700, José Roberto de Souza wrote:
> PSR registers are a mess, some have the full address while others just
> have the additional offset from psr_mmio_base.
> 
> For BDW+ psr_mmio_base is nothing more than TRANSCODER_EDP_OFFSET +
> 0x800 and using it makes more difficult for people with an PSR
> register address or PSR register name from from BSpec as i915 also
> don't match the BSpec names.
> For HSW psr_mmio_base is _DDI_BUF_CTL_A + 0x800 and PSR registers are
> only available in DDIA.
> 
> Other reason to make relative to transcoder is that since BDW every
> transcoder have PSR registers, so in theory it should be possible to
> have PSR enabled in a non-eDP transcoder.
> 
> So for BDW+ we can use _TRANS2() to get the register offset of any
> PSR register in any transcoder while for HSW we have _HSW_PSR_ADJ
> that will calculate the register offset for the single PSR instance,
> noting that we are already guarded about trying to enable PSR in other
> port than DDIA on HSW by the 'if (dig_port->base.port != PORT_A)' in
> intel_psr_compute_config(), this check should only be valid for HSW
> and will be changed in future.
> PSR2 registers and PSR_EVENT was added after Haswell so that is why
> _PSR_ADJ() is not used in some macros.
> 
> The only registers that can not be relative to transcoder are
> PSR_IMR and PSR_IIR that are not relative to anything, so keeping it
> hardcoded.
> 
> Also removing BDW_EDP_PSR_BASE from GVT because it is not used as it
> is the only PSR register that GVT have.
> 
> v5:
> - Macros changed to be more explicit about HSW (Dhinakaran)
> - Squashed with the patch that added the tran parameter to the
> macros (Dhinakaran)
> 
> Cc: Dhinakaran Pandiyan 
> Cc: Rodrigo Vivi 
> Cc: Jani Nikula 
> Cc: Ville Syrjälä 
> Cc: Zhi Wang 
> Signed-off-by: José Roberto de Souza 
> ---
>  drivers/gpu/drm/i915/gvt/handlers.c |  1 -
>  drivers/gpu/drm/i915/i915_debugfs.c | 18 +
>  drivers/gpu/drm/i915/i915_drv.h |  3 +-
>  drivers/gpu/drm/i915/i915_reg.h | 57 -
>  drivers/gpu/drm/i915/intel_psr.c| 55 
>  5 files changed, 83 insertions(+), 51 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/handlers.c
> b/drivers/gpu/drm/i915/gvt/handlers.c
> index 18f01eeb2510..749e3e4204f2 100644
> --- a/drivers/gpu/drm/i915/gvt/handlers.c
> +++ b/drivers/gpu/drm/i915/gvt/handlers.c
> @@ -2776,7 +2776,6 @@ static int init_broadwell_mmio_info(struct intel_gvt
> *gvt)
>   MMIO_D(CHICKEN_PIPESL_1(PIPE_C), D_BDW_PLUS);
>  
>   MMIO_D(WM_MISC, D_BDW);
> - MMIO_D(_MMIO(BDW_EDP_PSR_BASE), D_BDW);
Change this to _SRD_CTL_EDP to keep the change non-functional? Any case, we'll
need an ack to modify this.

>   MMIO_D(_MMIO(0x66c00), D_BDW_PLUS);
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c
> b/drivers/gpu/drm/i915/i915_debugfs.c
> index 5823ffb17821..2a0f5871e9a8 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2470,7 +2470,7 @@ psr_source_status(struct drm_i915_private *dev_priv,
> struct seq_file *m)
>   "BUF_ON",
>   "TG_ON"
>   };
> - val = I915_READ(EDP_PSR2_STATUS);
> + val = I915_READ(EDP_PSR2_STATUS(dev_priv->psr.transcoder));
>   status_val = (val & EDP_PSR2_STATUS_STATE_MASK) >>
> EDP_PSR2_STATUS_STATE_SHIFT;
>   if (status_val < ARRAY_SIZE(live_status))
> @@ -2486,7 +2486,7 @@ psr_source_status(struct drm_i915_private *dev_priv,
> struct seq_file *m)
>   "SRDOFFACK",
>   "SRDENT_ON",
>   };
> - val = I915_READ(EDP_PSR_STATUS);
> + val = I915_READ(EDP_PSR_STATUS(dev_priv->psr.transcoder));
>   status_val = (val & EDP_PSR_STATUS_STATE_MASK) >>
> EDP_PSR_STATUS_STATE_SHIFT;
>   if (status_val < ARRAY_SIZE(live_status))
> @@ -2529,10 +2529,10 @@ static int i915_edp_psr_status(struct seq_file *m,
> void *data)
>   goto unlock;
>  
>   if (psr->psr2_enabled) {
> - val = I915_READ(EDP_PSR2_CTL);
> + val = I915_READ(EDP_PSR2_CTL(dev_priv->psr.transcoder));
>   enabled = val & EDP_PSR2_ENABLE;
>   } else {
> - val = I915_READ(EDP_PSR_CTL);
> + val = I915_READ(EDP_PSR_CTL(dev_priv->psr.transcoder));
>   enabled = val & EDP_PSR_ENABLE;
>   }
>   seq_printf(m, "Source PSR ctl: %s [0x%08x]\n",
> @@ -2545,7 +2545,8 @@ static int i915_edp_psr_status(struct seq_file *m, void
> *data)
>* SKL+ Perf counter is reset to 0 everytime DC state is entered
>*/
>   if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
> - val = I915_READ(EDP_PSR_PERF_CNT) & EDP_PSR_PERF_CNT_MASK;
> + val = 

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/ehl: Add power wells support for Elkhart Lake

2019-06-14 Thread Patchwork
== Series Details ==

Series: drm/i915/ehl: Add power wells support for Elkhart Lake
URL   : https://patchwork.freedesktop.org/series/62156/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
49a29de69d33 drm/i915/ehl: Add power wells support for Elkhart Lake
-:239: CHECK:LINE_SPACING: Please don't use multiple blank lines
#239: FILE: drivers/gpu/drm/i915/intel_display_power.c:3562:
+
+

total: 0 errors, 0 warnings, 1 checks, 229 lines checked

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

[Intel-gfx] [PATCH] drm/i915/ehl: Add power wells support for Elkhart Lake

2019-06-14 Thread Vivek Kasireddy
The number of power wells and the relevant sequences are common between
ICL and EHL since they both are Gen 11. The only significant differences
are that EHL does not have DDI E and DDI D and type C/TBT ports.

Cc: Clint Taylor 
Cc: José Roberto de Souza 
Cc: Matt Roper 
Cc: Imre Deak 
Signed-off-by: Vivek Kasireddy 
---
 drivers/gpu/drm/i915/intel_display_power.c | 210 -
 1 file changed, 209 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display_power.c 
b/drivers/gpu/drm/i915/intel_display_power.c
index c672c8080a93..e3ed77b843d2 100644
--- a/drivers/gpu/drm/i915/intel_display_power.c
+++ b/drivers/gpu/drm/i915/intel_display_power.c
@@ -2397,6 +2397,66 @@ void intel_display_power_put(struct drm_i915_private 
*dev_priv,
 #define ICL_AUX_TBT4_IO_POWER_DOMAINS (\
BIT_ULL(POWER_DOMAIN_AUX_TBT4))
 
+#define EHL_PW_4_POWER_DOMAINS (   \
+   BIT_ULL(POWER_DOMAIN_PIPE_C) |  \
+   BIT_ULL(POWER_DOMAIN_PIPE_C_PANEL_FITTER) | \
+   BIT_ULL(POWER_DOMAIN_INIT))
+   /* VDSC/joining */
+#define EHL_PW_3_POWER_DOMAINS (   \
+   EHL_PW_4_POWER_DOMAINS |\
+   BIT_ULL(POWER_DOMAIN_PIPE_B) |  \
+   BIT_ULL(POWER_DOMAIN_TRANSCODER_A) |\
+   BIT_ULL(POWER_DOMAIN_TRANSCODER_B) |\
+   BIT_ULL(POWER_DOMAIN_TRANSCODER_C) |\
+   BIT_ULL(POWER_DOMAIN_PIPE_B_PANEL_FITTER) | \
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_B_LANES) |\
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_B_IO) |   \
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_C_LANES) |\
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_C_IO) |   \
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_D_LANES) |\
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_D_IO) |   \
+   BIT_ULL(POWER_DOMAIN_AUX_B) |   \
+   BIT_ULL(POWER_DOMAIN_AUX_C) |   \
+   BIT_ULL(POWER_DOMAIN_AUX_D) |   \
+   BIT_ULL(POWER_DOMAIN_VGA) | \
+   BIT_ULL(POWER_DOMAIN_AUDIO) |   \
+   BIT_ULL(POWER_DOMAIN_INIT))
+   /*
+* - transcoder WD
+* - KVMR (HW control)
+*/
+#define EHL_PW_2_POWER_DOMAINS (   \
+   EHL_PW_3_POWER_DOMAINS |\
+   BIT_ULL(POWER_DOMAIN_TRANSCODER_EDP_VDSC) | \
+   BIT_ULL(POWER_DOMAIN_INIT))
+   /*
+* - KVMR (HW control)
+*/
+#define EHL_DISPLAY_DC_OFF_POWER_DOMAINS ( \
+   EHL_PW_2_POWER_DOMAINS |\
+   BIT_ULL(POWER_DOMAIN_MODESET) | \
+   BIT_ULL(POWER_DOMAIN_AUX_A) |   \
+   BIT_ULL(POWER_DOMAIN_INIT))
+
+#define EHL_DDI_IO_A_POWER_DOMAINS (   \
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_A_IO))
+#define EHL_DDI_IO_B_POWER_DOMAINS (   \
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_B_IO))
+#define EHL_DDI_IO_C_POWER_DOMAINS (   \
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_C_IO))
+#define EHL_DDI_IO_D_POWER_DOMAINS (   \
+   BIT_ULL(POWER_DOMAIN_PORT_DDI_D_IO))
+
+#define EHL_AUX_A_IO_POWER_DOMAINS (   \
+   BIT_ULL(POWER_DOMAIN_AUX_IO_A) |\
+   BIT_ULL(POWER_DOMAIN_AUX_A))
+#define EHL_AUX_B_IO_POWER_DOMAINS (   \
+   BIT_ULL(POWER_DOMAIN_AUX_B))
+#define EHL_AUX_C_IO_POWER_DOMAINS (   \
+   BIT_ULL(POWER_DOMAIN_AUX_C))
+#define EHL_AUX_D_IO_POWER_DOMAINS (   \
+   BIT_ULL(POWER_DOMAIN_AUX_D))
+
 static const struct i915_power_well_ops i9xx_always_on_power_well_ops = {
.sync_hw = i9xx_power_well_sync_hw_noop,
.enable = i9xx_always_on_power_well_noop,
@@ -3354,6 +3414,152 @@ static const struct i915_power_well_desc 
icl_power_wells[] = {
},
 };
 
+static const struct i915_power_well_desc ehl_power_wells[] = {
+   {
+   .name = "always-on",
+   .always_on = true,
+   .domains = POWER_DOMAIN_MASK,
+   .ops = _always_on_power_well_ops,
+   .id = DISP_PW_ID_NONE,
+   },
+   {
+   .name = "power well 1",
+   /* Handled by the DMC firmware */
+   .always_on = true,
+   .domains = 0,
+   .ops = _power_well_ops,
+   .id = SKL_DISP_PW_1,
+   {
+   .hsw.regs = _power_well_regs,
+   .hsw.idx = ICL_PW_CTL_IDX_PW_1,
+   .hsw.has_fuses = true,
+   },
+   },
+   {
+   .name = "DC off",
+   .domains = EHL_DISPLAY_DC_OFF_POWER_DOMAINS,
+   .ops = _dc_off_power_well_ops,
+   .id = DISP_PW_ID_NONE,
+   },
+   {
+   .name = "power well 2",
+   .domains = EHL_PW_2_POWER_DOMAINS,
+ 

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/guc: Check if reset is supported before attempting to reset GuC

2019-06-14 Thread Patchwork
== Series Details ==

Series: drm/i915/guc: Check if reset is supported before attempting to reset GuC
URL   : https://patchwork.freedesktop.org/series/62105/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6272 -> Patchwork_13286


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13286/

Known issues


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

### IGT changes ###

 Possible fixes 

  * igt@gem_exec_create@basic:
- fi-icl-guc: [INCOMPLETE][1] ([fdo#107713]) -> [PASS][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-icl-guc/igt@gem_exec_cre...@basic.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13286/fi-icl-guc/igt@gem_exec_cre...@basic.html

  * igt@i915_selftest@live_evict:
- fi-bsw-kefka:   [DMESG-WARN][3] ([fdo#107709]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-bsw-kefka/igt@i915_selftest@live_evict.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13286/fi-bsw-kefka/igt@i915_selftest@live_evict.html

  * igt@i915_selftest@live_hangcheck:
- fi-icl-u2:  [INCOMPLETE][5] ([fdo#107713] / [fdo#108569]) -> 
[PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-icl-u2/igt@i915_selftest@live_hangcheck.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13286/fi-icl-u2/igt@i915_selftest@live_hangcheck.html

  * igt@kms_frontbuffer_tracking@basic:
- fi-icl-u2:  [FAIL][7] ([fdo#103167]) -> [PASS][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-icl-u2/igt@kms_frontbuffer_track...@basic.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13286/fi-icl-u2/igt@kms_frontbuffer_track...@basic.html

  
 Warnings 

  * igt@gem_ctx_create@basic-files:
- fi-icl-u3:  [DMESG-WARN][9] ([fdo#107724]) -> [INCOMPLETE][10] 
([fdo#107713] / [fdo#109100])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-icl-u3/igt@gem_ctx_cre...@basic-files.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13286/fi-icl-u3/igt@gem_ctx_cre...@basic-files.html

  
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#107709]: https://bugs.freedesktop.org/show_bug.cgi?id=107709
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100


Participating hosts (51 -> 45)
--

  Additional (2): fi-skl-lmem fi-apl-guc 
  Missing(8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-bsw-n3050 
fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus 


Build changes
-

  * Linux: CI_DRM_6272 -> Patchwork_13286

  CI_DRM_6272: 34bd5f5b56b882af2b5a5a7a0c366022a871ff60 @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5056: c7b717f0126374a02fc86de5eb5fb1f3e7b3335b @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_13286: cc42dc0d7cfc8ffd7fb31e9737be3d2cb99adb11 @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

cc42dc0d7cfc drm/i915/guc: Check if reset is supported before attempting to 
reset GuC

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13286/
___
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 [CI,1/2] drm/i915: Discard some redundant cache domain flushes

2019-06-14 Thread Patchwork
== Series Details ==

Series: series starting with [CI,1/2] drm/i915: Discard some redundant cache 
domain flushes
URL   : https://patchwork.freedesktop.org/series/62101/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6272 -> Patchwork_13285


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13285/

Known issues


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

### IGT changes ###

 Issues hit 

  * igt@gem_ctx_switch@basic-default:
- fi-icl-guc: [PASS][1] -> [INCOMPLETE][2] ([fdo#107713] / 
[fdo#108569])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-icl-guc/igt@gem_ctx_swi...@basic-default.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13285/fi-icl-guc/igt@gem_ctx_swi...@basic-default.html

  * igt@i915_module_load@reload:
- fi-blb-e6850:   [PASS][3] -> [INCOMPLETE][4] ([fdo#107718])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-blb-e6850/igt@i915_module_l...@reload.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13285/fi-blb-e6850/igt@i915_module_l...@reload.html

  * igt@i915_selftest@live_hangcheck:
- fi-icl-y:   [PASS][5] -> [DMESG-FAIL][6] ([fdo#110917])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-icl-y/igt@i915_selftest@live_hangcheck.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13285/fi-icl-y/igt@i915_selftest@live_hangcheck.html

  
 Possible fixes 

  * igt@gem_ctx_create@basic-files:
- fi-icl-u3:  [DMESG-WARN][7] ([fdo#107724]) -> [PASS][8] +1 
similar issue
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-icl-u3/igt@gem_ctx_cre...@basic-files.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13285/fi-icl-u3/igt@gem_ctx_cre...@basic-files.html

  * igt@i915_selftest@live_evict:
- fi-bsw-kefka:   [DMESG-WARN][9] ([fdo#107709]) -> [PASS][10]
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-bsw-kefka/igt@i915_selftest@live_evict.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13285/fi-bsw-kefka/igt@i915_selftest@live_evict.html

  * igt@i915_selftest@live_hangcheck:
- fi-icl-u2:  [INCOMPLETE][11] ([fdo#107713] / [fdo#108569]) -> 
[PASS][12]
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6272/fi-icl-u2/igt@i915_selftest@live_hangcheck.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13285/fi-icl-u2/igt@i915_selftest@live_hangcheck.html

  
  [fdo#107709]: https://bugs.freedesktop.org/show_bug.cgi?id=107709
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#110917]: https://bugs.freedesktop.org/show_bug.cgi?id=110917


Participating hosts (51 -> 45)
--

  Additional (2): fi-skl-lmem fi-apl-guc 
  Missing(8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks 
fi-bsw-cyan fi-pnv-d510 fi-byt-clapper fi-bdw-samus 


Build changes
-

  * Linux: CI_DRM_6272 -> Patchwork_13285

  CI_DRM_6272: 34bd5f5b56b882af2b5a5a7a0c366022a871ff60 @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5056: c7b717f0126374a02fc86de5eb5fb1f3e7b3335b @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_13285: f1a9e48333d79693da252284629bc42eaf08cdd2 @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

f1a9e48333d7 drm/i915: Execute signal callbacks from no-op i915_request_wait
203fd3e1a4fe drm/i915: Discard some redundant cache domain flushes

== Logs ==

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

Re: [Intel-gfx] [PATCH 1/5] drm/panel: Add helper for reading DT rotation

2019-06-14 Thread dbasehore .
On Fri, Jun 14, 2019 at 5:43 PM dbasehore .  wrote:
>
> On Wed, Jun 12, 2019 at 2:18 PM Sam Ravnborg  wrote:
> >
> > Hi Derek.
> >
> > On Mon, Jun 10, 2019 at 09:03:46PM -0700, Derek Basehore wrote:
> > > This adds a helper function for reading the rotation (panel
> > > orientation) from the device tree.
> > >
> > > Signed-off-by: Derek Basehore 
> > > ---
> > >  drivers/gpu/drm/drm_panel.c | 41 +
> > >  include/drm/drm_panel.h |  7 +++
> > >  2 files changed, 48 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> > > index dbd5b873e8f2..3b689ce4a51a 100644
> > > --- a/drivers/gpu/drm/drm_panel.c
> > > +++ b/drivers/gpu/drm/drm_panel.c
> > > @@ -172,6 +172,47 @@ struct drm_panel *of_drm_find_panel(const struct 
> > > device_node *np)
> > >   return ERR_PTR(-EPROBE_DEFER);
> > >  }
> > >  EXPORT_SYMBOL(of_drm_find_panel);
> > > +
> > > +/**
> > > + * of_drm_get_panel_orientation - look up the rotation of the panel 
> > > using a
> > > + * device tree node
> > > + * @np: device tree node of the panel
> > > + * @orientation: orientation enum to be filled in
> > The comment says "enum" but the type used is an int.
> > Why not use enum drm_panel_orientation?
> >
>
> The binding is just an int value, but I can change it to the enum.

Oops, I see what happened here. The way I wrote it should actually use the enum

>
> > > + *
> > > + * Looks up the rotation of a panel in the device tree. The rotation in 
> > > the
> > > + * device tree is counter clockwise.
> > > + *
> > > + * Return: 0 when a valid rotation value (0, 90, 180, or 270) is read or 
> > > the
> > > + * rotation property doesn't exist. -EERROR otherwise.
> > > + */
> > Initially I read -EEROOR as a specific error code.
> > But I gues the semantic is to say that a negative error code is returned
> > if something was wrong.
> > As we do not use the "-EERROR" syntax anywhere else in drm, please
> > reword like we do in other places.
> >
> >
> > Also - it is worth to mention that the rotation returned is
> > DRM_MODE_PANEL_ORIENTATION_UNKNOWN if the property is not specified.
> > I wonder if this is correct, as no property could also been
> > interpretated as DRM_MODE_PANEL_ORIENTATION_NORMAL.
> > And in most cases the roation property is optional, so one could
> > assume that no property equals 0 degree.
> >
> >
> > Sam
> >
> > > +int of_drm_get_panel_orientation(const struct device_node *np, int 
> > > *orientation)
> > > +{
> > > + int rotation, ret;
> > > +
> > > + ret = of_property_read_u32(np, "rotation", );
> > > + if (ret == -EINVAL) {
> > > + /* Don't return an error if there's no rotation property. */
> > > + *orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
> > > + return 0;
> > > + }
> > > +
> > > + if (ret < 0)
> > > + return ret;
> > > +
> > > + if (rotation == 0)
> > > + *orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL;
> > > + else if (rotation == 90)
> > > + *orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP;
> > > + else if (rotation == 180)
> > > + *orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
> > > + else if (rotation == 270)
> > > + *orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP;
> > > + else
> > > + return -EINVAL;
> > > +
> > > + return 0;
> > > +}
> > > +EXPORT_SYMBOL(of_drm_get_panel_orientation);
> > >  #endif
> > >
> > >  MODULE_AUTHOR("Thierry Reding ");
> > > diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
> > > index 8c738c0e6e9f..13631b2efbaa 100644
> > > --- a/include/drm/drm_panel.h
> > > +++ b/include/drm/drm_panel.h
> > > @@ -197,11 +197,18 @@ int drm_panel_detach(struct drm_panel *panel);
> > >
> > >  #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
> > >  struct drm_panel *of_drm_find_panel(const struct device_node *np);
> > > +int of_drm_get_panel_orientation(const struct device_node *np,
> > > +  int *orientation);
> > >  #else
> > >  static inline struct drm_panel *of_drm_find_panel(const struct 
> > > device_node *np)
> > >  {
> > >   return ERR_PTR(-ENODEV);
> > >  }
> > > +int of_drm_get_panel_orientation(const struct device_node *np,
> > > +  int *orientation)
> > > +{
> > > + return -ENODEV;
> > > +}
> > >  #endif
> > >
> > >  #endif
> > > --
> > > 2.22.0.rc2.383.gf4fbbf30c2-goog
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH 1/5] drm/panel: Add helper for reading DT rotation

2019-06-14 Thread dbasehore .
On Wed, Jun 12, 2019 at 2:18 PM Sam Ravnborg  wrote:
>
> Hi Derek.
>
> On Mon, Jun 10, 2019 at 09:03:46PM -0700, Derek Basehore wrote:
> > This adds a helper function for reading the rotation (panel
> > orientation) from the device tree.
> >
> > Signed-off-by: Derek Basehore 
> > ---
> >  drivers/gpu/drm/drm_panel.c | 41 +
> >  include/drm/drm_panel.h |  7 +++
> >  2 files changed, 48 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> > index dbd5b873e8f2..3b689ce4a51a 100644
> > --- a/drivers/gpu/drm/drm_panel.c
> > +++ b/drivers/gpu/drm/drm_panel.c
> > @@ -172,6 +172,47 @@ struct drm_panel *of_drm_find_panel(const struct 
> > device_node *np)
> >   return ERR_PTR(-EPROBE_DEFER);
> >  }
> >  EXPORT_SYMBOL(of_drm_find_panel);
> > +
> > +/**
> > + * of_drm_get_panel_orientation - look up the rotation of the panel using a
> > + * device tree node
> > + * @np: device tree node of the panel
> > + * @orientation: orientation enum to be filled in
> The comment says "enum" but the type used is an int.
> Why not use enum drm_panel_orientation?
>

The binding is just an int value, but I can change it to the enum.

> > + *
> > + * Looks up the rotation of a panel in the device tree. The rotation in the
> > + * device tree is counter clockwise.
> > + *
> > + * Return: 0 when a valid rotation value (0, 90, 180, or 270) is read or 
> > the
> > + * rotation property doesn't exist. -EERROR otherwise.
> > + */
> Initially I read -EEROOR as a specific error code.
> But I gues the semantic is to say that a negative error code is returned
> if something was wrong.
> As we do not use the "-EERROR" syntax anywhere else in drm, please
> reword like we do in other places.
>
>
> Also - it is worth to mention that the rotation returned is
> DRM_MODE_PANEL_ORIENTATION_UNKNOWN if the property is not specified.
> I wonder if this is correct, as no property could also been
> interpretated as DRM_MODE_PANEL_ORIENTATION_NORMAL.
> And in most cases the roation property is optional, so one could
> assume that no property equals 0 degree.
>
>
> Sam
>
> > +int of_drm_get_panel_orientation(const struct device_node *np, int 
> > *orientation)
> > +{
> > + int rotation, ret;
> > +
> > + ret = of_property_read_u32(np, "rotation", );
> > + if (ret == -EINVAL) {
> > + /* Don't return an error if there's no rotation property. */
> > + *orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
> > + return 0;
> > + }
> > +
> > + if (ret < 0)
> > + return ret;
> > +
> > + if (rotation == 0)
> > + *orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL;
> > + else if (rotation == 90)
> > + *orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP;
> > + else if (rotation == 180)
> > + *orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
> > + else if (rotation == 270)
> > + *orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP;
> > + else
> > + return -EINVAL;
> > +
> > + return 0;
> > +}
> > +EXPORT_SYMBOL(of_drm_get_panel_orientation);
> >  #endif
> >
> >  MODULE_AUTHOR("Thierry Reding ");
> > diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
> > index 8c738c0e6e9f..13631b2efbaa 100644
> > --- a/include/drm/drm_panel.h
> > +++ b/include/drm/drm_panel.h
> > @@ -197,11 +197,18 @@ int drm_panel_detach(struct drm_panel *panel);
> >
> >  #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
> >  struct drm_panel *of_drm_find_panel(const struct device_node *np);
> > +int of_drm_get_panel_orientation(const struct device_node *np,
> > +  int *orientation);
> >  #else
> >  static inline struct drm_panel *of_drm_find_panel(const struct device_node 
> > *np)
> >  {
> >   return ERR_PTR(-ENODEV);
> >  }
> > +int of_drm_get_panel_orientation(const struct device_node *np,
> > +  int *orientation)
> > +{
> > + return -ENODEV;
> > +}
> >  #endif
> >
> >  #endif
> > --
> > 2.22.0.rc2.383.gf4fbbf30c2-goog
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Intel-gfx] [CI] drm/i915/ehl: Introduce Mule Creek Canyon PCH

2019-06-14 Thread Matt Roper
Although EHL introduces a new PCH, the South Display part of the PCH
that we care about is nearly identical to ICP, just with some pins
remapped.  Most notably, Port C is mapped to the pins that ICP uses for
TC Port 1.

Signed-off-by: Matt Roper 
Reviewed-by: José Roberto de Souza 
---
A CI re-run before pushing was suggested since it's been a couple weeks
since this patch was originally written.

 drivers/gpu/drm/i915/i915_drv.c   |  8 +++-
 drivers/gpu/drm/i915/i915_drv.h   |  3 +++
 drivers/gpu/drm/i915/i915_irq.c   | 19 ++-
 drivers/gpu/drm/i915/intel_bios.c | 11 ++-
 drivers/gpu/drm/i915/intel_gmbus.c| 14 --
 drivers/gpu/drm/i915/intel_hdmi.c | 26 +-
 drivers/gpu/drm/i915/intel_vbt_defs.h |  3 +++
 7 files changed, 74 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 65d599065709..d041e5c1b46c 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -217,6 +217,10 @@ intel_pch_type(const struct drm_i915_private *dev_priv, 
unsigned short id)
DRM_DEBUG_KMS("Found Ice Lake PCH\n");
WARN_ON(!IS_ICELAKE(dev_priv));
return PCH_ICP;
+   case INTEL_PCH_MCC_DEVICE_ID_TYPE:
+   DRM_DEBUG_KMS("Found Mule Creek Canyon PCH\n");
+   WARN_ON(!IS_ELKHARTLAKE(dev_priv));
+   return PCH_MCC;
default:
return PCH_NONE;
}
@@ -244,7 +248,9 @@ intel_virt_detect_pch(const struct drm_i915_private 
*dev_priv)
 * make an educated guess as to which PCH is really there.
 */
 
-   if (IS_ICELAKE(dev_priv))
+   if (IS_ELKHARTLAKE(dev_priv))
+   id = INTEL_PCH_MCC_DEVICE_ID_TYPE;
+   else if (IS_ICELAKE(dev_priv))
id = INTEL_PCH_ICP_DEVICE_ID_TYPE;
else if (IS_CANNONLAKE(dev_priv) || IS_COFFEELAKE(dev_priv))
id = INTEL_PCH_CNP_DEVICE_ID_TYPE;
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9dce1c71bb9d..529cbd0938ac 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -533,6 +533,7 @@ enum intel_pch {
PCH_SPT,/* Sunrisepoint/Kaby Lake PCH */
PCH_CNP,/* Cannon/Comet Lake PCH */
PCH_ICP,/* Ice Lake PCH */
+   PCH_MCC,/* Mule Creek Canyon PCH */
 };
 
 #define QUIRK_LVDS_SSC_DISABLE (1<<1)
@@ -2355,12 +2356,14 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
 #define INTEL_PCH_CNP_LP_DEVICE_ID_TYPE0x9D80
 #define INTEL_PCH_CMP_DEVICE_ID_TYPE   0x0280
 #define INTEL_PCH_ICP_DEVICE_ID_TYPE   0x3480
+#define INTEL_PCH_MCC_DEVICE_ID_TYPE   0x4B00
 #define INTEL_PCH_P2X_DEVICE_ID_TYPE   0x7100
 #define INTEL_PCH_P3X_DEVICE_ID_TYPE   0x7000
 #define INTEL_PCH_QEMU_DEVICE_ID_TYPE  0x2900 /* qemu q35 has 2918 */
 
 #define INTEL_PCH_TYPE(dev_priv) ((dev_priv)->pch_type)
 #define INTEL_PCH_ID(dev_priv) ((dev_priv)->pch_id)
+#define HAS_PCH_MCC(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_MCC)
 #define HAS_PCH_ICP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_ICP)
 #define HAS_PCH_CNP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_CNP)
 #define HAS_PCH_SPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_SPT)
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 6faa6d6c60b8..d8c0c997fd62 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -141,6 +141,12 @@ static const u32 hpd_icp[HPD_NUM_PINS] = {
[HPD_PORT_F] = SDE_TC4_HOTPLUG_ICP
 };
 
+static const u32 hpd_mcc[HPD_NUM_PINS] = {
+   [HPD_PORT_A] = SDE_DDIA_HOTPLUG_ICP,
+   [HPD_PORT_B] = SDE_DDIB_HOTPLUG_ICP,
+   [HPD_PORT_C] = SDE_TC1_HOTPLUG_ICP
+};
+
 static void gen3_irq_reset(struct intel_uncore *uncore, i915_reg_t imr,
   i915_reg_t iir, i915_reg_t ier)
 {
@@ -2497,7 +2503,8 @@ static void cpt_irq_handler(struct drm_i915_private 
*dev_priv, u32 pch_iir)
cpt_serr_int_handler(dev_priv);
 }
 
-static void icp_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir)
+static void icp_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir,
+   const u32 *pins)
 {
u32 ddi_hotplug_trigger = pch_iir & SDE_DDI_MASK_ICP;
u32 tc_hotplug_trigger = pch_iir & SDE_TC_MASK_ICP;
@@ -2511,7 +2518,7 @@ static void icp_irq_handler(struct drm_i915_private 
*dev_priv, u32 pch_iir)
 
intel_get_hpd_pins(dev_priv, _mask, _mask,
   ddi_hotplug_trigger,
-  dig_hotplug_reg, hpd_icp,
+  dig_hotplug_reg, pins,
   icp_ddi_port_hotplug_long_detect);
}
 
@@ -2523,7 +2530,7 @@ static void icp_irq_handler(struct drm_i915_private 
*dev_priv, 

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Check visibility in icl_build_plane_wm

2019-06-14 Thread Patchwork
== Series Details ==

Series: drm/i915: Check visibility in icl_build_plane_wm
URL   : https://patchwork.freedesktop.org/series/62098/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6271 -> Patchwork_13284


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13284/

Known issues


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

### IGT changes ###

 Issues hit 

  * igt@gem_ctx_switch@basic-default:
- fi-icl-guc: [PASS][1] -> [INCOMPLETE][2] ([fdo#107713] / 
[fdo#108569])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6271/fi-icl-guc/igt@gem_ctx_swi...@basic-default.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13284/fi-icl-guc/igt@gem_ctx_swi...@basic-default.html

  * igt@i915_selftest@live_contexts:
- fi-bdw-gvtdvm:  [PASS][3] -> [DMESG-FAIL][4] ([fdo#110235])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6271/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13284/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html

  
 Possible fixes 

  * igt@gem_exec_fence@basic-wait-default:
- fi-icl-u3:  [DMESG-WARN][5] ([fdo#107724]) -> [PASS][6] +1 
similar issue
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6271/fi-icl-u3/igt@gem_exec_fe...@basic-wait-default.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13284/fi-icl-u3/igt@gem_exec_fe...@basic-wait-default.html

  * igt@i915_module_load@reload:
- fi-blb-e6850:   [INCOMPLETE][7] ([fdo#107718]) -> [PASS][8]
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6271/fi-blb-e6850/igt@i915_module_l...@reload.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13284/fi-blb-e6850/igt@i915_module_l...@reload.html

  * igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u:   [FAIL][9] ([fdo#109485]) -> [PASS][10]
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6271/fi-kbl-7500u/igt@kms_chamel...@hdmi-hpd-fast.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13284/fi-kbl-7500u/igt@kms_chamel...@hdmi-hpd-fast.html

  
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
  [fdo#110235]: https://bugs.freedesktop.org/show_bug.cgi?id=110235


Participating hosts (53 -> 44)
--

  Additional (1): fi-cml-u2 
  Missing(10): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks 
fi-bsw-cyan fi-kbl-guc fi-ctg-p8600 fi-bdw-samus fi-byt-clapper fi-skl-6600u 


Build changes
-

  * Linux: CI_DRM_6271 -> Patchwork_13284

  CI_DRM_6271: 7564ad5c5922b117e250665a5caf7c4a530dcf5f @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5056: c7b717f0126374a02fc86de5eb5fb1f3e7b3335b @ 
git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_13284: 534240f724bc01b7e1e9252ca335510a757ba94c @ 
git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

534240f724bc drm/i915: Check visibility in icl_build_plane_wm

== Logs ==

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

Re: [Intel-gfx] [PATCH 01/59] drm/todo: Improve drm_gem_object funcs todo

2019-06-14 Thread Eric Anholt
Daniel Vetter  writes:

> We're kinda going in the wrong direction. Spotted while typing better
> gem/prime docs.
>
> Cc: Thomas Zimmermann 
> Cc: Gerd Hoffmann 
> Cc: Rob Herring 
> Cc: Noralf Trønnes 
> Signed-off-by: Daniel Vetter 

That's a big series, but a great cleanup.  I took a look at a lot of it.
Patch 1-2, 4-10, 41-47, 49-50, and all the gem_prime_import/export drop
patches are:

Reviewed-by: Eric Anholt 

I don't currently have a plan for reading the shuffle in patch 3.


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] [PATCH] drm/i915/ehl: Add missing VECS engine

2019-06-14 Thread Matt Roper
On Fri, Jun 14, 2019 at 02:37:49PM -0700, José Roberto de Souza wrote:
> EHL can have up to one VECS(video enhancement) engine, so add it to
> the device_info.

Bspec 29150 has a footnote on VEbox that indicates "Pass-through only,
no VEbox processing logic."  That note seems a bit vague, but I think I
saw some more detailed info in the past somewhere that indicated the
VECS command streamer is still technically present but doesn't actually
do any video enhancement on EHL; it just passes content through to SFC.

I'm not terribly plugged into the media side of the world, so I'm not
sure if we want to expose VECS to userspace if it's basically a noop and
doesn't do what it normally does on other platforms.  Bspec page 5229
implies that SFC can be fed directly by the decode engine without going
through VEBOX, so I'm not sure if media userspace would ever have a use
for the passthrough-only VECS streamer.

We should probably ask someone on the media team what their thoughts are
on this.


Matt

> 
> BSpec: 29152
> Cc: Rodrigo Vivi 
> Cc: Bob Paauwe 
> Cc: Matt Roper 
> Cc: Clint Taylor 
> Signed-off-by: José Roberto de Souza 
> ---
>  drivers/gpu/drm/i915/i915_pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 482f1d0f1770..2c5f64ccadb5 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -760,7 +760,7 @@ static const struct intel_device_info 
> intel_elkhartlake_info = {
>   GEN11_FEATURES,
>   PLATFORM(INTEL_ELKHARTLAKE),
>   .require_force_probe = 1,
> - .engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VCS0),
> + .engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VCS0) | BIT(VECS0),
>   .ppgtt_size = 36,
>  };
>  
> -- 
> 2.22.0
> 

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [RESEND PATCH v2 1/2] drm/dp/mst: Reprobe EDID for MST ports on resume

2019-06-14 Thread Lyude Paul
uh, Sasha not sure if you're a bot or not but this patch isn't even upstream

On Fri, 2019-06-14 at 21:56 +, Sasha Levin wrote:
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
> 
> The bot has tested the following trees: v5.1.9, v4.19.50, v4.14.125,
> v4.9.181, v4.4.181.
> 
> v5.1.9: Build failed! Errors:
> drivers/gpu/drm/drm_dp_mst_topology.c:2672:9: error: implicit
> declaration of function ‘drm_dp_get_validated_port_ref’; did you mean
> ‘drm_mode_validate_driver’? [-Werror=implicit-function-declaration]
> drivers/gpu/drm/drm_dp_mst_topology.c:2676:9: error: implicit
> declaration of function ‘drm_dp_get_validated_mstb_ref’; did you mean
> ‘drm_mode_validate_size’? [-Werror=implicit-function-declaration]
> drivers/gpu/drm/drm_dp_mst_topology.c:2684:3: error: implicit
> declaration of function ‘drm_dp_put_mst_branch_device’; did you mean
> ‘drm_dp_get_mst_branch_device’? [-Werror=implicit-function-declaration]
> drivers/gpu/drm/drm_dp_mst_topology.c:2715:2: error: implicit
> declaration of function ‘drm_dp_put_port’; did you mean ‘drm_dp_get_port’?
> [-Werror=implicit-function-declaration]
> 
> v4.19.50: Build OK!
> v4.14.125: Build OK!
> v4.9.181: Build OK!
> v4.4.181: Build OK!
> 
> How should we proceed with this patch?
> 
> --
> Thanks,
> Sasha
-- 
Cheers,
Lyude Paul

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

[Intel-gfx] [CI] drm/i915: Avoid tainting i915_gem_park() with wakeref.lock

2019-06-14 Thread Chris Wilson
While we need to flush the wakeref before parking, we do not need to
perform the i915_gem_park() itself underneath the wakeref lock, merely
the struct_mutex. If we rearrange the locks, we can avoid the unnecessary
tainting.

Signed-off-by: Chris Wilson 
Reviewed-by: Mika Kuoppala 
---
 drivers/gpu/drm/i915/gem/i915_gem_pm.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pm.c 
b/drivers/gpu/drm/i915/gem/i915_gem_pm.c
index 141f3ea349a4..05011d4a3b88 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_pm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_pm.c
@@ -48,23 +48,22 @@ static void idle_work_handler(struct work_struct *work)
 {
struct drm_i915_private *i915 =
container_of(work, typeof(*i915), gem.idle_work);
-   bool restart = true;
+   bool park;
 
-   cancel_delayed_work(>gem.retire_work);
+   cancel_delayed_work_sync(>gem.retire_work);
mutex_lock(>drm.struct_mutex);
 
intel_wakeref_lock(>gt.wakeref);
-   if (!intel_wakeref_active(>gt.wakeref) && !work_pending(work)) {
-   i915_gem_park(i915);
-   restart = false;
-   }
+   park = !intel_wakeref_active(>gt.wakeref) && !work_pending(work);
intel_wakeref_unlock(>gt.wakeref);
-
-   mutex_unlock(>drm.struct_mutex);
-   if (restart)
+   if (park)
+   i915_gem_park(i915);
+   else
queue_delayed_work(i915->wq,
   >gem.retire_work,
   round_jiffies_up_relative(HZ));
+
+   mutex_unlock(>drm.struct_mutex);
 }
 
 static void retire_work_handler(struct work_struct *work)
-- 
2.20.1

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

Re: [Intel-gfx] [RESEND PATCH v2 1/2] drm/dp/mst: Reprobe EDID for MST ports on resume

2019-06-14 Thread Sasha Levin
Hi,

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.1.9, v4.19.50, v4.14.125, v4.9.181, 
v4.4.181.

v5.1.9: Build failed! Errors:
drivers/gpu/drm/drm_dp_mst_topology.c:2672:9: error: implicit declaration 
of function ‘drm_dp_get_validated_port_ref’; did you mean 
‘drm_mode_validate_driver’? [-Werror=implicit-function-declaration]
drivers/gpu/drm/drm_dp_mst_topology.c:2676:9: error: implicit declaration 
of function ‘drm_dp_get_validated_mstb_ref’; did you mean 
‘drm_mode_validate_size’? [-Werror=implicit-function-declaration]
drivers/gpu/drm/drm_dp_mst_topology.c:2684:3: error: implicit declaration 
of function ‘drm_dp_put_mst_branch_device’; did you mean 
‘drm_dp_get_mst_branch_device’? [-Werror=implicit-function-declaration]
drivers/gpu/drm/drm_dp_mst_topology.c:2715:2: error: implicit declaration 
of function ‘drm_dp_put_port’; did you mean ‘drm_dp_get_port’? 
[-Werror=implicit-function-declaration]

v4.19.50: Build OK!
v4.14.125: Build OK!
v4.9.181: Build OK!
v4.4.181: Build OK!

How should we proceed with this patch?

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

Re: [Intel-gfx] [PATCH 56/59] drm/todo: Update backlight todo

2019-06-14 Thread Sam Ravnborg
On Fri, Jun 14, 2019 at 10:36:12PM +0200, Daniel Vetter wrote:
> Basic helpers have been extracted, now there's a pile more todo still
> across the entire tree.
> 
> Signed-off-by: Daniel Vetter 
Acked-by: Sam Ravnborg 

Thanks for taking care of this.

I have considered enhancing drm_panel so if properly configured
then backligt enable/disable are done by the core.
Will land some patches one day, lets take any discussion based on
that.

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

Re: [Intel-gfx] [PATCH 12/59] drm/atmel: Drop drm_gem_prime_export/import

2019-06-14 Thread Sam Ravnborg
On Fri, Jun 14, 2019 at 10:35:28PM +0200, Daniel Vetter wrote:
> They're the default.
> 
> Aside: Would be really nice to switch the others over to
> drm_gem_object_funcs.
> 
> Signed-off-by: Daniel Vetter 
> Cc: Boris Brezillon 
> Cc: Nicolas Ferre 
> Cc: Alexandre Belloni 
> Cc: Ludovic Desroches 
> Cc: linux-arm-ker...@lists.infradead.org
Reviewed-by: Sam Ravnborg 

And noted "drm_gem_object_funcs" in my personal TODO

> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c 
> b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index 274fdf18cde8..2b794a50e7ab 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -843,8 +843,6 @@ static struct drm_driver atmel_hlcdc_dc_driver = {
>   .gem_vm_ops = _gem_cma_vm_ops,
>   .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
>   .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
> - .gem_prime_import = drm_gem_prime_import,
> - .gem_prime_export = drm_gem_prime_export,
>   .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
>   .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
>   .gem_prime_vmap = drm_gem_cma_prime_vmap,
> -- 
> 2.20.1
> 
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Intel-gfx] [PATCH] drm/i915/ehl: Add missing VECS engine

2019-06-14 Thread José Roberto de Souza
EHL can have up to one VECS(video enhancement) engine, so add it to
the device_info.

BSpec: 29152
Cc: Rodrigo Vivi 
Cc: Bob Paauwe 
Cc: Matt Roper 
Cc: Clint Taylor 
Signed-off-by: José Roberto de Souza 
---
 drivers/gpu/drm/i915/i915_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 482f1d0f1770..2c5f64ccadb5 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -760,7 +760,7 @@ static const struct intel_device_info 
intel_elkhartlake_info = {
GEN11_FEATURES,
PLATFORM(INTEL_ELKHARTLAKE),
.require_force_probe = 1,
-   .engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VCS0),
+   .engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VCS0) | BIT(VECS0),
.ppgtt_size = 36,
 };
 
-- 
2.22.0

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

Re: [Intel-gfx] [PATCH 9/9] drm/i915/dmc: protect against loading wrong firmware

2019-06-14 Thread Lucas De Marchi

On Fri, Jun 14, 2019 at 12:44:50PM -0700, Anusha Srivatsa wrote:




-Original Message-
From: De Marchi, Lucas
Sent: Friday, June 7, 2019 2:13 AM
To: intel-gfx@lists.freedesktop.org
Cc: Vivi, Rodrigo ; Srivatsa, Anusha
; De Marchi, Lucas 
Subject: [PATCH 9/9] drm/i915/dmc: protect against loading wrong firmware

In intel_package_header version 2 there's a new field in the fw_info table that
must be 0, otherwise it's not the correct DMC firmware. Add a check for version 
2
or later.

Signed-off-by: Lucas De Marchi 
---
drivers/gpu/drm/i915/intel_csr.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index 7608e4e2950d..864531aae1a5 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -120,7 +120,10 @@ struct intel_css_header {  } __packed;

struct intel_fw_info {
-   u16 reserved1;
+   u8 reserved1;
+
+   /* reserved on package_header version 1, must be 0 on version 2 */
+   u8 dmc_id;

/* Stepping (A, B, C, ..., *). * is a wildcard */
char stepping;
@@ -325,12 +328,16 @@ void intel_csr_load_program(struct drm_i915_private
*dev_priv)
 */
static u32 find_dmc_fw_offset(const struct intel_fw_info *fw_info,
  unsigned int num_entries,
- const struct stepping_info *si)
+ const struct stepping_info *si,
+ u8 package_ver)
{
u32 dmc_offset = CSR_DEFAULT_FW_OFFSET;
unsigned int i;

for (i = 0; i < num_entries; i++) {
+   if (package_ver > 1 && fw_info[i].dmc_id != 0)
+   continue;


Wont we need a message here? "Wrong DMC version, not loading v_x.0x" or 
something?.."


I don't think so. It's normal to have other blobs inside the firmware
that we don't care about. At most I could put a debug, but I don't think
we really care.

As long as we find one we should be fine. And if we don't, then we will
complain loudly later in this function with a DRM_ERROR().
dmc_offset remaining as CSR_DEFAULT_FW_OFFSET has a double meaning here:
either we didn't find any entry or we found one that had the offset set
to this value.

Lucas De Marchi



Anusha

if (fw_info[i].substepping == '*' &&
si->stepping == fw_info[i].stepping) {
dmc_offset = fw_info[i].offset;
@@ -508,7 +515,8 @@ parse_csr_fw_package(struct intel_csr *csr,

fw_info = (const struct intel_fw_info *)
((u8 *)package_header + sizeof(*package_header));
-   dmc_offset = find_dmc_fw_offset(fw_info, num_entries, si);
+   dmc_offset = find_dmc_fw_offset(fw_info, num_entries, si,
+   package_header->header_ver);
if (dmc_offset == CSR_DEFAULT_FW_OFFSET) {
DRM_ERROR("DMC firmware not supported for %c stepping\n",
  si->stepping);
--
2.21.0



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

Re: [Intel-gfx] [PATCH 06/59] drm/prime: Actually remove DRIVER_PRIME everywhere

2019-06-14 Thread Sam Ravnborg
Hi Daniel.

Minor nitpick..

> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 65d599065709..4fd09a9ad67a 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -3193,7 +3193,7 @@ static struct drm_driver driver = {
>* deal with them for Intel hardware.
>*/
>   .driver_features =
> - DRIVER_GEM | DRIVER_PRIME |
> + DRIVER_GEM | 
>   DRIVER_RENDER | DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_SYNCOBJ,
Adds a whitespace.

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

Re: [Intel-gfx] [PATCH 16/59] drm/hisilicon: Drop drm_gem_prime_export/import

2019-06-14 Thread Sam Ravnborg
On Fri, Jun 14, 2019 at 10:35:32PM +0200, Daniel Vetter wrote:
> They're the default.
> 
> Aside: Would be really nice to switch the others over to
> drm_gem_object_funcs.
> 
> Signed-off-by: Daniel Vetter 
> Cc: Sam Ravnborg 
> Cc: Daniel Vetter 
> Cc: Xinliang Liu 
> Cc: "Noralf Trønnes" 
> Cc: CK Hu 
> Cc: Thomas Zimmermann 

Trivial - you can add my:
Reviewed-by: Sam Ravnborg 

> ---
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c 
> b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index 73f2b53f32cc..6e95d3b167cc 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -126,8 +126,6 @@ static struct drm_driver kirin_drm_driver = {
>  
>   .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
>   .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
> - .gem_prime_export   = drm_gem_prime_export,
> - .gem_prime_import   = drm_gem_prime_import,
>   .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
>   .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
>   .gem_prime_vmap = drm_gem_cma_prime_vmap,
> -- 
> 2.20.1
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [v7 00/16] Add Plane Color Properties

2019-06-14 Thread Ezequiel Garcia
(+ Boris, + Sean)

On Fri, 2019-06-14 at 13:17 -0300, Ezequiel Garcia wrote:
> On Thu, 28 Mar 2019 at 16:50, Uma Shankar  wrote:
> > This is how a typical display color hardware pipeline looks like:
> >  +---+
> >  |RAM|
> >  |  +--++-++-+   |
> >  |  | FB 1 ||  FB 2   || FB N|   |
> >  |  +--++-++-+   |
> >  +---+
> >|  Plane Color Hardware Block |
> >  ++
> >  | +---v-+   +---v---+   +---v--+ |
> >  | | Plane A |   | Plane B   |   | Plane N  | |
> >  | | DeGamma |   | Degamma   |   | Degamma  | |
> >  | +---+-+   +---+---+   +---+--+ |
> >  | | |   ||
> >  | +---v-+   +---v---+   +---v--+ |
> >  | |Plane A  |   | Plane B   |   | Plane N  | |
> >  | |CSC/CTM  |   | CSC/CTM   |   | CSC/CTM  | |
> >  | +---+-+   ++--+   ++-+ |
> >  | |  |   |   |
> >  | +---v-+   +v--+   +v-+ |
> >  | | Plane A |   | Plane B   |   | Plane N  | |
> >  | | Gamma   |   | Gamma |   | Gamma| |
> >  | +---+-+   ++--+   ++-+ |
> >  | |  |   |   |
> >  ++
> > +--v--v---v---|
> > > >   ||
> > > >   Pipe Blender||
> > +++
> > >||
> > >+---v--+ |
> > >|  Pipe DeGamma| |
> > >|  | |
> > >+---+--+ |
> > >|Pipe Color  |
> > >+---v--+ Hardware|
> > >|  Pipe CSC/CTM| |
> > >|  | |
> > >+---+--+ |
> > >||
> > >+---v--+ |
> > >|  Pipe Gamma  | |
> > >|  | |
> > >+---+--+ |
> > >||
> > +-+
> >  |
> >  v
> >Pipe Output
> > 
> > This patch series adds properties for plane color features. It adds
> > properties for degamma used to linearize data, CSC used for gamut
> > conversion, and gamma used to again non-linearize data as per panel
> > supported color space. These can be utilize by user space to convert
> > planes from one format to another, one color space to another etc.
> > 
> > Usersapce can take smart blending decisions and utilize these hardware
> > supported plane color features to get accurate color profile. The same
> > can help in consistent color quality from source to panel taking
> > advantage of advanced color features in hardware.
> > 
> > These patches just add the property interfaces and enable helper
> > functions.
> > 
> > This series adds Intel Gen9 specific plane gamma feature. We can
> > build up and add other platform/hardware specific implementation
> > on top of this series
> > 
> > Note: This is just to get a design feedback whether these interfaces
> > look ok. Based on community feedback on interfaces, we will implement
> > IGT tests to validate plane color features. This is un-tested currently.
> > 
> > Userspace implementation using these properties have been done in drm
> > hwcomposer by "Alexandru-Cosmin Gheorghe alexandru-cosmin.gheor...@arm.com"
> > from ARM. A merge request has been opened by Alexandru for drm_hwcomposer,
> > implementing the property changes for the same. Please review that as well:
> > https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/merge_requests/25
> > 
> > v2: Dropped legacy gamma table for plane as suggested by Maarten. Added
> > Gen9/BDW plane gamma feature and rebase on tot.
> > 
> > v3: Added a new drm_color_lut_ext structure to accommodate 32 bit precision
> > entries, pointed to by Brian, Starkey for HDR usecases. Addressed Sean,Paul
> > comments and moved plane color properties to drm_plane instead of
> > mode_config. Added property documentation as suggested by Daniel, Vetter.
> > Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
> > 
> > v4: Rebase
> > 
> > v5: Added "Display Color Hardware Pipeline" flow to kernel
> > documentation as suggested by "Ville Syrjala" and "Brian Starkey".
> > Moved the property creation to drm_color_mgmt.c file to consolidate
> > all color operations at one place. Addressed Alexandru's review comments.
> > 
> > v6: Rebase. Added 

[Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [v2] drm/i915: make intel_sdvo_regs.h self-contained (rev2)

2019-06-14 Thread Patchwork
== Series Details ==

Series: series starting with [v2] drm/i915: make intel_sdvo_regs.h 
self-contained (rev2)
URL   : https://patchwork.freedesktop.org/series/62002/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6257_full -> Patchwork_13268_full


Summary
---

  **SUCCESS**

  No regressions found.

  

Known issues


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

### IGT changes ###

 Issues hit 

  * igt@gem_eio@in-flight-10ms:
- shard-kbl:  [PASS][1] -> [DMESG-WARN][2] ([fdo#110913 ])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-kbl1/igt@gem_...@in-flight-10ms.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-kbl4/igt@gem_...@in-flight-10ms.html

  * igt@gem_exec_balancer@smoke:
- shard-iclb: [PASS][3] -> [SKIP][4] ([fdo#110854])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-iclb1/igt@gem_exec_balan...@smoke.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-iclb5/igt@gem_exec_balan...@smoke.html

  * igt@gem_persistent_relocs@forked-thrashing:
- shard-hsw:  [PASS][5] -> [DMESG-WARN][6] ([fdo#110789] / 
[fdo#110913 ]) +1 similar issue
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-hsw7/igt@gem_persistent_rel...@forked-thrashing.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-hsw4/igt@gem_persistent_rel...@forked-thrashing.html

  * igt@gem_userptr_blits@map-fixed-invalidate-busy:
- shard-skl:  [PASS][7] -> [DMESG-WARN][8] ([fdo#110913 ])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-skl6/igt@gem_userptr_bl...@map-fixed-invalidate-busy.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-skl2/igt@gem_userptr_bl...@map-fixed-invalidate-busy.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
- shard-snb:  [PASS][9] -> [DMESG-WARN][10] ([fdo#110913 ])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-snb7/igt@gem_userptr_bl...@map-fixed-invalidate-overlap-busy.html
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-snb1/igt@gem_userptr_bl...@map-fixed-invalidate-overlap-busy.html
- shard-hsw:  [PASS][11] -> [DMESG-WARN][12] ([fdo#110913 ])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-hsw1/igt@gem_userptr_bl...@map-fixed-invalidate-overlap-busy.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-hsw6/igt@gem_userptr_bl...@map-fixed-invalidate-overlap-busy.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup:
- shard-apl:  [PASS][13] -> [DMESG-WARN][14] ([fdo#110913 ])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-apl8/igt@gem_userptr_bl...@map-fixed-invalidate-overlap-busy-gup.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-apl6/igt@gem_userptr_bl...@map-fixed-invalidate-overlap-busy-gup.html

  * igt@gem_userptr_blits@sync-unmap-cycles:
- shard-glk:  [PASS][15] -> [DMESG-WARN][16] ([fdo#110913 ]) +1 
similar issue
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-glk9/igt@gem_userptr_bl...@sync-unmap-cycles.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-glk9/igt@gem_userptr_bl...@sync-unmap-cycles.html

  * igt@kms_cursor_crc@pipe-b-cursor-suspend:
- shard-apl:  [PASS][17] -> [DMESG-WARN][18] ([fdo#108566]) +1 
similar issue
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-apl4/igt@kms_cursor_...@pipe-b-cursor-suspend.html
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-apl7/igt@kms_cursor_...@pipe-b-cursor-suspend.html

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
- shard-glk:  [PASS][19] -> [FAIL][20] ([fdo#104873])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-glk1/igt@kms_cursor_leg...@2x-long-flip-vs-cursor-legacy.html
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-glk1/igt@kms_cursor_leg...@2x-long-flip-vs-cursor-legacy.html

  * igt@kms_flip@2x-flip-vs-absolute-wf_vblank:
- shard-hsw:  [PASS][21] -> [SKIP][22] ([fdo#109271]) +23 similar 
issues
   [21]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-hsw4/igt@kms_flip@2x-flip-vs-absolute-wf_vblank.html
   [22]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13268/shard-hsw1/igt@kms_flip@2x-flip-vs-absolute-wf_vblank.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-glk:  [PASS][23] -> [FAIL][24] ([fdo#102887] / [fdo#105363])
   [23]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6257/shard-glk5/igt@kms_f...@flip-vs-expired-vblank-interruptible.html
   [24]: 

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for prime doc polish and ... a few cleanups

2019-06-14 Thread Patchwork
== Series Details ==

Series: prime doc polish and ... a few cleanups
URL   : https://patchwork.freedesktop.org/series/62135/
State : warning

== Summary ==

$ dim sparse origin/drm-tip
Sparse version: v0.5.2
Commit: drm/todo: Improve drm_gem_object funcs todo
Okay!

Commit: drm/gem: Unexport drm_gem_(un)pin/v(un)map
Okay!

Commit: drm/prime: Update docs
Okay!

Commit: drm/prime: Unconditionally set up the prime file private
Okay!

Commit: drm/prime: Make DRIVER_PRIME a no-op
Okay!

Commit: drm/prime: Actually remove DRIVER_PRIME everywhere
Okay!

Commit: drm/arm/komeda: Remove DRIVER_HAVE_IRQ
Okay!

Commit: drm/omapdrm: drop fb_debug_enter/leave
Okay!

Commit: drm/prime: Align gem_prime_export with obj_funcs.export
-O:drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:348:16: warning: symbol 
'amdgpu_gem_prime_export' was not declared. Should it be static?
+drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:348:16: warning: symbol 
'amdgpu_gem_prime_export' was not declared. Should it be static?

Commit: drm/arc: Drop drm_gem_prime_export/import
Okay!

Commit: drm/arm: Drop drm_gem_prime_export/import
Okay!

Commit: drm/atmel: Drop drm_gem_prime_export/import
Okay!

Commit: drm/etnaviv: Drop drm_gem_prime_export/import
Okay!

Commit: drm/exynos: Drop drm_gem_prime_export
Okay!

Commit: drm/fsl-dcu: Drop drm_gem_prime_export/import
Okay!

Commit: drm/hisilicon: Drop drm_gem_prime_export/import
Okay!

Commit: drm/imx: Drop drm_gem_prime_export/import
Okay!

Commit: drm/mcde: Drop drm_gem_prime_export/import
Okay!

Commit: drm/mtk: Drop drm_gem_prime_export/import
Okay!

Commit: drm/meson: Drop drm_gem_prime_export/import
Okay!

Commit: drm/msm: Drop drm_gem_prime_export/import
Okay!

Commit: drm/mxsfb: Drop drm_gem_prime_export/import
Okay!

Commit: drm/nouveau: Drop drm_gem_prime_export/import
Okay!

Commit: drm/pl111: Drop drm_gem_prime_export/import
Okay!

Commit: drm/qxl: Drop drm_gem_prime_export/import
Okay!

Commit: drm/rcar-du: Drop drm_gem_prime_export/import
Okay!

Commit: drm/rockchip: Drop drm_gem_prime_export/import
Okay!

Commit: drm/shmob: Drop drm_gem_prime_export/import
Okay!

Commit: drm/sti: Drop drm_gem_prime_export/import
Okay!

Commit: drm/stm: Drop drm_gem_prime_export/import
Okay!

Commit: drm/tilcdc: Drop drm_gem_prime_export/import
Okay!

Commit: drm/tve2000: Drop drm_gem_prime_export/import
Okay!

Commit: drm/vboxvideo: Drop drm_gem_prime_export/import
Okay!

Commit: drm/vc3: Drop drm_gem_prime_import
Okay!

Commit: drm/radeon: Drop drm_gem_prime_import
Okay!

Commit: drm/vgem: Drop drm_gem_prime_export
Okay!

Commit: drm/virtio: Drop drm_gem_prime_export/import
Okay!

Commit: drm/xen: Drop drm_gem_prime_export/import
Okay!

Commit: drm/zte: Drop drm_gem_prime_export/import
Okay!

Commit: drm/vram-helper: Drop drm_gem_prime_export/import
Okay!

Commit: drm/prime: automatically set gem_obj->resv on import
Okay!

Commit: drm/etnaviv: Drop resv argument from etnaviv_gem_new_impl
Okay!

Commit: drm/lima: Drop resv argument from lima_bo_create_struct
Okay!

Commit: drm/mediatek: Use drm_atomic_helper_wait_for_fences
Okay!

Commit: drm/msm: Drop robj from msm_gem_new_impl
Okay!

Commit: drm/panfrost: don't set gem_obj->resv for prime import anymore
Okay!

Commit: drm/vc4: Don set gem_obj->resv in prime import anymore
Okay!

Commit: drm/vgem: Ditch attach trickery in the fence ioctl
Okay!

Commit: drm/msm: Use drm_gem_fb_prepare_fb
Okay!

Commit: drm/vc4: Use drm_gem_fb_prepare_fb
Okay!

Commit: drm/radeon: Fill out gem_object->resv
Okay!

Commit: drm/nouveau: Fill out gem_object->resv
Okay!

Commit: drm/amdgpu: Fill out gem_object->resv
-O:drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:277:27: warning: symbol 
'amdgpu_gem_prime_res_obj' was not declared. Should it be static?

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

Re: [Intel-gfx] [PATCH v5] docs: power: convert docs to ReST and rename to *.rst

2019-06-14 Thread Bjorn Helgaas
On Fri, Jun 14, 2019 at 02:36:31PM -0600, Jonathan Corbet wrote:
> On Thu, 13 Jun 2019 07:10:36 -0300
> Mauro Carvalho Chehab  wrote:
> 
> > Convert the PM documents to ReST, in order to allow them to
> > build with Sphinx.
> > 
> > The conversion is actually:
> >   - add blank lines and identation in order to identify paragraphs;
> >   - fix tables markups;
> >   - add some lists markups;
> >   - mark literal blocks;
> >   - adjust title markups.
> > 
> > At its new index.rst, let's add a :orphan: while this is not linked to
> > the main index.rst file, in order to avoid build warnings.
> > 
> > Signed-off-by: Mauro Carvalho Chehab 
> > Acked-by: Mark Brown 
> > Acked-by: Bjorn Helgaas 
> > Acked-by: Srivatsa S. Bhat (VMware) 
> 
> So I can't apply this one due to conflicts in include/linux/pci.h.  Bjorn,
> perhaps the easiest thing is for you to take this one through your tree?

OK, I applied this to pci/docs for v5.3.  I applied this entire patch,
but if you would prefer that I only apply the PCI-related parts, let
me know and I'll split those out.

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

Re: [Intel-gfx] [PATCH 46/59] drm/panfrost: don't set gem_obj->resv for prime import anymore

2019-06-14 Thread Rob Herring
On Fri, Jun 14, 2019 at 2:37 PM Daniel Vetter  wrote:
>
> This is now done in drm_prime.c
>
> Signed-off-by: Daniel Vetter 
> Cc: Rob Herring 
> Cc: Tomeu Vizoso 
> ---
>  drivers/gpu/drm/panfrost/panfrost_gem.c | 2 --
>  1 file changed, 2 deletions(-)

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

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for prime doc polish and ... a few cleanups

2019-06-14 Thread Patchwork
== Series Details ==

Series: prime doc polish and ... a few cleanups
URL   : https://patchwork.freedesktop.org/series/62135/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
ca5f49bad9e3 drm/todo: Improve drm_gem_object funcs todo
-:32: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 0 errors, 1 warnings, 0 checks, 10 lines checked
71e5858ce8df drm/gem: Unexport drm_gem_(un)pin/v(un)map
-:118: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 0 errors, 1 warnings, 0 checks, 85 lines checked
bc90321ccc72 drm/prime: Update docs
-:377: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#377: FILE: drivers/gpu/drm/drm_prime.c:304:
+   ret = drm_prime_lookup_buf_handle(_priv->prime,
+   dma_buf, handle);

-:428: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#428: FILE: drivers/gpu/drm/drm_prime.c:333:
+   ret = drm_prime_add_buf_handle(_priv->prime,
+   dma_buf, *handle);

-:519: WARNING:ENOSYS: ENOSYS means 'invalid syscall nr' and nothing else
#519: FILE: drivers/gpu/drm/drm_prime.c:368:
+   return -ENOSYS;

-:550: WARNING:ENOSYS: ENOSYS means 'invalid syscall nr' and nothing else
#550: FILE: drivers/gpu/drm/drm_prime.c:519:
+   return -ENOSYS;

-:723: WARNING:LONG_LINE_COMMENT: line over 100 characters
#723: FILE: drivers/gpu/drm/drm_prime.c:692:
+ * _buf_ops.vunmap callback. Calls into _gem_object_funcs.vunmap for 
device specific handling.

-:760: WARNING:ENOSYS: ENOSYS means 'invalid syscall nr' and nothing else
#760: FILE: drivers/gpu/drm/drm_prime.c:768:
+   return -ENOSYS;

-:794: CHECK:ALLOC_SIZEOF_STRUCT: Prefer kmalloc(sizeof(*sg)...) over 
kmalloc(sizeof(struct sg_table)...)
#794: FILE: drivers/gpu/drm/drm_prime.c:802:
+   sg = kmalloc(sizeof(struct sg_table), GFP_KERNEL);

-:801: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#801: FILE: drivers/gpu/drm/drm_prime.c:809:
+   ret = sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
+   nr_pages << PAGE_SHIFT, GFP_KERNEL);

-:1190: CHECK:LINE_SPACING: Please don't use multiple blank lines
#1190: FILE: include/drm/drm_drv.h:616:
+
+

-:1390: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal 
patch author 'Daniel Vetter '

total: 0 errors, 5 warnings, 5 checks, 1295 lines checked
6ae25bcbd4da drm/prime: Unconditionally set up the prime file private
-:57: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 0 errors, 1 warnings, 0 checks, 36 lines checked
3709143046ea drm/prime: Make DRIVER_PRIME a no-op
-:52: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 0 errors, 1 warnings, 0 checks, 27 lines checked
3578f6412c5a drm/prime: Actually remove DRIVER_PRIME everywhere
-:160: WARNING:OBSOLETE: drivers/gpu/drm/cirrus/cirrus.c is marked as 
'obsolete' in the MAINTAINERS hierarchy.  No unnecessary modifications please.

-:163: WARNING:OBSOLETE: drivers/gpu/drm/cirrus/cirrus.c is marked as 
'obsolete' in the MAINTAINERS hierarchy.  No unnecessary modifications please.

-:238: ERROR:TRAILING_WHITESPACE: trailing whitespace
#238: FILE: drivers/gpu/drm/i915/i915_drv.c:3196:
+^IDRIVER_GEM | $

-:771: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 1 errors, 3 warnings, 0 checks, 468 lines checked
cac2708bbe8a drm/arm/komeda: Remove DRIVER_HAVE_IRQ
-:25: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 0 errors, 1 warnings, 0 checks, 9 lines checked
93a140f7f459 drm/omapdrm: drop fb_debug_enter/leave
-:29: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 0 errors, 1 warnings, 0 checks, 8 lines checked
6aff5a78c3bc drm/prime: Align gem_prime_export with obj_funcs.export
-:418: ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar"
#418: FILE: drivers/gpu/drm/vc4/vc4_bo.c:661:
+struct dma_buf * vc4_prime_export(struct drm_gem_object *obj, int flags)

-:486: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 1 errors, 1 warnings, 0 checks, 311 lines checked
ad7244e5ed63 drm/arc: Drop drm_gem_prime_export/import
-:26: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 0 errors, 1 warnings, 0 checks, 8 lines checked
e0c2f8ac23fc drm/arm: Drop drm_gem_prime_export/import
-:54: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch 
author 'Daniel Vetter '

total: 0 errors, 1 warnings, 0 checks, 24 lines checked
75bec2b6dc2c drm/atmel: Drop drm_gem_prime_export/import
-:30: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by 

Re: [Intel-gfx] [PATCH 01/59] drm/todo: Improve drm_gem_object funcs todo

2019-06-14 Thread Rob Herring
On Fri, Jun 14, 2019 at 2:36 PM Daniel Vetter  wrote:
>
> We're kinda going in the wrong direction. Spotted while typing better
> gem/prime docs.
>
> Cc: Thomas Zimmermann 
> Cc: Gerd Hoffmann 
> Cc: Rob Herring 
> Cc: Noralf Trønnes 
> Signed-off-by: Daniel Vetter 
> ---
>  Documentation/gpu/todo.rst | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index b4a76c2703e5..23583f0e3755 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -228,6 +228,10 @@ struct drm_gem_object_funcs
>  GEM objects can now have a function table instead of having the callbacks on 
> the
>  DRM driver struct. This is now the preferred way and drivers can be moved 
> over.
>
> +Unfortunately some of the recently added GEM helpers are going in the wrong
> +direction by adding OPS macros that use the old, deprecated hooks. See
> +DRM_GEM_CMA_VMAP_DRIVER_OPS, DRM_GEM_SHMEM_DRIVER_OPS, and 
> DRM_GEM_VRAM_DRIVER_PRIME.

At least for DRM_GEM_SHMEM_DRIVER_OPS, it should just be a matter of
removing in the single user (cirrus) and deleting the macro.

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

[Intel-gfx] [PATCH 57/59] drm/todo: Update mmap todo

2019-06-14 Thread Daniel Vetter
Thanks to Noralf some good progress already.

Signed-off-by: Daniel Vetter 
---
 Documentation/gpu/todo.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index c4e7c0672a14..9717540ee28f 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -162,7 +162,7 @@ Clean up mmap forwarding
 
 A lot of drivers forward gem mmap calls to dma-buf mmap for imported buffers.
 And also a lot of them forward dma-buf mmap to the gem mmap implementations.
-Would be great to refactor this all into a set of small common helpers.
+There's drm_gem_prime_mmap() for this now, but still needs to be rolled out.
 
 Contact: Daniel Vetter
 
-- 
2.20.1

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

[Intel-gfx] [PATCH 52/59] drm/nouveau: Fill out gem_object->resv

2019-06-14 Thread Daniel Vetter
That way we can ditch our gem_prime_res_obj implementation. Since ttm
absolutely needs the right reservation object all the boilerplate is
already there and we just have to wire it up correctly.

Note that gem/prime doesn't care when we do this, as long as we do it
before the bo is registered and someone can call the handle2fd ioctl
on it.

Aside: ttm_buffer_object.ttm_resv could probably be ditched in favour
of always passing a non-NULL resv to ttm_bo_init(). At least for gem
drivers that would avoid having two of these, on in ttm_buffer_object
and the other in drm_gem_object, one just there for confusion.

Signed-off-by: Daniel Vetter 
Cc: Ben Skeggs 
Cc: nouv...@lists.freedesktop.org
---
 drivers/gpu/drm/nouveau/nouveau_bo.c| 2 ++
 drivers/gpu/drm/nouveau/nouveau_drm.c   | 1 -
 drivers/gpu/drm/nouveau/nouveau_gem.h   | 1 -
 drivers/gpu/drm/nouveau/nouveau_prime.c | 7 ---
 4 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c 
b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 34a998012bf6..6f1217b3e6b9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -299,6 +299,8 @@ nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align,
  type, >placement,
  align >> PAGE_SHIFT, false, acc_size, sg,
  robj, nouveau_bo_del_ttm);
+   nvbo->gem.resv = nvbo->bo.resv;
+
if (ret) {
/* ttm will call nouveau_bo_del_ttm if it fails.. */
return ret;
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c 
b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 4377b836265f..2c36319c158f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -1131,7 +1131,6 @@ driver_stub = {
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_pin = nouveau_gem_prime_pin,
-   .gem_prime_res_obj = nouveau_gem_prime_res_obj,
.gem_prime_unpin = nouveau_gem_prime_unpin,
.gem_prime_get_sg_table = nouveau_gem_prime_get_sg_table,
.gem_prime_import_sg_table = nouveau_gem_prime_import_sg_table,
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.h 
b/drivers/gpu/drm/nouveau/nouveau_gem.h
index fe39998f65cc..9dea015387fd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.h
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.h
@@ -33,7 +33,6 @@ extern int nouveau_gem_ioctl_info(struct drm_device *, void *,
  struct drm_file *);
 
 extern int nouveau_gem_prime_pin(struct drm_gem_object *);
-struct reservation_object *nouveau_gem_prime_res_obj(struct drm_gem_object *);
 extern void nouveau_gem_prime_unpin(struct drm_gem_object *);
 extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object 
*);
 extern struct drm_gem_object *nouveau_gem_prime_import_sg_table(
diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c 
b/drivers/gpu/drm/nouveau/nouveau_prime.c
index 1fefc93af1d7..ec50017692d4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_prime.c
+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
@@ -107,10 +107,3 @@ void nouveau_gem_prime_unpin(struct drm_gem_object *obj)
 
nouveau_bo_unpin(nvbo);
 }
-
-struct reservation_object *nouveau_gem_prime_res_obj(struct drm_gem_object 
*obj)
-{
-   struct nouveau_bo *nvbo = nouveau_gem_object(obj);
-
-   return nvbo->bo.resv;
-}
-- 
2.20.1

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

[Intel-gfx] [PATCH 55/59] drm/todo: remove gem_prime_import/export todo

2019-06-14 Thread Daniel Vetter
I've done that.

Signed-off-by: Daniel Vetter 
---
 Documentation/gpu/todo.rst | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 81fbb15c94c6..21a7b7800d3e 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -206,13 +206,6 @@ efficient.
 
 Contact: Daniel Vetter
 
-Defaults for .gem_prime_import and export
--
-
-Most drivers don't need to set drm_driver->gem_prime_import and
-->gem_prime_export now that drm_gem_prime_import() and drm_gem_prime_export()
-are the default.
-
 struct drm_gem_object_funcs
 ---
 
-- 
2.20.1

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

[Intel-gfx] [PATCH 48/59] drm/vgem: Ditch attach trickery in the fence ioctl

2019-06-14 Thread Daniel Vetter
It looks like this was done purely to get a consistent place to look
up the reservation object pointer. With the drm_prime.c helper code
now also setting gem_object->resv for imported objects we can just use
that pointer directly, instead of first ensuring a dma-buf exists.

Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/vgem/vgem_fence.c | 22 +-
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/vgem/vgem_fence.c 
b/drivers/gpu/drm/vgem/vgem_fence.c
index 72d43d5ec5ab..08997fdd3ccb 100644
--- a/drivers/gpu/drm/vgem/vgem_fence.c
+++ b/drivers/gpu/drm/vgem/vgem_fence.c
@@ -100,22 +100,6 @@ static struct dma_fence *vgem_fence_create(struct 
vgem_file *vfile,
return >base;
 }
 
-static int attach_dmabuf(struct drm_device *dev,
-struct drm_gem_object *obj)
-{
-   struct dma_buf *dmabuf;
-
-   if (obj->dma_buf)
-   return 0;
-
-   dmabuf = dev->driver->gem_prime_export(obj, 0);
-   if (IS_ERR(dmabuf))
-   return PTR_ERR(dmabuf);
-
-   obj->dma_buf = dmabuf;
-   return 0;
-}
-
 /*
  * vgem_fence_attach_ioctl (DRM_IOCTL_VGEM_FENCE_ATTACH):
  *
@@ -157,10 +141,6 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
if (!obj)
return -ENOENT;
 
-   ret = attach_dmabuf(dev, obj);
-   if (ret)
-   goto err;
-
fence = vgem_fence_create(vfile, arg->flags);
if (!fence) {
ret = -ENOMEM;
@@ -168,7 +148,7 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
}
 
/* Check for a conflicting fence */
-   resv = obj->dma_buf->resv;
+   resv = obj->resv;
if (!reservation_object_test_signaled_rcu(resv,
  arg->flags & 
VGEM_FENCE_WRITE)) {
ret = -EBUSY;
-- 
2.20.1

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

[Intel-gfx] [PATCH 53/59] drm/amdgpu: Fill out gem_object->resv

2019-06-14 Thread Daniel Vetter
That way we can ditch our gem_prime_res_obj implementation. Since ttm
absolutely needs the right reservation object all the boilerplate is
already there and we just have to wire it up correctly.

Note that gem/prime doesn't care when we do this, as long as we do it
before the bo is registered and someone can call the handle2fd ioctl
on it.

Aside: ttm_buffer_object.ttm_resv could probably be ditched in favour
of always passing a non-NULL resv to ttm_bo_init(). At least for gem
drivers that would avoid having two of these, on in ttm_buffer_object
and the other in drm_gem_object, one just there for confusion.

Signed-off-by: Daniel Vetter 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: Daniel Vetter 
Cc: "Michel Dänzer" 
Cc: Chris Wilson 
Cc: Huang Rui 
Cc: Felix Kuehling 
Cc: Andrey Grodzovsky 
Cc: Evan Quan 
Cc: Sonny Jiang 
Cc: Amber Lin 
Cc: "Michał Mirosław" 
Cc: Junwei Zhang 
Cc: Thomas Zimmermann 
Cc: Samuel Li 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 17 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c  |  2 ++
 4 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
index 4809d4a5d72a..02cd845e77b3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
@@ -267,20 +267,6 @@ static void amdgpu_dma_buf_map_detach(struct dma_buf 
*dma_buf,
drm_gem_map_detach(dma_buf, attach);
 }
 
-/**
- * amdgpu_gem_prime_res_obj - _driver.gem_prime_res_obj implementation
- * @obj: GEM BO
- *
- * Returns:
- * The BO's reservation object.
- */
-struct reservation_object *amdgpu_gem_prime_res_obj(struct drm_gem_object *obj)
-{
-   struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj);
-
-   return bo->tbo.resv;
-}
-
 /**
  * amdgpu_dma_buf_begin_cpu_access - _buf_ops.begin_cpu_access 
implementation
  * @dma_buf: Shared DMA buffer
@@ -339,8 +325,7 @@ const struct dma_buf_ops amdgpu_dmabuf_ops = {
  * @gobj: GEM BO
  * @flags: Flags such as DRM_CLOEXEC and DRM_RDWR.
  *
- * The main work is done by the _gem_prime_export helper, which in turn
- * uses _gem_prime_res_obj.
+ * The main work is done by the _gem_prime_export helper.
  *
  * Returns:
  * Shared DMA buffer representing the GEM BO from the given device.
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h
index 7f73a4f94204..5012e6ab58f1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h
@@ -34,7 +34,6 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_gem_object 
*gobj,
int flags);
 struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev,
struct dma_buf *dma_buf);
-struct reservation_object *amdgpu_gem_prime_res_obj(struct drm_gem_object *);
 void *amdgpu_gem_prime_vmap(struct drm_gem_object *obj);
 void amdgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
 int amdgpu_gem_prime_mmap(struct drm_gem_object *obj,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 8e1b269351e8..3233c5abf5b6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1333,7 +1333,6 @@ static struct drm_driver kms_driver = {
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export = amdgpu_gem_prime_export,
.gem_prime_import = amdgpu_gem_prime_import,
-   .gem_prime_res_obj = amdgpu_gem_prime_res_obj,
.gem_prime_get_sg_table = amdgpu_gem_prime_get_sg_table,
.gem_prime_import_sg_table = amdgpu_gem_prime_import_sg_table,
.gem_prime_vmap = amdgpu_gem_prime_vmap,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 16f96f2e3671..7b251fd26bd5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -505,6 +505,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
if (unlikely(r != 0))
return r;
 
+   bo->gem_base.resv = bo->tbo.resv;
+
if (!amdgpu_gmc_vram_full_visible(>gmc) &&
bo->tbo.mem.mem_type == TTM_PL_VRAM &&
bo->tbo.mem.start < adev->gmc.visible_vram_size >> PAGE_SHIFT)
-- 
2.20.1

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

[Intel-gfx] [PATCH 59/59] drm/doc: Document kapi doc expectations

2019-06-14 Thread Daniel Vetter
We've had this already for anything new. With my drm_prime.c cleanup I
also think documentations for everything already existing is complete,
and we can bake this in as a requirements subsystem wide.

Signed-off-by: Daniel Vetter 
Cc: Laurent Pinchart 
Cc: Jani Nikula 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
---
 Documentation/gpu/introduction.rst | 13 +
 Documentation/gpu/todo.rst | 13 -
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Documentation/gpu/introduction.rst 
b/Documentation/gpu/introduction.rst
index fccbe375244d..a94ad6ad1f54 100644
--- a/Documentation/gpu/introduction.rst
+++ b/Documentation/gpu/introduction.rst
@@ -51,6 +51,19 @@ and "FIXME" where the interface could be cleaned up.
 
 Also read the :ref:`guidelines for the kernel documentation at large 
`.
 
+Documentation Requirements for kAPI
+---
+
+All kernel APIs exported to other modules must be documented, including their
+datastructures and at least a short introductory section explaining the overall
+concepts. Documentation should be put into the code itself as kerneldoc 
comments
+as much as reasonable. Do not blindly document everything, but document only
+what's relevant for driver authors: Internal functions of drm.ko and definitely
+static functions should not have formal kerneldoc comments. Use normal C
+comments if you feel like a comment is warranted. Similar for data structures,
+annotate anything entirely private with ``/* private: */`` comments as per the
+documentation guide.
+
 Getting Started
 ===
 
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 026e55c517e1..25878dd048fd 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -299,19 +299,6 @@ In the end no .c file should need to include ``drmP.h`` 
anymore.
 
 Contact: Daniel Vetter
 
-Add missing kerneldoc for exported functions
-
-
-The DRM reference documentation is still lacking kerneldoc in a few areas. The
-task would be to clean up interfaces like moving functions around between
-files to better group them and improving the interfaces like dropping return
-values for functions that never fail. Then write kerneldoc for all exported
-functions and an overview section and integrate it all into the drm book.
-
-See https://dri.freedesktop.org/docs/drm/ for what's there already.
-
-Contact: Daniel Vetter
-
 Make panic handling work
 
 
-- 
2.20.1

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

[Intel-gfx] [PATCH 45/59] drm/msm: Drop robj from msm_gem_new_impl

2019-06-14 Thread Daniel Vetter
Only user was the prime import, and drm_prime.c takes care of that
now.

Signed-off-by: Daniel Vetter 
Cc: Rob Clark 
Cc: Sean Paul 
Cc: linux-arm-...@vger.kernel.org
Cc: freedr...@lists.freedesktop.org
---
 drivers/gpu/drm/msm/msm_gem.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 35f55dd25994..404b6fea9e35 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -947,7 +947,6 @@ int msm_gem_new_handle(struct drm_device *dev, struct 
drm_file *file,
 
 static int msm_gem_new_impl(struct drm_device *dev,
uint32_t size, uint32_t flags,
-   struct reservation_object *resv,
struct drm_gem_object **obj,
bool struct_mutex_locked)
 {
@@ -974,9 +973,6 @@ static int msm_gem_new_impl(struct drm_device *dev,
msm_obj->flags = flags;
msm_obj->madv = MSM_MADV_WILLNEED;
 
-   if (resv)
-   msm_obj->base.resv = resv;
-
INIT_LIST_HEAD(_obj->submit_entry);
INIT_LIST_HEAD(_obj->vmas);
 
@@ -1018,7 +1014,7 @@ static struct drm_gem_object *_msm_gem_new(struct 
drm_device *dev,
if (size == 0)
return ERR_PTR(-EINVAL);
 
-   ret = msm_gem_new_impl(dev, size, flags, NULL, , 
struct_mutex_locked);
+   ret = msm_gem_new_impl(dev, size, flags, , struct_mutex_locked);
if (ret)
goto fail;
 
@@ -1095,7 +1091,7 @@ struct drm_gem_object *msm_gem_import(struct drm_device 
*dev,
 
size = PAGE_ALIGN(dmabuf->size);
 
-   ret = msm_gem_new_impl(dev, size, MSM_BO_WC, dmabuf->resv, , false);
+   ret = msm_gem_new_impl(dev, size, MSM_BO_WC, , false);
if (ret)
goto fail;
 
-- 
2.20.1

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

[Intel-gfx] [PATCH 56/59] drm/todo: Update backlight todo

2019-06-14 Thread Daniel Vetter
Basic helpers have been extracted, now there's a pile more todo still
across the entire tree.

Signed-off-by: Daniel Vetter 
---
 Documentation/gpu/todo.rst | 27 +--
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 21a7b7800d3e..c4e7c0672a14 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -422,6 +422,19 @@ fit the available time.
 
 Contact: Daniel Vetter
 
+Backlight Refactoring
+-
+
+Backlight drivers have a triple enable/disable state, which is a bit overkill.
+Plan to fix this:
+
+1. Roll out backlight_enable() and backlight_disable() helpers everywhere. This
+   has started already.
+2. In all, only look at one of the three status bits set by the above helpers.
+3. Remove the other two status bits.
+
+Contact: Daniel Vetter
+
 Driver Specific
 ===
 
@@ -431,20 +444,6 @@ tinydrm
 Tinydrm is the helper driver for really simple fb drivers. The goal is to make
 those drivers as simple as possible, so lots of room for refactoring:
 
-- backlight helpers, probably best to put them into a new drm_backlight.c.
-  This is because drivers/video is de-facto unmaintained. We could also
-  move drivers/video/backlight to drivers/gpu/backlight and take it all
-  over within drm-misc, but that's more work. Backlight helpers require a fair
-  bit of reworking and refactoring. A simple example is the enabling of a 
backlight.
-  Tinydrm has helpers for this. It would be good if other drivers can also use 
the
-  helper. However, there are various cases we need to consider i.e different
-  drivers seem to have different ways of enabling/disabling a backlight.
-  We also need to consider the backlight drivers (like gpio_backlight). The 
situation
-  is further complicated by the fact that the backlight is tied to fbdev
-  via fb_notifier_callback() which has complicated logic. For further details, 
refer
-  to the following discussion thread:
-  https://groups.google.com/forum/#!topic/outreachy-kernel/8rBe30lwtdA
-
 - spi helpers, probably best put into spi core/helper code. Thierry said
   the spi maintainer is fast, so shouldn't be a big issue.
 
-- 
2.20.1

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

[Intel-gfx] [PATCH 54/59] drm/prime: Ditch gem_prime_res_obj hook

2019-06-14 Thread Daniel Vetter
Everyone is just using gem_object->resv now.

Signed-off-by: Daniel Vetter 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
---
 Documentation/gpu/todo.rst  |  9 -
 drivers/gpu/drm/drm_prime.c |  3 ---
 include/drm/drm_drv.h   | 12 
 3 files changed, 24 deletions(-)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 23583f0e3755..81fbb15c94c6 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -196,15 +196,6 @@ Might be good to also have some igt testcases for this.
 
 Contact: Daniel Vetter, Noralf Tronnes
 
-Remove the ->gem_prime_res_obj callback
-
-
-The ->gem_prime_res_obj callback can be removed from drivers by using the
-reservation_object in the drm_gem_object. It may also be possible to use the
-generic drm_gem_reservation_object_wait helper for waiting for a bo.
-
-Contact: Daniel Vetter
-
 idr_init_base()
 ---
 
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 58d595f4a4f5..65e611337254 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -832,9 +832,6 @@ struct dma_buf *drm_gem_prime_export(struct drm_gem_object 
*obj,
.resv = obj->resv,
};
 
-   if (dev->driver->gem_prime_res_obj)
-   exp_info.resv = dev->driver->gem_prime_res_obj(obj);
-
return drm_gem_dmabuf_export(dev, _info);
 }
 EXPORT_SYMBOL(drm_gem_prime_export);
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index ec1c638927b0..b01a30c64075 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -618,18 +618,6 @@ struct drm_driver {
 */
struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj);
 
-   /**
-* @gem_prime_res_obj:
-*
-* Optional hook to look up the _object for an buffer when
-* exporting it.
-*
-* FIXME: This hook is deprecated. User of this hook should be replaced
-* by setting _gem_object.resv instead.
-*/
-   struct reservation_object * (*gem_prime_res_obj)(
-   struct drm_gem_object *obj);
-
/**
 * @gem_prime_import_sg_table:
 *
-- 
2.20.1

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

[Intel-gfx] [PATCH 51/59] drm/radeon: Fill out gem_object->resv

2019-06-14 Thread Daniel Vetter
That way we can ditch our gem_prime_res_obj implementation. Since ttm
absolutely needs the right reservation object all the boilerplate is
already there and we just have to wire it up correctly.

Note that gem/prime doesn't care when we do this, as long as we do it
before the bo is registered and someone can call the handle2fd ioctl
on it.

Aside: ttm_buffer_object.ttm_resv could probably be ditched in favour
of always passing a non-NULL resv to ttm_bo_init(). At least for gem
drivers that would avoid having two of these, on in ttm_buffer_object
and the other in drm_gem_object, one just there for confusion.

Signed-off-by: Daniel Vetter 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: amd-...@lists.freedesktop.org
---
 drivers/gpu/drm/radeon/radeon_drv.c| 2 --
 drivers/gpu/drm/radeon/radeon_object.c | 1 +
 drivers/gpu/drm/radeon/radeon_prime.c  | 7 ---
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index 4403e76e1ae0..a4a78dfdef37 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -152,7 +152,6 @@ struct drm_gem_object 
*radeon_gem_prime_import_sg_table(struct drm_device *dev,
struct sg_table *sg);
 int radeon_gem_prime_pin(struct drm_gem_object *obj);
 void radeon_gem_prime_unpin(struct drm_gem_object *obj);
-struct reservation_object *radeon_gem_prime_res_obj(struct drm_gem_object *);
 void *radeon_gem_prime_vmap(struct drm_gem_object *obj);
 void radeon_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
 
@@ -566,7 +565,6 @@ static struct drm_driver kms_driver = {
.gem_prime_export = radeon_gem_prime_export,
.gem_prime_pin = radeon_gem_prime_pin,
.gem_prime_unpin = radeon_gem_prime_unpin,
-   .gem_prime_res_obj = radeon_gem_prime_res_obj,
.gem_prime_get_sg_table = radeon_gem_prime_get_sg_table,
.gem_prime_import_sg_table = radeon_gem_prime_import_sg_table,
.gem_prime_vmap = radeon_gem_prime_vmap,
diff --git a/drivers/gpu/drm/radeon/radeon_object.c 
b/drivers/gpu/drm/radeon/radeon_object.c
index 21f73fc86f38..7a2bad843f8a 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -262,6 +262,7 @@ int radeon_bo_create(struct radeon_device *rdev,
r = ttm_bo_init(>mman.bdev, >tbo, size, type,
>placement, page_align, !kernel, acc_size,
sg, resv, _ttm_bo_destroy);
+   bo->gem_base.resv = bo->tbo.resv;
up_read(>pm.mclk_lock);
if (unlikely(r != 0)) {
return r;
diff --git a/drivers/gpu/drm/radeon/radeon_prime.c 
b/drivers/gpu/drm/radeon/radeon_prime.c
index deaffce50a2e..8ce3e8045d42 100644
--- a/drivers/gpu/drm/radeon/radeon_prime.c
+++ b/drivers/gpu/drm/radeon/radeon_prime.c
@@ -117,13 +117,6 @@ void radeon_gem_prime_unpin(struct drm_gem_object *obj)
 }
 
 
-struct reservation_object *radeon_gem_prime_res_obj(struct drm_gem_object *obj)
-{
-   struct radeon_bo *bo = gem_to_radeon_bo(obj);
-
-   return bo->tbo.resv;
-}
-
 struct dma_buf *radeon_gem_prime_export(struct drm_gem_object *gobj,
int flags)
 {
-- 
2.20.1

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

[Intel-gfx] [PATCH 58/59] drm/todo: Add new debugfs todo

2019-06-14 Thread Daniel Vetter
Greg is busy already, but maybe he won't do everything ...

Cc: Greg Kroah-Hartman 
Signed-off-by: Daniel Vetter 
---
 Documentation/gpu/todo.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 9717540ee28f..026e55c517e1 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -375,6 +375,9 @@ There's a bunch of issues with it:
   this (together with the drm_minor->drm_device move) would allow us to remove
   debugfs_init.
 
+- Drop the return code and error checking from all debugfs functions. Greg KH 
is
+  working on this already.
+
 Contact: Daniel Vetter
 
 KMS cleanups
-- 
2.20.1

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

[Intel-gfx] [PATCH 49/59] drm/msm: Use drm_gem_fb_prepare_fb

2019-06-14 Thread Daniel Vetter
msm has switched over to drm_fb->obj[] a while ago already, so we can
just use the helper.

Signed-off-by: Daniel Vetter 
Cc: Rob Clark 
Cc: Sean Paul 
Cc: Jeykumar Sankaran 
Cc: Jordan Crouse 
Cc: Bruce Wang 
Cc: Fritz Koenig 
Cc: Daniel Vetter 
Cc: linux-arm-...@vger.kernel.org
Cc: freedr...@lists.freedesktop.org
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 5 +
 drivers/gpu/drm/msm/msm_atomic.c  | 5 +
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index d831cedb55ec..b10855374a8d 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -792,10 +792,7 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
 *   we can use msm_atomic_prepare_fb() instead of doing the
 *   implicit fence and fb prepare by hand here.
 */
-   obj = msm_framebuffer_bo(new_state->fb, 0);
-   fence = reservation_object_get_excl_rcu(obj->resv);
-   if (fence)
-   drm_atomic_set_fence_for_plane(new_state, fence);
+   drm_gem_fb_prepare_fb(plane, new_state);
 
if (pstate->aspace) {
ret = msm_framebuffer_prepare(new_state->fb,
diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
index 131c23a267ee..e501c6f8d67b 100644
--- a/drivers/gpu/drm/msm/msm_atomic.c
+++ b/drivers/gpu/drm/msm/msm_atomic.c
@@ -54,10 +54,7 @@ int msm_atomic_prepare_fb(struct drm_plane *plane,
if (!new_state->fb)
return 0;
 
-   obj = msm_framebuffer_bo(new_state->fb, 0);
-   fence = reservation_object_get_excl_rcu(obj->resv);
-
-   drm_atomic_set_fence_for_plane(new_state, fence);
+   drm_gem_fb_prepare_fb(plane, new_state);
 
return msm_framebuffer_prepare(new_state->fb, kms->aspace);
 }
-- 
2.20.1

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

[Intel-gfx] [PATCH 47/59] drm/vc4: Don set gem_obj->resv in prime import anymore

2019-06-14 Thread Daniel Vetter
This is done in drm_prime.c now.

Signed-off-by: Daniel Vetter 
Cc: Eric Anholt 
---
 drivers/gpu/drm/vc4/vc4_bo.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index b0f9eb6632a2..707bcd9927f3 100644
--- a/drivers/gpu/drm/vc4/vc4_bo.c
+++ b/drivers/gpu/drm/vc4/vc4_bo.c
@@ -793,8 +793,6 @@ vc4_prime_import_sg_table(struct drm_device *dev,
if (IS_ERR(obj))
return obj;
 
-   obj->resv = attach->dmabuf->resv;
-
return obj;
 }
 
-- 
2.20.1

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

[Intel-gfx] [PATCH 50/59] drm/vc4: Use drm_gem_fb_prepare_fb

2019-06-14 Thread Daniel Vetter
vc4 has switched to using drm_fb->obj[], so we can just use the helper
unchanged.

Signed-off-by: Daniel Vetter 
Cc: Eric Anholt 
---
 drivers/gpu/drm/vc4/vc4_plane.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 441e06d45c89..f59f8c404d80 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -1132,10 +1132,7 @@ static int vc4_prepare_fb(struct drm_plane *plane,
if (!state->fb)
return 0;
 
-   bo = to_vc4_bo(_fb_cma_get_gem_obj(state->fb, 0)->base);
-
-   fence = reservation_object_get_excl_rcu(bo->base.base.resv);
-   drm_atomic_set_fence_for_plane(state, fence);
+   drm_gem_fb_prepare_fb(plane, state);
 
if (plane->state->fb == state->fb)
return 0;
-- 
2.20.1

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

[Intel-gfx] [PATCH 42/59] drm/etnaviv: Drop resv argument from etnaviv_gem_new_impl

2019-06-14 Thread Daniel Vetter
Only user was the prime import, and drm_prime.c takes care of that
now.

Signed-off-by: Daniel Vetter 
Cc: Lucas Stach 
Cc: Russell King 
Cc: Christian Gmeiner 
Cc: etna...@lists.freedesktop.org
---
 drivers/gpu/drm/etnaviv/etnaviv_gem.c   | 14 +-
 drivers/gpu/drm/etnaviv/etnaviv_gem.h   |  3 +--
 drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c |  1 -
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index e8778ebb72e6..17ca602db60a 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -565,8 +565,7 @@ void etnaviv_gem_obj_add(struct drm_device *dev, struct 
drm_gem_object *obj)
 }
 
 static int etnaviv_gem_new_impl(struct drm_device *dev, u32 size, u32 flags,
-   struct reservation_object *robj, const struct etnaviv_gem_ops *ops,
-   struct drm_gem_object **obj)
+   const struct etnaviv_gem_ops *ops, struct drm_gem_object **obj)
 {
struct etnaviv_gem_object *etnaviv_obj;
unsigned sz = sizeof(*etnaviv_obj);
@@ -594,8 +593,6 @@ static int etnaviv_gem_new_impl(struct drm_device *dev, u32 
size, u32 flags,
 
etnaviv_obj->flags = flags;
etnaviv_obj->ops = ops;
-   if (robj)
-   etnaviv_obj->base.resv = robj;
 
mutex_init(_obj->lock);
INIT_LIST_HEAD(_obj->vram_list);
@@ -614,7 +611,7 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct 
drm_file *file,
 
size = PAGE_ALIGN(size);
 
-   ret = etnaviv_gem_new_impl(dev, size, flags, NULL,
+   ret = etnaviv_gem_new_impl(dev, size, flags,
   _gem_shmem_ops, );
if (ret)
goto fail;
@@ -646,13 +643,12 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct 
drm_file *file,
 }
 
 int etnaviv_gem_new_private(struct drm_device *dev, size_t size, u32 flags,
-   struct reservation_object *robj, const struct etnaviv_gem_ops *ops,
-   struct etnaviv_gem_object **res)
+   const struct etnaviv_gem_ops *ops, struct etnaviv_gem_object **res)
 {
struct drm_gem_object *obj;
int ret;
 
-   ret = etnaviv_gem_new_impl(dev, size, flags, robj, ops, );
+   ret = etnaviv_gem_new_impl(dev, size, flags, ops, );
if (ret)
return ret;
 
@@ -734,7 +730,7 @@ int etnaviv_gem_new_userptr(struct drm_device *dev, struct 
drm_file *file,
struct etnaviv_gem_object *etnaviv_obj;
int ret;
 
-   ret = etnaviv_gem_new_private(dev, size, ETNA_BO_CACHED, NULL,
+   ret = etnaviv_gem_new_private(dev, size, ETNA_BO_CACHED,
  _gem_userptr_ops, _obj);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.h 
b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
index 753c458497d0..fcd5d71b502f 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
@@ -112,8 +112,7 @@ void etnaviv_submit_put(struct etnaviv_gem_submit * submit);
 int etnaviv_gem_wait_bo(struct etnaviv_gpu *gpu, struct drm_gem_object *obj,
struct timespec *timeout);
 int etnaviv_gem_new_private(struct drm_device *dev, size_t size, u32 flags,
-   struct reservation_object *robj, const struct etnaviv_gem_ops *ops,
-   struct etnaviv_gem_object **res);
+   const struct etnaviv_gem_ops *ops, struct etnaviv_gem_object **res);
 void etnaviv_gem_obj_add(struct drm_device *dev, struct drm_gem_object *obj);
 struct page **etnaviv_gem_get_pages(struct etnaviv_gem_object *obj);
 void etnaviv_gem_put_pages(struct etnaviv_gem_object *obj);
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
index 00e8b6a817e3..a05292e8ed6f 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
@@ -109,7 +109,6 @@ struct drm_gem_object 
*etnaviv_gem_prime_import_sg_table(struct drm_device *dev,
int ret, npages;
 
ret = etnaviv_gem_new_private(dev, size, ETNA_BO_WC,
- attach->dmabuf->resv,
  _gem_prime_ops, _obj);
if (ret < 0)
return ERR_PTR(ret);
-- 
2.20.1

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

[Intel-gfx] [PATCH 34/59] drm/vc3: Drop drm_gem_prime_import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/vc4/vc4_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index ed4fe7ed9e64..a295aa91d3c5 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -201,7 +201,6 @@ static struct drm_driver vc4_drm_driver = {
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_export = vc4_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = vc4_prime_import_sg_table,
-- 
2.20.1

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

[Intel-gfx] [PATCH 32/59] drm/tve2000: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Linus Walleij 
---
 drivers/gpu/drm/tve200/tve200_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/tve200/tve200_drv.c 
b/drivers/gpu/drm/tve200/tve200_drv.c
index a1f614e21fcc..830a5af25ac4 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -152,8 +152,6 @@ static struct drm_driver tve200_drm_driver = {
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import = drm_gem_prime_import,
-   .gem_prime_export = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 46/59] drm/panfrost: don't set gem_obj->resv for prime import anymore

2019-06-14 Thread Daniel Vetter
This is now done in drm_prime.c

Signed-off-by: Daniel Vetter 
Cc: Rob Herring 
Cc: Tomeu Vizoso 
---
 drivers/gpu/drm/panfrost/panfrost_gem.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c 
b/drivers/gpu/drm/panfrost/panfrost_gem.c
index 886875ae31d3..590d378fab1b 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gem.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gem.c
@@ -91,8 +91,6 @@ panfrost_gem_prime_import_sg_table(struct drm_device *dev,
 
pobj = to_panfrost_bo(obj);
 
-   obj->resv = attach->dmabuf->resv;
-
panfrost_mmu_map(pobj);
 
return obj;
-- 
2.20.1

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

[Intel-gfx] [PATCH 31/59] drm/tilcdc: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

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

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 92307959435a..b6b71e86e238 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -521,8 +521,6 @@ static struct drm_driver tilcdc_driver = {
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import   = drm_gem_prime_import,
-   .gem_prime_export   = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 44/59] drm/mediatek: Use drm_atomic_helper_wait_for_fences

2019-06-14 Thread Daniel Vetter
If we use the gem fb helper as the prepare_fb hook, plus the
drm_prime.c import helpers now automatically setting obj->resv, we can
use the shared helpers to wait for fences instead of rolling our own.
Note that this relies on mtk setting drm_fb->obj, which is already
done in mtk_drm_framebuffer_init().

Aside: Probably can use the default commit_tail with this again, but I
didn't check for that.

Signed-off-by: Daniel Vetter 
Cc: CK Hu 
Cc: Philipp Zabel 
Cc: Matthias Brugger 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-media...@lists.infradead.org
---
 drivers/gpu/drm/mediatek/mtk_drm_drv.c   | 12 +-
 drivers/gpu/drm/mediatek/mtk_drm_fb.c| 28 
 drivers/gpu/drm/mediatek/mtk_drm_fb.h|  1 -
 drivers/gpu/drm/mediatek/mtk_drm_plane.c |  2 ++
 4 files changed, 3 insertions(+), 40 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c 
b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index dd8dab562500..2d5caf532431 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -38,22 +38,12 @@ static void mtk_atomic_schedule(struct mtk_drm_private 
*private,
schedule_work(>commit.work);
 }
 
-static void mtk_atomic_wait_for_fences(struct drm_atomic_state *state)
-{
-   struct drm_plane *plane;
-   struct drm_plane_state *new_plane_state;
-   int i;
-
-   for_each_new_plane_in_state(state, plane, new_plane_state, i)
-   mtk_fb_wait(new_plane_state->fb);
-}
-
 static void mtk_atomic_complete(struct mtk_drm_private *private,
struct drm_atomic_state *state)
 {
struct drm_device *drm = private->drm;
 
-   mtk_atomic_wait_for_fences(state);
+   drm_atomic_helper_wait_for_fences(drm, state, false);
 
/*
 * Mediatek drm supports runtime PM, so plane registers cannot be
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_fb.c 
b/drivers/gpu/drm/mediatek/mtk_drm_fb.c
index 4c3ad7de2d3b..396ba497986d 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_fb.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_fb.c
@@ -49,34 +49,6 @@ static struct drm_framebuffer 
*mtk_drm_framebuffer_init(struct drm_device *dev,
return fb;
 }
 
-/*
- * Wait for any exclusive fence in fb's gem object's reservation object.
- *
- * Returns -ERESTARTSYS if interrupted, else 0.
- */
-int mtk_fb_wait(struct drm_framebuffer *fb)
-{
-   struct drm_gem_object *gem;
-   struct reservation_object *resv;
-   long ret;
-
-   if (!fb)
-   return 0;
-
-   gem = fb->obj[0];
-   if (!gem || !gem->dma_buf || !gem->dma_buf->resv)
-   return 0;
-
-   resv = gem->dma_buf->resv;
-   ret = reservation_object_wait_timeout_rcu(resv, false, true,
- MAX_SCHEDULE_TIMEOUT);
-   /* MAX_SCHEDULE_TIMEOUT on success, -ERESTARTSYS if interrupted */
-   if (WARN_ON(ret < 0))
-   return ret;
-
-   return 0;
-}
-
 struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev,
   struct drm_file *file,
   const struct drm_mode_fb_cmd2 
*cmd)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_fb.h 
b/drivers/gpu/drm/mediatek/mtk_drm_fb.h
index 6b80c28e33cf..eb64d26001c6 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_fb.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_fb.h
@@ -6,7 +6,6 @@
 #ifndef MTK_DRM_FB_H
 #define MTK_DRM_FB_H
 
-int mtk_fb_wait(struct drm_framebuffer *fb);
 struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev,
   struct drm_file *file,
   const struct drm_mode_fb_cmd2 
*cmd);
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c 
b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
index f2ef83aed6f9..42cc9823eaaa 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mtk_drm_crtc.h"
 #include "mtk_drm_ddp_comp.h"
@@ -146,6 +147,7 @@ static void mtk_plane_atomic_disable(struct drm_plane 
*plane,
 }
 
 static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = {
+   .prepare_fb = drm_gem_fb_prepare_fb,
.atomic_check = mtk_plane_atomic_check,
.atomic_update = mtk_plane_atomic_update,
.atomic_disable = mtk_plane_atomic_disable,
-- 
2.20.1

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

[Intel-gfx] [PATCH 36/59] drm/vgem: Drop drm_gem_prime_export

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/vgem/vgem_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 68c340cfde51..d5ab6e46c242 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -445,7 +445,6 @@ static struct drm_driver vgem_driver = {
.gem_prime_pin = vgem_prime_pin,
.gem_prime_unpin = vgem_prime_unpin,
.gem_prime_import = vgem_prime_import,
-   .gem_prime_export = drm_gem_prime_export,
.gem_prime_import_sg_table = vgem_prime_import_sg_table,
.gem_prime_get_sg_table = vgem_prime_get_sg_table,
.gem_prime_vmap = vgem_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 41/59] drm/prime: automatically set gem_obj->resv on import

2019-06-14 Thread Daniel Vetter
It's really the only reasonable thing to do, and it won't hurt drivers
which don't (yet) use drm_gem_object->resv.

Signed-off-by: Daniel Vetter 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/drm_prime.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index d545e681cb41..58d595f4a4f5 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -896,6 +896,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct 
drm_device *dev,
}
 
obj->import_attach = attach;
+   obj->resv = dma_buf->resv;
 
return obj;
 
-- 
2.20.1

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

[Intel-gfx] [PATCH 40/59] drm/vram-helper: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Thomas Zimmermann 
Cc: Gerd Hoffmann 
---
 include/drm/drm_gem_vram_helper.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/drm/drm_gem_vram_helper.h 
b/include/drm/drm_gem_vram_helper.h
index 9581ea0a4f7e..1a0ea18e7a74 100644
--- a/include/drm/drm_gem_vram_helper.h
+++ b/include/drm/drm_gem_vram_helper.h
@@ -142,8 +142,6 @@ int drm_gem_vram_driver_gem_prime_mmap(struct 
drm_gem_object *obj,
   struct vm_area_struct *vma);
 
 #define DRM_GEM_VRAM_DRIVER_PRIME \
-   .gem_prime_export = drm_gem_prime_export, \
-   .gem_prime_import = drm_gem_prime_import, \
.gem_prime_pin= drm_gem_vram_driver_gem_prime_pin, \
.gem_prime_unpin  = drm_gem_vram_driver_gem_prime_unpin, \
.gem_prime_vmap   = drm_gem_vram_driver_gem_prime_vmap, \
-- 
2.20.1

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

[Intel-gfx] [PATCH 19/59] drm/mtk: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: CK Hu 
Cc: Philipp Zabel 
Cc: Matthias Brugger 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-media...@lists.infradead.org
---
 drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c 
b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 1f8b8943b0c6..dd8dab562500 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -329,8 +329,6 @@ static struct drm_driver mtk_drm_driver = {
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_get_sg_table = mtk_gem_prime_get_sg_table,
.gem_prime_import_sg_table = mtk_gem_prime_import_sg_table,
.gem_prime_mmap = mtk_drm_gem_mmap_buf,
-- 
2.20.1

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

[Intel-gfx] [PATCH 39/59] drm/zte: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Shawn Guo 
---
 drivers/gpu/drm/zte/zx_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
index 060ad5266bc7..ef019cad7e81 100644
--- a/drivers/gpu/drm/zte/zx_drm_drv.c
+++ b/drivers/gpu/drm/zte/zx_drm_drv.c
@@ -44,8 +44,6 @@ static struct drm_driver zx_drm_driver = {
.dumb_create = drm_gem_cma_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 35/59] drm/radeon: Drop drm_gem_prime_import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/radeon/radeon_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index 4a6acaa3f843..4403e76e1ae0 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -564,7 +564,6 @@ static struct drm_driver kms_driver = {
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export = radeon_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_pin = radeon_gem_prime_pin,
.gem_prime_unpin = radeon_gem_prime_unpin,
.gem_prime_res_obj = radeon_gem_prime_res_obj,
-- 
2.20.1

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

[Intel-gfx] [PATCH 27/59] drm/rockchip: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Sandy Huang 
Cc: "Heiko Stübner" 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-rockc...@lists.infradead.org
---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 59091b6241ec..782979f1b55a 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -219,8 +219,6 @@ static struct drm_driver rockchip_drm_driver = {
.dumb_create= rockchip_gem_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import   = drm_gem_prime_import,
-   .gem_prime_export   = drm_gem_prime_export,
.gem_prime_get_sg_table = rockchip_gem_prime_get_sg_table,
.gem_prime_import_sg_table  = rockchip_gem_prime_import_sg_table,
.gem_prime_vmap = rockchip_gem_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 43/59] drm/lima: Drop resv argument from lima_bo_create_struct

2019-06-14 Thread Daniel Vetter
It was only used for prime import, which is now handled by
drm_prime.c.

Signed-off-by: Daniel Vetter 
Cc: Qiang Yu 
Cc: l...@lists.freedesktop.org
---
 drivers/gpu/drm/lima/lima_gem.c   | 2 +-
 drivers/gpu/drm/lima/lima_gem_prime.c | 3 +--
 drivers/gpu/drm/lima/lima_object.c| 9 +++--
 drivers/gpu/drm/lima/lima_object.h| 3 +--
 4 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c
index 477c0f73..fd1a024703d2 100644
--- a/drivers/gpu/drm/lima/lima_gem.c
+++ b/drivers/gpu/drm/lima/lima_gem.c
@@ -24,7 +24,7 @@ int lima_gem_create_handle(struct drm_device *dev, struct 
drm_file *file,
struct lima_bo *bo;
struct lima_device *ldev = to_lima_dev(dev);
 
-   bo = lima_bo_create(ldev, size, flags, NULL, NULL);
+   bo = lima_bo_create(ldev, size, flags, NULL);
if (IS_ERR(bo))
return PTR_ERR(bo);
 
diff --git a/drivers/gpu/drm/lima/lima_gem_prime.c 
b/drivers/gpu/drm/lima/lima_gem_prime.c
index 9c6d9f1dba55..e3eb251e0a12 100644
--- a/drivers/gpu/drm/lima/lima_gem_prime.c
+++ b/drivers/gpu/drm/lima/lima_gem_prime.c
@@ -18,8 +18,7 @@ struct drm_gem_object *lima_gem_prime_import_sg_table(
struct lima_device *ldev = to_lima_dev(dev);
struct lima_bo *bo;
 
-   bo = lima_bo_create(ldev, attach->dmabuf->size, 0, sgt,
-   attach->dmabuf->resv);
+   bo = lima_bo_create(ldev, attach->dmabuf->size, 0, sgt);
if (IS_ERR(bo))
return ERR_CAST(bo);
 
diff --git a/drivers/gpu/drm/lima/lima_object.c 
b/drivers/gpu/drm/lima/lima_object.c
index 5c41f859a72f..87123b1d083c 100644
--- a/drivers/gpu/drm/lima/lima_object.c
+++ b/drivers/gpu/drm/lima/lima_object.c
@@ -33,8 +33,7 @@ void lima_bo_destroy(struct lima_bo *bo)
kfree(bo);
 }
 
-static struct lima_bo *lima_bo_create_struct(struct lima_device *dev, u32 
size, u32 flags,
-struct reservation_object *resv)
+static struct lima_bo *lima_bo_create_struct(struct lima_device *dev, u32 
size, u32 flags)
 {
struct lima_bo *bo;
int err;
@@ -47,7 +46,6 @@ static struct lima_bo *lima_bo_create_struct(struct 
lima_device *dev, u32 size,
 
mutex_init(>lock);
INIT_LIST_HEAD(>va);
-   bo->gem.resv = resv;
 
err = drm_gem_object_init(dev->ddev, >gem, size);
if (err) {
@@ -59,14 +57,13 @@ static struct lima_bo *lima_bo_create_struct(struct 
lima_device *dev, u32 size,
 }
 
 struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
-  u32 flags, struct sg_table *sgt,
-  struct reservation_object *resv)
+  u32 flags, struct sg_table *sgt)
 {
int i, err;
size_t npages;
struct lima_bo *bo, *ret;
 
-   bo = lima_bo_create_struct(dev, size, flags, resv);
+   bo = lima_bo_create_struct(dev, size, flags);
if (IS_ERR(bo))
return bo;
 
diff --git a/drivers/gpu/drm/lima/lima_object.h 
b/drivers/gpu/drm/lima/lima_object.h
index 6738724afb7b..31ca2d8dc0a1 100644
--- a/drivers/gpu/drm/lima/lima_object.h
+++ b/drivers/gpu/drm/lima/lima_object.h
@@ -27,8 +27,7 @@ to_lima_bo(struct drm_gem_object *obj)
 }
 
 struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
-  u32 flags, struct sg_table *sgt,
-  struct reservation_object *resv);
+  u32 flags, struct sg_table *sgt);
 void lima_bo_destroy(struct lima_bo *bo);
 void *lima_bo_vmap(struct lima_bo *bo);
 void lima_bo_vunmap(struct lima_bo *bo);
-- 
2.20.1

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

[Intel-gfx] [PATCH 29/59] drm/sti: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Benjamin Gaignard 
Cc: Vincent Abriou 
---
 drivers/gpu/drm/sti/sti_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index d9f63c9f287b..faea4dcb21b1 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -152,8 +152,6 @@ static struct drm_driver sti_driver = {
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 22/59] drm/mxsfb: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Marek Vasut 
Cc: Stefan Agner 
Cc: Shawn Guo 
Cc: Sascha Hauer 
Cc: Pengutronix Kernel Team 
Cc: Fabio Estevam 
Cc: NXP Linux Team 
Cc: linux-arm-ker...@lists.infradead.org
---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c 
b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index b5bcaf4036bd..6d6a0b3e2bb0 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -322,8 +322,6 @@ static struct drm_driver mxsfb_driver = {
.dumb_create= drm_gem_cma_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export   = drm_gem_prime_export,
-   .gem_prime_import   = drm_gem_prime_import,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 38/59] drm/xen: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Oleksandr Andrushchenko 
Cc: xen-de...@lists.xenproject.org
---
 drivers/gpu/drm/xen/xen_drm_front.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/xen/xen_drm_front.c 
b/drivers/gpu/drm/xen/xen_drm_front.c
index aeffec82a5ce..051822ee5b36 100644
--- a/drivers/gpu/drm/xen/xen_drm_front.c
+++ b/drivers/gpu/drm/xen/xen_drm_front.c
@@ -491,8 +491,6 @@ static struct drm_driver xen_drm_driver = {
.gem_free_object_unlocked  = xen_drm_drv_free_object_unlocked,
.prime_handle_to_fd= drm_gem_prime_handle_to_fd,
.prime_fd_to_handle= drm_gem_prime_fd_to_handle,
-   .gem_prime_import  = drm_gem_prime_import,
-   .gem_prime_export  = drm_gem_prime_export,
.gem_prime_import_sg_table = xen_drm_front_gem_import_sg_table,
.gem_prime_get_sg_table= xen_drm_front_gem_get_sg_table,
.gem_prime_vmap= xen_drm_front_gem_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 30/59] drm/stm: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Yannick Fertre 
Cc: Philippe Cornu 
Cc: Benjamin Gaignard 
Cc: Vincent Abriou 
Cc: Maxime Coquelin 
Cc: Alexandre Torgue 
Cc: linux-st...@st-md-mailman.stormreply.com
Cc: linux-arm-ker...@lists.infradead.org
---
 drivers/gpu/drm/stm/drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 4026c33ccc39..331f5e8d779b 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -67,8 +67,6 @@ static struct drm_driver drv_driver = {
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 33/59] drm/vboxvideo: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

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

diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c 
b/drivers/gpu/drm/vboxvideo/vbox_drv.c
index a7fd194c81a9..fa5e3149124d 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_drv.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c
@@ -212,8 +212,6 @@ static struct drm_driver driver = {
DRM_GEM_VRAM_DRIVER,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_pin = vbox_gem_prime_pin,
.gem_prime_unpin = vbox_gem_prime_unpin,
.gem_prime_get_sg_table = vbox_gem_prime_get_sg_table,
-- 
2.20.1

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

[Intel-gfx] [PATCH 37/59] drm/virtio: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: David Airlie 
Cc: Gerd Hoffmann 
Cc: virtualizat...@lists.linux-foundation.org
---
 drivers/gpu/drm/virtio/virtgpu_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c 
b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 0afdf51fdcfd..99bcd290f1fb 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -207,8 +207,6 @@ static struct drm_driver driver = {
 #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_get_sg_table = virtgpu_gem_prime_get_sg_table,
.gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table,
.gem_prime_vmap = virtgpu_gem_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 28/59] drm/shmob: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Laurent Pinchart 
Cc: Kieran Bingham 
Cc: linux-renesas-...@vger.kernel.org
---
 drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c 
b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index 9047a49ff35e..6c106b7a3bfe 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -133,8 +133,6 @@ static struct drm_driver shmob_drm_driver = {
.gem_vm_ops = _gem_cma_vm_ops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import   = drm_gem_prime_import,
-   .gem_prime_export   = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 21/59] drm/msm: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Rob Clark 
Cc: Sean Paul 
Cc: linux-arm-...@vger.kernel.org
Cc: freedr...@lists.freedesktop.org
---
 drivers/gpu/drm/msm/msm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 87f92d3906ab..da5a88413964 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -1034,8 +1034,6 @@ static struct drm_driver msm_driver = {
.dumb_map_offset= msm_gem_dumb_map_offset,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export   = drm_gem_prime_export,
-   .gem_prime_import   = drm_gem_prime_import,
.gem_prime_pin  = msm_gem_prime_pin,
.gem_prime_unpin= msm_gem_prime_unpin,
.gem_prime_get_sg_table = msm_gem_prime_get_sg_table,
-- 
2.20.1

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

[Intel-gfx] [PATCH 17/59] drm/imx: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Philipp Zabel 
Cc: Shawn Guo 
Cc: Sascha Hauer 
Cc: Pengutronix Kernel Team 
Cc: Fabio Estevam 
Cc: NXP Linux Team 
Cc: linux-arm-ker...@lists.infradead.org
---
 drivers/gpu/drm/imx/imx-drm-core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
b/drivers/gpu/drm/imx/imx-drm-core.c
index 384db6d86da0..bdefaa1635eb 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -154,8 +154,6 @@ static struct drm_driver imx_drm_driver = {
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import   = drm_gem_prime_import,
-   .gem_prime_export   = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 24/59] drm/pl111: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Eric Anholt 
---
 drivers/gpu/drm/pl111/pl111_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/pl111/pl111_drv.c 
b/drivers/gpu/drm/pl111/pl111_drv.c
index dd4aaa380250..90fa99a7dfa9 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -238,9 +238,7 @@ static struct drm_driver pl111_drm_driver = {
.gem_vm_ops = _gem_cma_vm_ops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_import_sg_table = pl111_gem_import_sg_table,
-   .gem_prime_export = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_mmap = drm_gem_cma_prime_mmap,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 26/59] drm/rcar-du: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Laurent Pinchart 
Cc: Kieran Bingham 
Cc: linux-renesas-...@vger.kernel.org
---
 drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c 
b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index 83685250319d..9c93eb4fad8b 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -446,8 +446,6 @@ static struct drm_driver rcar_du_driver = {
.gem_vm_ops = _gem_cma_vm_ops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import   = drm_gem_prime_import,
-   .gem_prime_export   = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 15/59] drm/fsl-dcu: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Stefan Agner 
Cc: Alison Wang 
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c 
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index d18ff729d7f6..661725d8f7dc 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -143,8 +143,6 @@ static struct drm_driver fsl_dcu_drm_driver = {
.gem_vm_ops = _gem_cma_vm_ops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import   = drm_gem_prime_import,
-   .gem_prime_export   = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 13/59] drm/etnaviv: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Lucas Stach 
Cc: Russell King 
Cc: Christian Gmeiner 
Cc: etna...@lists.freedesktop.org
---
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index db3b00031fcf..400fbb2588f1 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -469,8 +469,6 @@ static struct drm_driver etnaviv_drm_driver = {
.gem_vm_ops = _ops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export   = drm_gem_prime_export,
-   .gem_prime_import   = drm_gem_prime_import,
.gem_prime_pin  = etnaviv_gem_prime_pin,
.gem_prime_unpin= etnaviv_gem_prime_unpin,
.gem_prime_get_sg_table = etnaviv_gem_prime_get_sg_table,
-- 
2.20.1

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

[Intel-gfx] [PATCH 25/59] drm/qxl: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

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 | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index 61e1ce16fc25..d8f64886474b 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -256,8 +256,6 @@ static struct drm_driver qxl_driver = {
 #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_pin = qxl_gem_prime_pin,
.gem_prime_unpin = qxl_gem_prime_unpin,
.gem_prime_get_sg_table = qxl_gem_prime_get_sg_table,
-- 
2.20.1

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

[Intel-gfx] [PATCH 20/59] drm/meson: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Neil Armstrong 
Cc: Kevin Hilman 
Cc: linux-amlo...@lists.infradead.org
Cc: linux-arm-ker...@lists.infradead.org
---
 drivers/gpu/drm/meson/meson_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/meson/meson_drv.c 
b/drivers/gpu/drm/meson/meson_drv.c
index 140363f93575..37dca83d6eb1 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -101,8 +101,6 @@ static struct drm_driver meson_driver = {
/* PRIME Ops */
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import   = drm_gem_prime_import,
-   .gem_prime_export   = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

Re: [Intel-gfx] [PATCH v5] docs: power: convert docs to ReST and rename to *.rst

2019-06-14 Thread Jonathan Corbet
On Thu, 13 Jun 2019 07:10:36 -0300
Mauro Carvalho Chehab  wrote:

> Convert the PM documents to ReST, in order to allow them to
> build with Sphinx.
> 
> The conversion is actually:
>   - add blank lines and identation in order to identify paragraphs;
>   - fix tables markups;
>   - add some lists markups;
>   - mark literal blocks;
>   - adjust title markups.
> 
> At its new index.rst, let's add a :orphan: while this is not linked to
> the main index.rst file, in order to avoid build warnings.
> 
> Signed-off-by: Mauro Carvalho Chehab 
> Acked-by: Mark Brown 
> Acked-by: Bjorn Helgaas 
> Acked-by: Srivatsa S. Bhat (VMware) 

So I can't apply this one due to conflicts in include/linux/pci.h.  Bjorn,
perhaps the easiest thing is for you to take this one through your tree?

Thanks,

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

[Intel-gfx] [PATCH 23/59] drm/nouveau: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Ben Skeggs 
Cc: nouv...@lists.freedesktop.org
---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c 
b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 8cb174f95448..4377b836265f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -1130,8 +1130,6 @@ driver_stub = {
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_pin = nouveau_gem_prime_pin,
.gem_prime_res_obj = nouveau_gem_prime_res_obj,
.gem_prime_unpin = nouveau_gem_prime_unpin,
-- 
2.20.1

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

[Intel-gfx] [PATCH 09/59] drm/prime: Align gem_prime_export with obj_funcs.export

2019-06-14 Thread Daniel Vetter
The idea is that gem_prime_export is deprecated in favor of
obj_funcs.export. That's much easier to do if both have matching
function signatures.

Signed-off-by: Daniel Vetter 
Cc: Russell King 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Zhenyu Wang 
Cc: Zhi Wang 
Cc: Jani Nikula 
Cc: Joonas Lahtinen 
Cc: Rodrigo Vivi 
Cc: Tomi Valkeinen 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: Thierry Reding 
Cc: Jonathan Hunter 
Cc: Dave Airlie 
Cc: Eric Anholt 
Cc: "Michel Dänzer" 
Cc: Chris Wilson 
Cc: Huang Rui 
Cc: Felix Kuehling 
Cc: Hawking Zhang 
Cc: Feifei Xu 
Cc: Jim Qu 
Cc: Evan Quan 
Cc: Matthew Auld 
Cc: Mika Kuoppala 
Cc: Thomas Zimmermann 
Cc: Kate Stewart 
Cc: Sumit Semwal 
Cc: Jilayne Lovejoy 
Cc: Thomas Gleixner 
Cc: Mikulas Patocka 
Cc: Greg Kroah-Hartman 
Cc: Junwei Zhang 
Cc: intel-gvt-...@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: amd-...@lists.freedesktop.org
Cc: linux-te...@vger.kernel.org
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c  | 7 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h  | 3 +--
 drivers/gpu/drm/armada/armada_gem.c  | 5 ++---
 drivers/gpu/drm/armada/armada_gem.h  | 3 +--
 drivers/gpu/drm/drm_prime.c  | 9 -
 drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c   | 5 ++---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 8 
 drivers/gpu/drm/i915/gvt/dmabuf.c| 2 +-
 drivers/gpu/drm/i915/i915_drv.h  | 3 +--
 drivers/gpu/drm/omapdrm/omap_gem.h   | 3 +--
 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c| 5 ++---
 drivers/gpu/drm/radeon/radeon_drv.c  | 3 +--
 drivers/gpu/drm/radeon/radeon_prime.c| 5 ++---
 drivers/gpu/drm/tegra/gem.c  | 7 +++
 drivers/gpu/drm/tegra/gem.h  | 3 +--
 drivers/gpu/drm/udl/udl_dmabuf.c | 5 ++---
 drivers/gpu/drm/udl/udl_drv.h| 3 +--
 drivers/gpu/drm/vc4/vc4_bo.c | 5 ++---
 drivers/gpu/drm/vc4/vc4_drv.h| 3 +--
 drivers/gpu/drm/vgem/vgem_fence.c| 2 +-
 include/drm/drm_drv.h| 4 ++--
 include/drm/drm_prime.h  | 3 +--
 22 files changed, 39 insertions(+), 57 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
index 489041df1f45..4809d4a5d72a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
@@ -345,8 +345,7 @@ const struct dma_buf_ops amdgpu_dmabuf_ops = {
  * Returns:
  * Shared DMA buffer representing the GEM BO from the given device.
  */
-struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev,
-   struct drm_gem_object *gobj,
+struct dma_buf *amdgpu_gem_prime_export(struct drm_gem_object *gobj,
int flags)
 {
struct amdgpu_bo *bo = gem_to_amdgpu_bo(gobj);
@@ -356,9 +355,9 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_device 
*dev,
bo->flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID)
return ERR_PTR(-EPERM);
 
-   buf = drm_gem_prime_export(dev, gobj, flags);
+   buf = drm_gem_prime_export(gobj, flags);
if (!IS_ERR(buf)) {
-   buf->file->f_mapping = dev->anon_inode->i_mapping;
+   buf->file->f_mapping = gobj->dev->anon_inode->i_mapping;
buf->ops = _dmabuf_ops;
}
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h
index c7056cbe8685..7f73a4f94204 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h
@@ -30,8 +30,7 @@ struct drm_gem_object *
 amdgpu_gem_prime_import_sg_table(struct drm_device *dev,
 struct dma_buf_attachment *attach,
 struct sg_table *sg);
-struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev,
-   struct drm_gem_object *gobj,
+struct dma_buf *amdgpu_gem_prime_export(struct drm_gem_object *gobj,
int flags);
 struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev,
struct dma_buf *dma_buf);
diff --git a/drivers/gpu/drm/armada/armada_gem.c 
b/drivers/gpu/drm/armada/armada_gem.c
index 642d0e70d0f8..7e7fcc3f1f7f 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -485,8 +485,7 @@ static const struct dma_buf_ops armada_gem_prime_dmabuf_ops 
= {
 };
 
 struct dma_buf *
-armada_gem_prime_export(struct drm_device *dev, struct drm_gem_object *obj,
-   int flags)

[Intel-gfx] [PATCH 11/59] drm/arm: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: "James (Qian) Wang" 
Cc: Liviu Dudau 
Cc: Brian Starkey 
---
 drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 2 --
 drivers/gpu/drm/arm/hdlcd_drv.c | 2 --
 drivers/gpu/drm/arm/malidp_drv.c| 2 --
 3 files changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c 
b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
index b9d699cc7bbf..45f05bc94487 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
@@ -63,8 +63,6 @@ static struct drm_driver komeda_kms_driver = {
.dumb_create= komeda_gem_cma_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export   = drm_gem_prime_export,
-   .gem_prime_import   = drm_gem_prime_import,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table  = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index b126555895d8..27c46a2838c5 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -240,8 +240,6 @@ static struct drm_driver hdlcd_driver = {
.dumb_create = drm_gem_cma_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index 5dccc7130739..3ecdf1311335 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -574,8 +574,6 @@ static struct drm_driver malidp_driver = {
.dumb_create = malidp_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 16/59] drm/hisilicon: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Sam Ravnborg 
Cc: Daniel Vetter 
Cc: Xinliang Liu 
Cc: "Noralf Trønnes" 
Cc: CK Hu 
Cc: Thomas Zimmermann 
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c 
b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index 73f2b53f32cc..6e95d3b167cc 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -126,8 +126,6 @@ static struct drm_driver kirin_drm_driver = {
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export   = drm_gem_prime_export,
-   .gem_prime_import   = drm_gem_prime_import,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 18/59] drm/mcde: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

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

diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index f731d689d52f..a1917e21d53b 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -254,8 +254,6 @@ static struct drm_driver mcde_drm_driver = {
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import = drm_gem_prime_import,
-   .gem_prime_export = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 10/59] drm/arc: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Alexey Brodkin 
---
 drivers/gpu/drm/arc/arcpgu_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index 74240cc1c300..6b7f791685ec 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -149,8 +149,6 @@ static struct drm_driver arcpgu_drm_driver = {
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_print_info = drm_gem_cma_print_info,
.gem_vm_ops = _gem_cma_vm_ops,
-   .gem_prime_export = drm_gem_prime_export,
-   .gem_prime_import = drm_gem_prime_import,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 12/59] drm/atmel: Drop drm_gem_prime_export/import

2019-06-14 Thread Daniel Vetter
They're the default.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Boris Brezillon 
Cc: Nicolas Ferre 
Cc: Alexandre Belloni 
Cc: Ludovic Desroches 
Cc: linux-arm-ker...@lists.infradead.org
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index 274fdf18cde8..2b794a50e7ab 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -843,8 +843,6 @@ static struct drm_driver atmel_hlcdc_dc_driver = {
.gem_vm_ops = _gem_cma_vm_ops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_import = drm_gem_prime_import,
-   .gem_prime_export = drm_gem_prime_export,
.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
.gem_prime_vmap = drm_gem_cma_prime_vmap,
-- 
2.20.1

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

[Intel-gfx] [PATCH 07/59] drm/arm/komeda: Remove DRIVER_HAVE_IRQ

2019-06-14 Thread Daniel Vetter
Read the docs, komeda is not an old enough driver for this :-)

Signed-off-by: Daniel Vetter 
Cc: "James (Qian) Wang" 
Cc: Liviu Dudau 
---
 drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c 
b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
index 0c6396dc323f..b9d699cc7bbf 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
@@ -55,8 +55,7 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data)
 }
 
 static struct drm_driver komeda_kms_driver = {
-   .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
-  DRIVER_HAVE_IRQ,
+   .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
.lastclose  = drm_fb_helper_lastclose,
.irq_handler= komeda_kms_irq_handler,
.gem_free_object_unlocked   = drm_gem_cma_free_object,
-- 
2.20.1

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

[Intel-gfx] [PATCH 14/59] drm/exynos: Drop drm_gem_prime_export

2019-06-14 Thread Daniel Vetter
They're the default. We can't do the same on the import side, due to
the exynos_drm->dma_dev not necessarily matching the overall drm
device.

Aside: Would be really nice to switch the others over to
drm_gem_object_funcs.

Signed-off-by: Daniel Vetter 
Cc: Inki Dae 
Cc: Joonyoung Shim 
Cc: Seung-Woo Kim 
Cc: Kyungmin Park 
Cc: Kukjin Kim 
Cc: Krzysztof Kozlowski 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-samsung-...@vger.kernel.org
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index e43640fc42d3..4d270390eba2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -124,7 +124,6 @@ static struct drm_driver exynos_drm_driver = {
.dumb_create= exynos_drm_gem_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-   .gem_prime_export   = drm_gem_prime_export,
.gem_prime_import   = exynos_drm_gem_prime_import,
.gem_prime_get_sg_table = exynos_drm_gem_prime_get_sg_table,
.gem_prime_import_sg_table  = exynos_drm_gem_prime_import_sg_table,
-- 
2.20.1

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

[Intel-gfx] [PATCH 08/59] drm/omapdrm: drop fb_debug_enter/leave

2019-06-14 Thread Daniel Vetter
This is a no-op on atomic drivers because with atomic it's simply too
complicated to get all the locking and workers and nonblocking
synchronization correct, from essentially an NMI context. Well, too
complicated = impossible. Also, omapdrm never implemented the
mode_set_base_atomic hook, so I kinda wonder why this was ever added.

Drop the hooks.

Signed-off-by: Daniel Vetter 
Cc: Tomi Valkeinen 
---
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c 
b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index 50aabd854f4d..0dad42e819ba 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -87,8 +87,6 @@ static struct fb_ops omap_fb_ops = {
.fb_setcmap = drm_fb_helper_setcmap,
.fb_blank   = drm_fb_helper_blank,
.fb_pan_display = omap_fbdev_pan_display,
-   .fb_debug_enter = drm_fb_helper_debug_enter,
-   .fb_debug_leave = drm_fb_helper_debug_leave,
.fb_ioctl   = drm_fb_helper_ioctl,
 
.fb_read = drm_fb_helper_sys_read,
-- 
2.20.1

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

[Intel-gfx] [PATCH 04/59] drm/prime: Unconditionally set up the prime file private

2019-06-14 Thread Daniel Vetter
It's tiny, already embedded, and setup/teardown cost is trivial.

Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/drm_file.c | 9 +++--
 drivers/gpu/drm/drm_gem.c  | 3 +--
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 754af25fe255..ea34bc991858 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -147,8 +147,7 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor)
if (drm_core_check_feature(dev, DRIVER_SYNCOBJ))
drm_syncobj_open(file);
 
-   if (drm_core_check_feature(dev, DRIVER_PRIME))
-   drm_prime_init_file_private(>prime);
+   drm_prime_init_file_private(>prime);
 
if (dev->driver->open) {
ret = dev->driver->open(dev, file);
@@ -159,8 +158,7 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor)
return file;
 
 out_prime_destroy:
-   if (drm_core_check_feature(dev, DRIVER_PRIME))
-   drm_prime_destroy_file_private(>prime);
+   drm_prime_destroy_file_private(>prime);
if (drm_core_check_feature(dev, DRIVER_SYNCOBJ))
drm_syncobj_release(file);
if (drm_core_check_feature(dev, DRIVER_GEM))
@@ -253,8 +251,7 @@ void drm_file_free(struct drm_file *file)
if (dev->driver->postclose)
dev->driver->postclose(dev, file);
 
-   if (drm_core_check_feature(dev, DRIVER_PRIME))
-   drm_prime_destroy_file_private(>prime);
+   drm_prime_destroy_file_private(>prime);
 
WARN_ON(!list_empty(>event_list));
 
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index a8c4468f03d9..e6c12c6ec728 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -254,8 +254,7 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
else if (dev->driver->gem_close_object)
dev->driver->gem_close_object(obj, file_priv);
 
-   if (drm_core_check_feature(dev, DRIVER_PRIME))
-   drm_gem_remove_prime_handles(obj, file_priv);
+   drm_gem_remove_prime_handles(obj, file_priv);
drm_vma_node_revoke(>vma_node, file_priv);
 
drm_gem_object_handle_put_unlocked(obj);
-- 
2.20.1

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

[Intel-gfx] [PATCH 03/59] drm/prime: Update docs

2019-06-14 Thread Daniel Vetter
Yes this is a bit a big patch, but since it's essentially a complete
rewrite of all the prime docs I didn't see how to better split it up.

Changes:
- Consistently point to drm_gem_object_funcs as the preferred hooks,
  where applicable.

- Reorder all the functions in drm_prime.[hc] into three groups: core,
  export helpers, import helpers.

- Document all the hooks in _driver that lacked kerneldoc.

- Completely new overview section, which now also includes the cleaned
  up lifetime/reference counting subchapter. I also mentioned the weak
  references in there due to the lookup caches.

- Completely rewritten helper intro section, highlight the
  import/export related functionality.

- Polish for all the functions and more cross references.

I also sprinkled a bunch of todos all over.

Most important: 0 code changes in here. The cleanup motivated by
reading and improving all this will follow later on.

v2: Actually update the prime helper docs. Plus add a few FIXMEs that
I won't address right away in subsequent cleanup patches.

Signed-off-by: Daniel Vetter 
---
 Documentation/gpu/drm-mm.rst |  40 +-
 drivers/gpu/drm/drm_prime.c  | 851 ++-
 include/drm/drm_drv.h| 104 -
 include/drm/drm_gem.h|  18 +-
 include/drm/drm_prime.h  |  42 +-
 5 files changed, 576 insertions(+), 479 deletions(-)

diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst
index c8ebd4f66a6a..b664f054c259 100644
--- a/Documentation/gpu/drm-mm.rst
+++ b/Documentation/gpu/drm-mm.rst
@@ -433,43 +433,11 @@ PRIME is the cross device buffer sharing framework in 
drm, originally
 created for the OPTIMUS range of multi-gpu platforms. To userspace PRIME
 buffers are dma-buf based file descriptors.
 
-Overview and Driver Interface
--
+Overview and Lifetime Rules
+---
 
-Similar to GEM global names, PRIME file descriptors are also used to
-share buffer objects across processes. They offer additional security:
-as file descriptors must be explicitly sent over UNIX domain sockets to
-be shared between applications, they can't be guessed like the globally
-unique GEM names.
-
-Drivers that support the PRIME API must set the DRIVER_PRIME bit in the
-struct :c:type:`struct drm_driver `
-driver_features field, and implement the prime_handle_to_fd and
-prime_fd_to_handle operations.
-
-int (\*prime_handle_to_fd)(struct drm_device \*dev, struct drm_file
-\*file_priv, uint32_t handle, uint32_t flags, int \*prime_fd); int
-(\*prime_fd_to_handle)(struct drm_device \*dev, struct drm_file
-\*file_priv, int prime_fd, uint32_t \*handle); Those two operations
-convert a handle to a PRIME file descriptor and vice versa. Drivers must
-use the kernel dma-buf buffer sharing framework to manage the PRIME file
-descriptors. Similar to the mode setting API PRIME is agnostic to the
-underlying buffer object manager, as long as handles are 32bit unsigned
-integers.
-
-While non-GEM drivers must implement the operations themselves, GEM
-drivers must use the :c:func:`drm_gem_prime_handle_to_fd()` and
-:c:func:`drm_gem_prime_fd_to_handle()` helper functions. Those
-helpers rely on the driver gem_prime_export and gem_prime_import
-operations to create a dma-buf instance from a GEM object (dma-buf
-exporter role) and to create a GEM object from a dma-buf instance
-(dma-buf importer role).
-
-struct dma_buf \* (\*gem_prime_export)(struct drm_device \*dev,
-struct drm_gem_object \*obj, int flags); struct drm_gem_object \*
-(\*gem_prime_import)(struct drm_device \*dev, struct dma_buf
-\*dma_buf); These two operations are mandatory for GEM drivers that
-support PRIME.
+.. kernel-doc:: drivers/gpu/drm/drm_prime.c
+   :doc: overview and lifetime rules
 
 PRIME Helper Functions
 --
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index d0c01318076b..f08159a8b03a 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -38,47 +38,53 @@
 
 #include "drm_internal.h"
 
-/*
- * DMA-BUF/GEM Object references and lifetime overview:
- *
- * On the export the dma_buf holds a reference to the exporting GEM
- * object. It takes this reference in handle_to_fd_ioctl, when it
- * first calls .prime_export and stores the exporting GEM object in
- * the dma_buf priv. This reference needs to be released when the
- * final reference to the _buf itself is dropped and its
- * _buf_ops.release function is called. For GEM-based drivers,
- * the dma_buf should be exported using drm_gem_dmabuf_export() and
- * then released by drm_gem_dmabuf_release().
- *
- * On the import the importing GEM object holds a reference to the
- * dma_buf (which in turn holds a ref to the exporting GEM object).
- * It takes that reference in the fd_to_handle ioctl.
- * It calls dma_buf_get, creates an attachment to it and stores the
- * attachment in the GEM object. When this attachment is destroyed
- * when the imported object is 

[Intel-gfx] [PATCH 06/59] drm/prime: Actually remove DRIVER_PRIME everywhere

2019-06-14 Thread Daniel Vetter
Split out to make the functional changes stick out more.

v2: amdgpu gained DRIVER_SYNCOBJ_TIMELINE.

v3: amdgpu lost DRIVER_SYNCOBJ_TIMELINE.

Signed-off-by: Daniel Vetter 
Cc: amd-...@lists.freedesktop.org
Cc: etna...@lists.freedesktop.org
Cc: freedr...@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: l...@lists.freedesktop.org
Cc: linux-amlo...@lists.infradead.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-arm-...@vger.kernel.org
Cc: linux-asp...@lists.ozlabs.org
Cc: linux-renesas-...@vger.kernel.org
Cc: linux-rockc...@lists.infradead.org
Cc: linux-samsung-...@vger.kernel.org
Cc: linux-st...@st-md-mailman.stormreply.com
Cc: linux-te...@vger.kernel.org
Cc: nouv...@lists.freedesktop.org
Cc: NXP Linux Team 
Cc: spice-de...@lists.freedesktop.org
Cc: virtualizat...@lists.linux-foundation.org
Cc: VMware Graphics 
Cc: xen-de...@lists.xenproject.org
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
 drivers/gpu/drm/arc/arcpgu_drv.c| 3 +--
 drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 2 +-
 drivers/gpu/drm/arm/hdlcd_drv.c | 4 +---
 drivers/gpu/drm/arm/malidp_drv.c| 3 +--
 drivers/gpu/drm/armada/armada_drv.c | 3 +--
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 +--
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c| 4 +---
 drivers/gpu/drm/bochs/bochs_drv.c   | 3 +--
 drivers/gpu/drm/cirrus/cirrus.c | 2 +-
 drivers/gpu/drm/etnaviv/etnaviv_drv.c   | 4 +---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c   | 3 +--
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +--
 drivers/gpu/drm/i915/i915_drv.c | 2 +-
 drivers/gpu/drm/imx/imx-drm-core.c  | 3 +--
 drivers/gpu/drm/lima/lima_drv.c | 2 +-
 drivers/gpu/drm/mcde/mcde_drv.c | 2 +-
 drivers/gpu/drm/mediatek/mtk_drm_drv.c  | 3 +--
 drivers/gpu/drm/meson/meson_drv.c   | 4 +---
 drivers/gpu/drm/msm/msm_drv.c   | 1 -
 drivers/gpu/drm/mxsfb/mxsfb_drv.c   | 3 +--
 drivers/gpu/drm/nouveau/nouveau_drm.c   | 2 +-
 drivers/gpu/drm/omapdrm/omap_drv.c  | 2 +-
 drivers/gpu/drm/panfrost/panfrost_drv.c | 3 +--
 drivers/gpu/drm/pl111/pl111_drv.c   | 2 +-
 drivers/gpu/drm/qxl/qxl_drv.c   | 3 +--
 drivers/gpu/drm/radeon/radeon_drv.c | 2 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c   | 3 +--
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 3 +--
 drivers/gpu/drm/shmobile/shmob_drm_drv.c| 3 +--
 drivers/gpu/drm/sti/sti_drv.c   | 3 +--
 drivers/gpu/drm/stm/drv.c   | 3 +--
 drivers/gpu/drm/sun4i/sun4i_drv.c   | 2 +-
 drivers/gpu/drm/tegra/drm.c | 2 +-
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 +--
 drivers/gpu/drm/tinydrm/hx8357d.c   | 2 +-
 drivers/gpu/drm/tinydrm/ili9225.c   | 3 +--
 drivers/gpu/drm/tinydrm/ili9341.c   | 2 +-
 drivers/gpu/drm/tinydrm/mi0283qt.c  | 3 +--
 drivers/gpu/drm/tinydrm/repaper.c   | 3 +--
 drivers/gpu/drm/tinydrm/st7586.c| 3 +--
 drivers/gpu/drm/tinydrm/st7735r.c   | 3 +--
 drivers/gpu/drm/tve200/tve200_drv.c | 3 +--
 drivers/gpu/drm/udl/udl_drv.c   | 2 +-
 drivers/gpu/drm/v3d/v3d_drv.c   | 1 -
 drivers/gpu/drm/vboxvideo/vbox_drv.c| 2 +-
 drivers/gpu/drm/vc4/vc4_drv.c   | 1 -
 drivers/gpu/drm/vgem/vgem_drv.c | 3 +--
 drivers/gpu/drm/virtio/virtgpu_drv.c| 2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +-
 drivers/gpu/drm/xen/xen_drm_front.c | 3 +--
 drivers/gpu/drm/zte/zx_drm_drv.c| 3 +--
 include/drm/drm_drv.h   | 6 --
 54 files changed, 50 insertions(+), 94 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 0a577a389024..8e1b269351e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1309,7 +1309,7 @@ static struct drm_driver kms_driver = {
.driver_features =
DRIVER_USE_AGP | DRIVER_ATOMIC |
DRIVER_GEM |
-   DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
+   DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
.load = amdgpu_driver_load_kms,
.open = amdgpu_driver_open_kms,
.postclose = amdgpu_driver_postclose_kms,
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index af60c6d7a5f4..74240cc1c300 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -135,8 +135,7 @@ static int arcpgu_debugfs_init(struct drm_minor *minor)
 #endif
 
 static struct drm_driver arcpgu_drm_driver = {
-   

[Intel-gfx] [PATCH 01/59] drm/todo: Improve drm_gem_object funcs todo

2019-06-14 Thread Daniel Vetter
We're kinda going in the wrong direction. Spotted while typing better
gem/prime docs.

Cc: Thomas Zimmermann 
Cc: Gerd Hoffmann 
Cc: Rob Herring 
Cc: Noralf Trønnes 
Signed-off-by: Daniel Vetter 
---
 Documentation/gpu/todo.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index b4a76c2703e5..23583f0e3755 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -228,6 +228,10 @@ struct drm_gem_object_funcs
 GEM objects can now have a function table instead of having the callbacks on 
the
 DRM driver struct. This is now the preferred way and drivers can be moved over.
 
+Unfortunately some of the recently added GEM helpers are going in the wrong
+direction by adding OPS macros that use the old, deprecated hooks. See
+DRM_GEM_CMA_VMAP_DRIVER_OPS, DRM_GEM_SHMEM_DRIVER_OPS, and 
DRM_GEM_VRAM_DRIVER_PRIME.
+
 Use DRM_MODESET_LOCK_ALL_* helpers instead of boilerplate
 -
 
-- 
2.20.1

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

[Intel-gfx] [PATCH 00/59] prime doc polish and ... a few cleanups

2019-06-14 Thread Daniel Vetter
Hi all,

So I figured let's get going and polish the docs for the last part of drm
core/helpers that hasn't yet seen some neat polish last few years. With
the goal to make docs for driver kapi a requirement henceforth - see last
patch. Aside from that final doc patch I also included some todo.rst
updates, bunch of things have progressed quite a bit.

Of course spotted some lower-hanging fruit to untangle the prime helpers
and interfaces, and decided to at least fix a few of those.

Patch series survived some light testing on i915+vgem, but that's it. So
review, testing, comments and anything else really highgly welcome.

Cheers, Daniel

Daniel Vetter (59):
  drm/todo: Improve drm_gem_object funcs todo
  drm/gem: Unexport drm_gem_(un)pin/v(un)map
  drm/prime: Update docs
  drm/prime: Unconditionally set up the prime file private
  drm/prime: Make DRIVER_PRIME a no-op
  drm/prime: Actually remove DRIVER_PRIME everywhere
  drm/arm/komeda: Remove DRIVER_HAVE_IRQ
  drm/omapdrm: drop fb_debug_enter/leave
  drm/prime: Align gem_prime_export with obj_funcs.export
  drm/arc: Drop drm_gem_prime_export/import
  drm/arm: Drop drm_gem_prime_export/import
  drm/atmel: Drop drm_gem_prime_export/import
  drm/etnaviv: Drop drm_gem_prime_export/import
  drm/exynos: Drop drm_gem_prime_export
  drm/fsl-dcu: Drop drm_gem_prime_export/import
  drm/hisilicon: Drop drm_gem_prime_export/import
  drm/imx: Drop drm_gem_prime_export/import
  drm/mcde: Drop drm_gem_prime_export/import
  drm/mtk: Drop drm_gem_prime_export/import
  drm/meson: Drop drm_gem_prime_export/import
  drm/msm: Drop drm_gem_prime_export/import
  drm/mxsfb: Drop drm_gem_prime_export/import
  drm/nouveau: Drop drm_gem_prime_export/import
  drm/pl111: Drop drm_gem_prime_export/import
  drm/qxl: Drop drm_gem_prime_export/import
  drm/rcar-du: Drop drm_gem_prime_export/import
  drm/rockchip: Drop drm_gem_prime_export/import
  drm/shmob: Drop drm_gem_prime_export/import
  drm/sti: Drop drm_gem_prime_export/import
  drm/stm: Drop drm_gem_prime_export/import
  drm/tilcdc: Drop drm_gem_prime_export/import
  drm/tve2000: Drop drm_gem_prime_export/import
  drm/vboxvideo: Drop drm_gem_prime_export/import
  drm/vc3: Drop drm_gem_prime_import
  drm/radeon: Drop drm_gem_prime_import
  drm/vgem: Drop drm_gem_prime_export
  drm/virtio: Drop drm_gem_prime_export/import
  drm/xen: Drop drm_gem_prime_export/import
  drm/zte: Drop drm_gem_prime_export/import
  drm/vram-helper: Drop drm_gem_prime_export/import
  drm/prime: automatically set gem_obj->resv on import
  drm/etnaviv: Drop resv argument from etnaviv_gem_new_impl
  drm/lima: Drop resv argument from lima_bo_create_struct
  drm/mediatek: Use drm_atomic_helper_wait_for_fences
  drm/msm: Drop robj from msm_gem_new_impl
  drm/panfrost: don't set gem_obj->resv for prime import anymore
  drm/vc4: Don set gem_obj->resv in prime import anymore
  drm/vgem: Ditch attach trickery in the fence ioctl
  drm/msm: Use drm_gem_fb_prepare_fb
  drm/vc4: Use drm_gem_fb_prepare_fb
  drm/radeon: Fill out gem_object->resv
  drm/nouveau: Fill out gem_object->resv
  drm/amdgpu: Fill out gem_object->resv
  drm/prime: Ditch gem_prime_res_obj hook
  drm/todo: remove gem_prime_import/export todo
  drm/todo: Update backlight todo
  drm/todo: Update mmap todo
  drm/todo: Add new debugfs todo
  drm/doc: Document kapi doc expectations

 Documentation/gpu/drm-mm.rst  |  40 +-
 Documentation/gpu/introduction.rst|  13 +
 Documentation/gpu/todo.rst|  65 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c   |  24 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h   |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c   |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c|   2 +
 drivers/gpu/drm/arc/arcpgu_drv.c  |   5 +-
 .../gpu/drm/arm/display/komeda/komeda_kms.c   |   5 +-
 drivers/gpu/drm/arm/hdlcd_drv.c   |   6 +-
 drivers/gpu/drm/arm/malidp_drv.c  |   5 +-
 drivers/gpu/drm/armada/armada_drv.c   |   3 +-
 drivers/gpu/drm/armada/armada_gem.c   |   5 +-
 drivers/gpu/drm/armada/armada_gem.h   |   3 +-
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c   |   3 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c  |   6 +-
 drivers/gpu/drm/bochs/bochs_drv.c |   3 +-
 drivers/gpu/drm/cirrus/cirrus.c   |   2 +-
 drivers/gpu/drm/drm_file.c|   9 +-
 drivers/gpu/drm/drm_gem.c |  35 +-
 drivers/gpu/drm/drm_internal.h|   5 +
 drivers/gpu/drm/drm_prime.c   | 861 +-
 drivers/gpu/drm/etnaviv/etnaviv_drv.c |   6 +-
 drivers/gpu/drm/etnaviv/etnaviv_gem.c |  14 +-
 drivers/gpu/drm/etnaviv/etnaviv_gem.h |   3 +-
 drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c   |   1 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |   3 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c |   5 +-
 .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c   |   5 +-
 

[Intel-gfx] [PATCH 02/59] drm/gem: Unexport drm_gem_(un)pin/v(un)map

2019-06-14 Thread Daniel Vetter
They're purely for internal use, not for drivers.

Cc: Noralf Trønnes 
Cc: Christian König 
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/drm_gem.c  | 32 
 drivers/gpu/drm/drm_internal.h |  5 +
 include/drm/drm_gem.h  |  5 -
 3 files changed, 5 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 8a55f71325b1..a8c4468f03d9 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -1216,15 +1216,6 @@ void drm_gem_print_info(struct drm_printer *p, unsigned 
int indent,
obj->dev->driver->gem_print_info(p, indent, obj);
 }
 
-/**
- * drm_gem_pin - Pin backing buffer in memory
- * @obj: GEM object
- *
- * Make sure the backing buffer is pinned in memory.
- *
- * Returns:
- * 0 on success or a negative error code on failure.
- */
 int drm_gem_pin(struct drm_gem_object *obj)
 {
if (obj->funcs && obj->funcs->pin)
@@ -1234,14 +1225,7 @@ int drm_gem_pin(struct drm_gem_object *obj)
else
return 0;
 }
-EXPORT_SYMBOL(drm_gem_pin);
 
-/**
- * drm_gem_unpin - Unpin backing buffer from memory
- * @obj: GEM object
- *
- * Relax the requirement that the backing buffer is pinned in memory.
- */
 void drm_gem_unpin(struct drm_gem_object *obj)
 {
if (obj->funcs && obj->funcs->unpin)
@@ -1249,16 +1233,7 @@ void drm_gem_unpin(struct drm_gem_object *obj)
else if (obj->dev->driver->gem_prime_unpin)
obj->dev->driver->gem_prime_unpin(obj);
 }
-EXPORT_SYMBOL(drm_gem_unpin);
 
-/**
- * drm_gem_vmap - Map buffer into kernel virtual address space
- * @obj: GEM object
- *
- * Returns:
- * A virtual pointer to a newly created GEM object or an ERR_PTR-encoded 
negative
- * error code on failure.
- */
 void *drm_gem_vmap(struct drm_gem_object *obj)
 {
void *vaddr;
@@ -1275,13 +1250,7 @@ void *drm_gem_vmap(struct drm_gem_object *obj)
 
return vaddr;
 }
-EXPORT_SYMBOL(drm_gem_vmap);
 
-/**
- * drm_gem_vunmap - Remove buffer mapping from kernel virtual address space
- * @obj: GEM object
- * @vaddr: Virtual address (can be NULL)
- */
 void drm_gem_vunmap(struct drm_gem_object *obj, void *vaddr)
 {
if (!vaddr)
@@ -1292,7 +1261,6 @@ void drm_gem_vunmap(struct drm_gem_object *obj, void 
*vaddr)
else if (obj->dev->driver->gem_prime_vunmap)
obj->dev->driver->gem_prime_vunmap(obj, vaddr);
 }
-EXPORT_SYMBOL(drm_gem_vunmap);
 
 /**
  * drm_gem_lock_reservations - Sets up the ww context and acquires
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index d18c7b91a1a8..51a2055c8f18 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -133,6 +133,11 @@ void drm_gem_release(struct drm_device *dev, struct 
drm_file *file_private);
 void drm_gem_print_info(struct drm_printer *p, unsigned int indent,
const struct drm_gem_object *obj);
 
+int drm_gem_pin(struct drm_gem_object *obj);
+void drm_gem_unpin(struct drm_gem_object *obj);
+void *drm_gem_vmap(struct drm_gem_object *obj);
+void drm_gem_vunmap(struct drm_gem_object *obj, void *vaddr);
+
 /* drm_debugfs.c drm_debugfs_crc.c */
 #if defined(CONFIG_DEBUG_FS)
 int drm_debugfs_init(struct drm_minor *minor, int minor_id,
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index 5047c7ee25f5..a9121fe66ea2 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -401,9 +401,4 @@ int drm_gem_dumb_destroy(struct drm_file *file,
 struct drm_device *dev,
 uint32_t handle);
 
-int drm_gem_pin(struct drm_gem_object *obj);
-void drm_gem_unpin(struct drm_gem_object *obj);
-void *drm_gem_vmap(struct drm_gem_object *obj);
-void drm_gem_vunmap(struct drm_gem_object *obj, void *vaddr);
-
 #endif /* __DRM_GEM_H__ */
-- 
2.20.1

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

[Intel-gfx] [PATCH 05/59] drm/prime: Make DRIVER_PRIME a no-op

2019-06-14 Thread Daniel Vetter
Drivers must fill out the handle_to_fd and fd_to_handle hooks to
enable export/import prime functionality already. The additional
DRIVER_PRIME flag doesn't serve any real purpose, since the overall
flag doesn't even tell you whether import or export or maybe even both
is supported.

Ditch it.

This patch just makes it defunct, subsequent patches will remove it
from all the drivers.

Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/drm_prime.c | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index f08159a8b03a..78f6f10b2060 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -47,8 +47,7 @@
  * between applications, they can't be guessed like the globally unique GEM
  * names.
  *
- * Drivers that support the PRIME API must set the DRIVER_PRIME bit in the
- * _driver.driver_features field, and implement the
+ * Drivers that support the PRIME API implement the
  * _driver.prime_handle_to_fd and _driver.prime_fd_to_handle 
operations.
  * GEM based drivers must use drm_gem_prime_handle_to_fd() an
  * drm_gem_prime_fd_to_handle() to implement these. For GEM based drivers the
@@ -361,9 +360,6 @@ int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, 
void *data,
 {
struct drm_prime_handle *args = data;
 
-   if (!drm_core_check_feature(dev, DRIVER_PRIME))
-   return -EOPNOTSUPP;
-
if (!dev->driver->prime_fd_to_handle)
return -ENOSYS;
 
@@ -512,9 +508,6 @@ int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, 
void *data,
 {
struct drm_prime_handle *args = data;
 
-   if (!drm_core_check_feature(dev, DRIVER_PRIME))
-   return -EOPNOTSUPP;
-
if (!dev->driver->prime_handle_to_fd)
return -ENOSYS;
 
-- 
2.20.1

___
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 [CI,1/3] drm/i915: Keep contexts pinned until after the next kernel context switch (rev2)

2019-06-14 Thread Patchwork
== Series Details ==

Series: series starting with [CI,1/3] drm/i915: Keep contexts pinned until 
after the next kernel context switch (rev2)
URL   : https://patchwork.freedesktop.org/series/62124/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
4cf477fc1760 drm/i915: Keep contexts pinned until after the next kernel context 
switch
8a2c916c92b1 drm/i915: Stop retiring along engine
0c9371c05bc6 drm/i915: Replace engine->timeline with a plain list
-:181: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment
#181: FILE: drivers/gpu/drm/i915/gt/intel_engine_types.h:292:
+   spinlock_t lock;

total: 0 errors, 0 warnings, 1 checks, 968 lines checked

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

[Intel-gfx] ✗ Fi.CI.BAT: failure for Split crtc_state in sw and hw state

2019-06-14 Thread Patchwork
== Series Details ==

Series: Split crtc_state in sw and hw state
URL   : https://patchwork.freedesktop.org/series/62133/
State : failure

== Summary ==

CALLscripts/checksyscalls.sh
  CALLscripts/atomic/check-atomics.sh
  DESCEND  objtool
  CHK include/generated/compile.h
  AR  drivers/gpu/drm/i915/built-in.a
  CC [M]  drivers/gpu/drm/i915/header_test_i915_active_types.o
  CC [M]  drivers/gpu/drm/i915/header_test_i915_debugfs.o
  CC [M]  drivers/gpu/drm/i915/header_test_i915_drv.o
  CC [M]  drivers/gpu/drm/i915/header_test_i915_irq.o
  CC [M]  drivers/gpu/drm/i915/header_test_i915_params.o
  CC [M]  drivers/gpu/drm/i915/header_test_i915_priolist_types.o
  CC [M]  drivers/gpu/drm/i915/header_test_i915_reg.o
  CC [M]  drivers/gpu/drm/i915/header_test_i915_scheduler_types.o
  CC [M]  drivers/gpu/drm/i915/header_test_i915_timeline_types.o
  CC [M]  drivers/gpu/drm/i915/header_test_i915_utils.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_acpi.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_atomic.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_atomic_plane.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_audio.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_bios.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_cdclk.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_color.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_combo_phy.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_connector.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_crt.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_csr.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_ddi.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_display_power.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dp.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dp_aux_backlight.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dp_link_training.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dp_mst.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dpio_phy.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dpll_mgr.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_drv.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dsi.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dsi_dcs_backlight.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dvo.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_dvo_dev.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_fbc.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_fbdev.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_fifo_underrun.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_frontbuffer.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_gmbus.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_hdcp.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_hdmi.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_hotplug.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_lpe_audio.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_lspcon.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_lvds.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_overlay.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_panel.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_pipe_crc.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_pm.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_psr.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_quirks.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_runtime_pm.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_sdvo.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_sideband.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_sprite.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_tv.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_uncore.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_vdsc.o
  CC [M]  drivers/gpu/drm/i915/header_test_intel_wakeref.o
  CC [M]  drivers/gpu/drm/i915/intel_atomic.o
drivers/gpu/drm/i915/intel_atomic.c: In function ‘intel_crtc_destroy_state’:
drivers/gpu/drm/i915/intel_atomic.c:227:41: error: passing argument 1 of 
‘__drm_atomic_helper_crtc_destroy_state’ from incompatible pointer type 
[-Werror=incompatible-pointer-types]
  __drm_atomic_helper_crtc_destroy_state(crtc, _state->uapi);
 ^~~~
In file included from ./include/drm/drm_atomic_helper.h:34:0,
 from drivers/gpu/drm/i915/intel_atomic.c:33:
./include/drm/drm_atomic_state_helper.h:47:6: note: expected ‘struct 
drm_crtc_state *’ but argument is of type ‘struct drm_crtc *’
 void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state);
  ^~
drivers/gpu/drm/i915/intel_atomic.c:227:2: error: too many arguments to 
function ‘__drm_atomic_helper_crtc_destroy_state’
  __drm_atomic_helper_crtc_destroy_state(crtc, _state->uapi);
  ^~
In file included from ./include/drm/drm_atomic_helper.h:34:0,
 from drivers/gpu/drm/i915/intel_atomic.c:33:
./include/drm/drm_atomic_state_helper.h:47:6: note: declared here
 

Re: [Intel-gfx] [PATCH 6/9] drm/i915/dmc: extract function to parse dmc_header

2019-06-14 Thread Srivatsa, Anusha


>-Original Message-
>From: De Marchi, Lucas
>Sent: Friday, June 7, 2019 2:12 AM
>To: intel-gfx@lists.freedesktop.org
>Cc: Vivi, Rodrigo ; Srivatsa, Anusha
>; De Marchi, Lucas 
>Subject: [PATCH 6/9] drm/i915/dmc: extract function to parse dmc_header
>
>Complete the extraction of functions to parse specific parts of the firmware. 
>The
>return of the function parse_csr_fw() is now redundant since it already sets 
>the
>dmc_payload field. Changing it is left for later to avoid noise in the commit.
>
Reviewed-by: Anusha Srivatsa 
>Signed-off-by: Lucas De Marchi 
>---
> drivers/gpu/drm/i915/intel_csr.c | 130 ++-
> 1 file changed, 74 insertions(+), 56 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/intel_csr.c 
>b/drivers/gpu/drm/i915/intel_csr.c
>index db5772616a4f..1fb42fd44519 100644
>--- a/drivers/gpu/drm/i915/intel_csr.c
>+++ b/drivers/gpu/drm/i915/intel_csr.c
>@@ -332,6 +332,74 @@ static u32 find_dmc_fw_offset(const struct
>intel_fw_info *fw_info,
>   return dmc_offset;
> }
>
>+static u32 parse_csr_fw_dmc(struct intel_csr *csr,
>+  const struct intel_dmc_header *dmc_header,
>+  size_t rem_size)
>+{
>+  unsigned int i, payload_size;
>+  u32 r;
>+  u8 *payload;
>+
>+  if (rem_size < sizeof(struct intel_dmc_header))
>+  goto error_truncated;
>+
>+  if (sizeof(struct intel_dmc_header) != dmc_header->header_len) {
>+  DRM_ERROR("DMC firmware has wrong dmc header length "
>+"(%u bytes)\n",
>+(dmc_header->header_len));
>+  return 0;
>+  }
>+
>+  /* Cache the dmc header info. */
>+  if (dmc_header->mmio_count > ARRAY_SIZE(csr->mmioaddr)) {
>+  DRM_ERROR("DMC firmware has wrong mmio count %u\n",
>+dmc_header->mmio_count);
>+  return 0;
>+  }
>+
>+  csr->mmio_count = dmc_header->mmio_count;
>+  for (i = 0; i < dmc_header->mmio_count; i++) {
>+  if (dmc_header->mmioaddr[i] < CSR_MMIO_START_RANGE ||
>+  dmc_header->mmioaddr[i] > CSR_MMIO_END_RANGE) {
>+  DRM_ERROR("DMC firmware has wrong mmio address
>0x%x\n",
>+dmc_header->mmioaddr[i]);
>+  return 0;
>+  }
>+  csr->mmioaddr[i] = _MMIO(dmc_header->mmioaddr[i]);
>+  csr->mmiodata[i] = dmc_header->mmiodata[i];
>+  }
>+
>+  rem_size -= dmc_header->header_len;
>+
>+  /* fw_size is in dwords, so multiplied by 4 to convert into bytes. */
>+  payload_size = dmc_header->fw_size * 4;
>+  if (rem_size < payload_size)
>+  goto error_truncated;
>+
>+  if (payload_size > csr->max_fw_size) {
>+  DRM_ERROR("DMC FW too big (%u bytes)\n", payload_size);
>+  return 0;
>+  }
>+  csr->dmc_fw_size = dmc_header->fw_size;
>+
>+  csr->dmc_payload = kmalloc(payload_size, GFP_KERNEL);
>+  if (!csr->dmc_payload) {
>+  DRM_ERROR("Memory allocation failed for dmc payload\n");
>+  return 0;
>+  }
>+
>+  r = sizeof(struct intel_dmc_header);
>+  payload = (u8 *)(dmc_header) + r;
>+  memcpy(csr->dmc_payload, payload, payload_size);
>+  r += payload_size;
>+
>+  return r;
>+
>+error_truncated:
>+  DRM_ERROR("Truncated DMC firmware, refusing.\n");
>+  return 0;
>+}
>+
> static u32
> parse_csr_fw_package(struct intel_csr *csr,
>const struct intel_package_header *package_header, @@ -
>432,10 +500,8 @@ static u32 *parse_csr_fw(struct drm_i915_private *dev_priv,
>   struct intel_dmc_header *dmc_header;
>   struct intel_csr *csr = _priv->csr;
>   const struct stepping_info *si = intel_get_stepping_info(dev_priv);
>-  u32 readcount = 0, nbytes;
>-  u32 i, r;
>-  u32 *dmc_payload;
>-  size_t fsize;
>+  u32 readcount = 0;
>+  u32 r;
>
>   if (!fw)
>   return NULL;
>@@ -455,62 +521,14 @@ static u32 *parse_csr_fw(struct drm_i915_private
>*dev_priv,
>   return NULL;
>
>   readcount += r;
>-  fsize = readcount +
>-  sizeof(struct intel_dmc_header);
>-  if (fsize > fw->size)
>-  goto error_truncated;
>
>-  /* Extract dmc_header information. */
>+  /* Extract dmc_header information */
>   dmc_header = (struct intel_dmc_header *)>data[readcount];
>-  if (sizeof(struct intel_dmc_header) != (dmc_header->header_len)) {
>-  DRM_ERROR("DMC firmware has wrong dmc header length "
>-"(%u bytes)\n",
>-(dmc_header->header_len));
>-  return NULL;
>-  }
>-  readcount += sizeof(struct intel_dmc_header);
>-
>-  /* Cache the dmc header info. */
>-  if (dmc_header->mmio_count > ARRAY_SIZE(csr->mmioaddr)) {
>-  DRM_ERROR("DMC firmware has wrong mmio count %u\n",
>-

[Intel-gfx] [RFC 0/2] Split crtc_state in sw and hw state

2019-06-14 Thread Maarten Lankhorst
Use uapi for drm, and keep the internal state in hw.
 
This patch is incomplete, just want feedback on the direction I'm going.

Maarten Lankhorst (2):
  drm/i915: Rename intel_crtc_state->base to hw
  [INCOMPLETE] drm/i915: Split up crtc_state into uapi and hw

 drivers/gpu/drm/i915/i915_debugfs.c   |  14 +-
 drivers/gpu/drm/i915/icl_dsi.c|  18 +-
 drivers/gpu/drm/i915/intel_atomic.c   |  17 +-
 drivers/gpu/drm/i915/intel_atomic_plane.c |   8 +-
 drivers/gpu/drm/i915/intel_audio.c|  14 +-
 drivers/gpu/drm/i915/intel_bw.c   |   4 +-
 drivers/gpu/drm/i915/intel_cdclk.c|   8 +-
 drivers/gpu/drm/i915/intel_color.c| 140 +++---
 drivers/gpu/drm/i915/intel_crt.c  |  24 +-
 drivers/gpu/drm/i915/intel_ddi.c  |  28 +-
 drivers/gpu/drm/i915/intel_display.c  | 527 +++---
 drivers/gpu/drm/i915/intel_dp.c   |  42 +-
 drivers/gpu/drm/i915/intel_dp_mst.c   |   6 +-
 drivers/gpu/drm/i915/intel_dpio_phy.c |  14 +-
 drivers/gpu/drm/i915/intel_dpll_mgr.c |  36 +-
 drivers/gpu/drm/i915/intel_drv.h  |   4 +-
 drivers/gpu/drm/i915/intel_dvo.c  |  14 +-
 drivers/gpu/drm/i915/intel_fbc.c  |   2 +-
 drivers/gpu/drm/i915/intel_hdmi.c |  62 +--
 drivers/gpu/drm/i915/intel_lspcon.c   |   4 +-
 drivers/gpu/drm/i915/intel_lvds.c |  12 +-
 drivers/gpu/drm/i915/intel_panel.c|  14 +-
 drivers/gpu/drm/i915/intel_pipe_crc.c |   6 +-
 drivers/gpu/drm/i915/intel_pm.c   | 169 +++
 drivers/gpu/drm/i915/intel_psr.c  |  10 +-
 drivers/gpu/drm/i915/intel_sdvo.c |  22 +-
 drivers/gpu/drm/i915/intel_sprite.c   |  25 +-
 drivers/gpu/drm/i915/intel_tv.c   |   8 +-
 drivers/gpu/drm/i915/intel_vdsc.c |  10 +-
 drivers/gpu/drm/i915/vlv_dsi.c|  20 +-
 30 files changed, 648 insertions(+), 634 deletions(-)

-- 
2.20.1

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

[Intel-gfx] [RFC 2/2] [INCOMPLETE] drm/i915: Split up crtc_state into uapi and hw

2019-06-14 Thread Maarten Lankhorst
 Use uapi for drm, and keep the internal state in hw.
 
 This patch is incomplete, just want feedback on the direction I'm going.
---
 drivers/gpu/drm/i915/intel_atomic.c  | 13 ++--
 drivers/gpu/drm/i915/intel_display.c | 88 +++-
 drivers/gpu/drm/i915/intel_drv.h |  2 +-
 3 files changed, 57 insertions(+), 46 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_atomic.c 
b/drivers/gpu/drm/i915/intel_atomic.c
index 1f891b554ead..36fbd408ba81 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -185,12 +185,14 @@ struct drm_crtc_state *
 intel_crtc_duplicate_state(struct drm_crtc *crtc)
 {
struct intel_crtc_state *crtc_state;
+   const struct intel_crtc_state *old_crtc_state = 
to_intel_crtc_state(crtc->state);
 
-   crtc_state = kmemdup(crtc->state, sizeof(*crtc_state), GFP_KERNEL);
+   crtc_state = kmemdup(old_crtc_state, sizeof(*crtc_state), GFP_KERNEL);
if (!crtc_state)
return NULL;
 
-   __drm_atomic_helper_crtc_duplicate_state(crtc, _state->hw);
+   __drm_atomic_helper_crtc_duplicate_state(crtc, _state->uapi);
+   memset(_state->hw, 0, sizeof(crtc_state->hw));
 
crtc_state->update_pipe = false;
crtc_state->disable_lp_wm = false;
@@ -203,7 +205,7 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
crtc_state->fb_bits = 0;
crtc_state->update_planes = 0;
 
-   return _state->hw;
+   return _state->uapi;
 }
 
 /**
@@ -218,7 +220,10 @@ void
 intel_crtc_destroy_state(struct drm_crtc *crtc,
 struct drm_crtc_state *state)
 {
-   drm_atomic_helper_crtc_destroy_state(crtc, state);
+   struct intel_crtc_state *crtc_state = to_intel_crtc_state(state);
+
+   __drm_atomic_helper_crtc_destroy_state(crtc, _state->uapi);
+   kfree(crtc_state);
 }
 
 static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state 
*scaler_state,
diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 9aa273fb5415..2de978ab8fc2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -514,9 +514,9 @@ icl_wa_scalerclkgating(struct drm_i915_private *dev_priv, 
enum pipe pipe,
 }
 
 static bool
-needs_modeset(const struct drm_crtc_state *state)
+needs_modeset(const struct intel_crtc_state *state)
 {
-   return drm_atomic_crtc_needs_modeset(state);
+   return drm_atomic_crtc_needs_modeset(>hw);
 }
 
 /*
@@ -5795,7 +5795,7 @@ static bool hsw_pre_update_disable_ips(const struct 
intel_crtc_state *old_crtc_s
if (!old_crtc_state->ips_enabled)
return false;
 
-   if (needs_modeset(_crtc_state->hw))
+   if (needs_modeset(new_crtc_state))
return true;
 
/*
@@ -5822,7 +5822,7 @@ static bool hsw_post_update_enable_ips(const struct 
intel_crtc_state *old_crtc_s
if (!new_crtc_state->ips_enabled)
return false;
 
-   if (needs_modeset(_crtc_state->hw))
+   if (needs_modeset(new_crtc_state))
return true;
 
/*
@@ -5899,7 +5899,7 @@ static void intel_post_plane_update(struct 
intel_crtc_state *old_crtc_state)
intel_fbc_post_update(crtc);
 
if (new_primary_state->visible &&
-   (needs_modeset(_config->hw) ||
+   (needs_modeset(pipe_config) ||
 !old_primary_state->visible))
intel_post_enable_primary(>base, pipe_config);
}
@@ -5923,7 +5923,7 @@ static void intel_pre_plane_update(struct 
intel_crtc_state *old_crtc_state,
struct drm_plane *primary = crtc->base.primary;
struct drm_plane_state *old_primary_state =
drm_atomic_get_old_plane_state(old_state, primary);
-   bool modeset = needs_modeset(_config->hw);
+   bool modeset = needs_modeset(pipe_config);
struct intel_atomic_state *old_intel_state =
to_intel_atomic_state(old_state);
 
@@ -5983,7 +5983,7 @@ static void intel_pre_plane_update(struct 
intel_crtc_state *old_crtc_state,
 * If we're doing a modeset, we're done.  No need to do any pre-vblank
 * watermark programming here.
 */
-   if (needs_modeset(_config->hw))
+   if (needs_modeset(pipe_config))
return;
 
/*
@@ -11338,7 +11338,7 @@ int intel_plane_atomic_calc_changes(const struct 
intel_crtc_state *old_crtc_stat
struct intel_plane *plane = to_intel_plane(plane_state->plane);
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = to_i915(dev);
-   bool mode_changed = needs_modeset(crtc_state);
+   bool mode_changed = needs_modeset(pipe_config);
bool was_crtc_enabled = old_crtc_state->hw.active;
bool is_crtc_enabled = crtc_state->active;
bool turn_off, turn_on, visible, was_visible;
@@ -11607,7 +11607,7 @@ static int 

Re: [Intel-gfx] [PATCH 35/39] drm/i915: Pin pages before waiting

2019-06-14 Thread Matthew Auld
On Fri, 14 Jun 2019 at 21:13, Chris Wilson  wrote:
>
> Quoting Chris Wilson (2019-06-14 20:58:09)
> > Quoting Matthew Auld (2019-06-14 20:53:26)
> > > On Fri, 14 Jun 2019 at 08:11, Chris Wilson  
> > > wrote:
> > > > @@ -67,10 +61,17 @@ i915_gem_object_set_to_wc_domain(struct 
> > > > drm_i915_gem_object *obj, bool write)
> > > >  * continue to assume that the obj remained out of the CPU 
> > > > cached
> > > >  * domain.
> > > >  */
> > > > -   ret = i915_gem_object_pin_pages(obj);
> > > > +   ret = i915_gem_object_pin_pages_async(obj);
> > > > if (ret)
> > > > return ret;
> > > >
> > > > +   ret = i915_gem_object_wait(obj,
> > > > +  I915_WAIT_INTERRUPTIBLE |
> > > > +  (write ? I915_WAIT_ALL : 0),
> > > > +  MAX_SCHEDULE_TIMEOUT);
> > > > +   if (ret)
> > > > +   goto out_unpin;
> > > > +
> > >
> > > Do we somehow propagate a potential error from a worker to the
> > > object_wait()? Or should we be looking at obj->mm.pages here?
> >
> > Yeah, I've propagated such errors elsewhere (principally along the
> > fences). What you are suggesting is tantamount to making
> > i915_gem_object_wait() report an error, and I have bad memories from all
> > the unhandled -EIO in the past. However, that feels the natural thing to
> > do, so lets give it a whirl.
>
> So we need to check for error pages anyway, because we can't rule out a
> race between the pin_pages_async and i915_gem_object_wait.
>
> There's plenty of duplicated code for pin_pages_async, object_wait,
> check pages so I should refactor that into a variant,
> i915_gem_object_pin_pages_wait() ?

Yeah, makes sense to me.
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH 35/39] drm/i915: Pin pages before waiting

2019-06-14 Thread Chris Wilson
Quoting Chris Wilson (2019-06-14 20:58:09)
> Quoting Matthew Auld (2019-06-14 20:53:26)
> > On Fri, 14 Jun 2019 at 08:11, Chris Wilson  wrote:
> > > @@ -67,10 +61,17 @@ i915_gem_object_set_to_wc_domain(struct 
> > > drm_i915_gem_object *obj, bool write)
> > >  * continue to assume that the obj remained out of the CPU cached
> > >  * domain.
> > >  */
> > > -   ret = i915_gem_object_pin_pages(obj);
> > > +   ret = i915_gem_object_pin_pages_async(obj);
> > > if (ret)
> > > return ret;
> > >
> > > +   ret = i915_gem_object_wait(obj,
> > > +  I915_WAIT_INTERRUPTIBLE |
> > > +  (write ? I915_WAIT_ALL : 0),
> > > +  MAX_SCHEDULE_TIMEOUT);
> > > +   if (ret)
> > > +   goto out_unpin;
> > > +
> > 
> > Do we somehow propagate a potential error from a worker to the
> > object_wait()? Or should we be looking at obj->mm.pages here?
> 
> Yeah, I've propagated such errors elsewhere (principally along the
> fences). What you are suggesting is tantamount to making
> i915_gem_object_wait() report an error, and I have bad memories from all
> the unhandled -EIO in the past. However, that feels the natural thing to
> do, so lets give it a whirl.

So we need to check for error pages anyway, because we can't rule out a
race between the pin_pages_async and i915_gem_object_wait.

There's plenty of duplicated code for pin_pages_async, object_wait,
check pages so I should refactor that into a variant, 
i915_gem_object_pin_pages_wait() ?
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH 5/9] drm/i915/dmc: extract function to parse package_header

2019-06-14 Thread Srivatsa, Anusha


>-Original Message-
>From: De Marchi, Lucas
>Sent: Friday, June 7, 2019 2:12 AM
>To: intel-gfx@lists.freedesktop.org
>Cc: Vivi, Rodrigo ; Srivatsa, Anusha
>; De Marchi, Lucas 
>Subject: [PATCH 5/9] drm/i915/dmc: extract function to parse package_header
>
>Like parse_csr_fw_css() this parses the package_header from firmware and saves
>the relevant fields in the csr struct. In this function we also lookup the 
>fw_info we
>are interested in.
>
Reviewed-by: Anusha Srivatsa 
>Signed-off-by: Lucas De Marchi 
>---
> drivers/gpu/drm/i915/intel_csr.c | 117 +--
> 1 file changed, 66 insertions(+), 51 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/intel_csr.c 
>b/drivers/gpu/drm/i915/intel_csr.c
>index 79732075f008..db5772616a4f 100644
>--- a/drivers/gpu/drm/i915/intel_csr.c
>+++ b/drivers/gpu/drm/i915/intel_csr.c
>@@ -332,6 +332,64 @@ static u32 find_dmc_fw_offset(const struct
>intel_fw_info *fw_info,
>   return dmc_offset;
> }
>
>+static u32
>+parse_csr_fw_package(struct intel_csr *csr,
>+   const struct intel_package_header *package_header,
>+   const struct stepping_info *si,
>+   size_t rem_size)
>+{
>+  u32 package_size = sizeof(struct intel_package_header);
>+  u32 num_entries, max_entries, dmc_offset;
>+  const struct intel_fw_info *fw_info;
>+
>+  if (rem_size < package_size)
>+  goto error_truncated;
>+
>+  if (package_header->header_ver == 1) {
>+  max_entries = PACKAGE_MAX_FW_INFO_ENTRIES;
>+  } else if (package_header->header_ver == 2) {
>+  max_entries = PACKAGE_V2_MAX_FW_INFO_ENTRIES;
>+  } else {
>+  DRM_ERROR("DMC firmware has unknown header version
>%u\n",
>+package_header->header_ver);
>+  return 0;
>+  }
>+
>+  /*
>+   * We should always have space for max_entries,
>+   * even if not all are used
>+   */
>+  package_size += max_entries * sizeof(struct intel_fw_info);
>+  if (rem_size < package_size)
>+  goto error_truncated;
>+
>+  if (package_header->header_len * 4 != package_size) {
>+  DRM_ERROR("DMC firmware has wrong package header length "
>+"(%u bytes)\n", package_size);
>+  return 0;
>+  }
>+
>+  num_entries = package_header->num_entries;
>+  if (WARN_ON(package_header->num_entries > max_entries))
>+  num_entries = max_entries;
>+
>+  fw_info = (const struct intel_fw_info *)
>+  ((u8 *)package_header + sizeof(*package_header));
>+  dmc_offset = find_dmc_fw_offset(fw_info, num_entries, si);
>+  if (dmc_offset == CSR_DEFAULT_FW_OFFSET) {
>+  DRM_ERROR("DMC firmware not supported for %c stepping\n",
>+si->stepping);
>+  return 0;
>+  }
>+
>+  /* dmc_offset is in dwords */
>+  return package_size + dmc_offset * 4;
>+
>+error_truncated:
>+  DRM_ERROR("Truncated DMC firmware, refusing.\n");
>+  return 0;
>+}
>+
> /* Return number of bytes parsed or 0 on error */  static u32
>parse_csr_fw_css(struct intel_csr *csr,
>   struct intel_css_header *css_header, @@ -374,7
>+432,7 @@ static u32 *parse_csr_fw(struct drm_i915_private *dev_priv,
>   struct intel_dmc_header *dmc_header;
>   struct intel_csr *csr = _priv->csr;
>   const struct stepping_info *si = intel_get_stepping_info(dev_priv);
>-  u32 dmc_offset, num_entries, max_entries, readcount = 0, nbytes;
>+  u32 readcount = 0, nbytes;
>   u32 i, r;
>   u32 *dmc_payload;
>   size_t fsize;
>@@ -389,59 +447,16 @@ static u32 *parse_csr_fw(struct drm_i915_private
>*dev_priv,
>   return NULL;
>
>   readcount += r;
>-  fsize = readcount +
>-  sizeof(struct intel_package_header) +
>-  sizeof(struct intel_dmc_header);
>-  if (fsize > fw->size)
>-  goto error_truncated;
>-
>-  /* Extract Package Header information*/
>-  package_header = (struct intel_package_header *)
>-  >data[readcount];
>-
>-  readcount += sizeof(struct intel_package_header);
>-
>-  if (package_header->header_ver == 1) {
>-  max_entries = PACKAGE_MAX_FW_INFO_ENTRIES;
>-  } else if (package_header->header_ver == 2) {
>-  max_entries = PACKAGE_V2_MAX_FW_INFO_ENTRIES;
>-  } else {
>-  DRM_ERROR("DMC firmware has unknown header version
>%u\n",
>-package_header->header_ver);
>-  return NULL;
>-  }
>-
>-  if (package_header->header_len * 4 !=
>-  sizeof(struct intel_package_header) +
>-  max_entries * sizeof(struct intel_fw_info)) {
>-  DRM_ERROR("DMC firmware has wrong package header length "
>-"(%u bytes)\n", package_header->header_len * 4);
>-  return NULL;
>-  }
>-
>-  num_entries = 

  1   2   3   4   >