Re: [Intel-gfx] [PATCH v2 05/15] drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()

2017-10-31 Thread Russell King - ARM Linux
On Mon, Oct 30, 2017 at 04:39:41PM +0100, Noralf Trønnes wrote:
> -static void armada_output_poll_changed(struct drm_device *dev)
> -{
> - struct armada_private *priv = dev->dev_private;
> - struct drm_fb_helper *fbh = priv->fbdev;
> -
> - if (fbh)
> - drm_fb_helper_hotplug_event(fbh);
> -}
> -
>  const struct drm_mode_config_funcs armada_drm_mode_config_funcs = {
>   .fb_create  = armada_fb_create,
> - .output_poll_changed= armada_output_poll_changed,
> + .output_poll_changed= drm_fb_helper_output_poll_changed,

I think this is fine, because although it gets rid of the NULL checks
for the drm_fb_helper structure, the driver will fail to initialise
unless priv->fbdev and the fb helper successfully initialises.

It would be nice to mention that in the commit message as to why
removing those NULL checks is safe.

In any case,

Acked-by: Russell King 

Thanks.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: Remove i915.enable_execlists module parameter

2017-10-31 Thread Lionel Landwerlin

I can't speak for the totality of the driver, but the perf part is :

Reviewed-by: Lionel Landwerlin 

On 26/10/17 22:17, Chris Wilson wrote:

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 59ee808f8fd9..8dfa74bd3f37 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1214,9 +1214,9 @@ static int oa_get_render_ctx_id(struct i915_perf_stream 
*stream)
  {
struct drm_i915_private *dev_priv = stream->dev_priv;
  
-	if (i915_modparams.enable_execlists)

+   if (HAS_LOGICAL_RING_CONTEXTS(dev_priv)) {
dev_priv->perf.oa.specific_ctx_id = stream->ctx->hw_id;
-   else {
+   } else {
struct intel_engine_cs *engine = dev_priv->engine[RCS];
struct intel_ring *ring;
int ret;
@@ -1260,7 +1260,7 @@ static void oa_put_render_ctx_id(struct i915_perf_stream 
*stream)
  {
struct drm_i915_private *dev_priv = stream->dev_priv;
  
-	if (i915_modparams.enable_execlists) {

+   if (HAS_LOGICAL_RING_CONTEXTS(dev_priv)) {
dev_priv->perf.oa.specific_ctx_id = INVALID_CTX_ID;
} else {
struct intel_engine_cs *engine = dev_priv->engine[RCS];
@@ -3412,7 +3412,7 @@ void i915_perf_init(struct drm_i915_private *dev_priv)
dev_priv->perf.oa.timestamp_frequency = 1250;
  
  		dev_priv->perf.oa.oa_formats = hsw_oa_formats;

-   } else if (i915_modparams.enable_execlists) {
+   } else if (HAS_LOGICAL_RING_CONTEXTS(dev_priv)) {
/* Note: that although we could theoretically also support the
 * legacy ringbuffer mode on BDW (and earlier iterations of
 * this driver, before upstreaming did this) it didn't seem



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


Re: [Intel-gfx] [maintainer-tools PATCH] dim: Sign commits in addition to tags

2017-10-31 Thread Daniel Vetter
On Tue, Oct 31, 2017 at 5:14 PM, Sean Paul  wrote:
> On Tue, Oct 31, 2017 at 4:27 AM, Jani Nikula
>  wrote:
>>
>> Reminder, we have this new list dim-to...@lists.freedesktop.org for
>> maintainer tools patches. Cc'd.
>>
>
> Ahh, cool. I didn't realize dim grew up!
>
>> On Mon, 30 Oct 2017, Sean Paul  wrote:
>>> Expanding on Jani's work to sign tags, this patch adds signing for git
>>> commit/am.
>>
>> I guess I'd like more rationale here. Is this something we should be
>> doing? Is anyone else doing this?
>>
>
> Sure thing. Signing commits allows Dave to use --verify-signatures
> when pulling. If something is not signed, we'll know it was either not
> applied with dim, or was altered on fdo (both warrant investigation).
>
> I suspect no one else is doing this since most trees are single
> maintainer, and it's not possible to sign commits via git send-email.
> Since we have the committer model, and a bunch of people with access
> to fdo and the tree, I think it's important to add this. Especially
> since we can do it in dim without overhead.
>
>>> Signed-off-by: Sean Paul 
>>> ---
>>>
>>> This has been lightly tested with dim apply-branch/dim push-branch.
>>>
>>> Sean
>>>
>>>  dim | 78 
>>> +
>>>  1 file changed, 51 insertions(+), 27 deletions(-)
>>>
>>> diff --git a/dim b/dim
>>> index 527989aff9ad..cd5e41f89a3a 100755
>>> --- a/dim
>>> +++ b/dim
>>> @@ -67,9 +67,6 @@ 
>>> DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
>>>  # dim pull-request tag summary template
>>>  
>>> DIM_TEMPLATE_TAG_SUMMARY=${DIM_TEMPLATE_TAG_SUMMARY:-$HOME/.dim.template.tagsummary}
>>>
>>> -# GPG key id for signing tags. If unset, don't sign.
>>> -DIM_GPG_KEYID=${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}
>>> -
>>>  #
>>>  # Internal configuration.
>>>  #
>>> @@ -104,6 +101,20 @@ test_request_recipients=(
>>>  # integration configuration
>>>  integration_config=nightly.conf
>>>
>>> +# GPG key id for signing tags. If unset, don't sign.
>>> +function gpg_keyid_for_tag
>>> +{
>>> + echo "${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}"
>>> + return 0
>>> +}
>>> +
>>> +# GPG key id for committing (git commit/am). If unset, don't sign.
>>> +function gpg_keyid_for_commit
>>> +{
>>> + echo "${DIM_GPG_KEYID:+-S$DIM_GPG_KEYID}"
>>> + return 0
>>> +}
>>
>> This seems like an overly complicated way to achieve what you want.
>>
>> Just put these under "Internal configuration." instead:
>>
>> dim_gpg_sign_tag=${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}
>> dim_gpg_sign_commit=${DIM_GPG_KEYID:+-S$DIM_GPG_KEYID}
>>
>> And use directly in git tag and commit, respectively?
>>
>
> Yep, sounds good.
>
>> Although... perhaps starting to sign tags should not force signing
>> commits?
>>
>
> Why would it be desirable to *not* sign tags?

Again, what's the threat model you're trying to defend against? Atm
anyone with commit rights to fd.o can push whatever they want to. If
they want to be evil, they can also push whatever kind of garbage they
want to, including commit signature and and fake Link: and review
tags. With pull requests/tags signing them prevents a
man-in-the-midddle attack of the unprotected pull request in the mail,
but I still don't see what signing commits protects against.
-Daniel

>
> Sean
>
>
>> BR,
>> Jani.
>>
>>
>>> +
>>>  function read_integration_config
>>>  {
>>>   # clear everything first to allow configuration reload
>>> @@ -473,12 +484,14 @@ EOF
>>>  # append all arguments as tags at the end of the commit message of HEAD
>>>  function dim_commit_add_tag
>>>  {
>>> + local gpg_keyid
>>> + gpg_keyid=$(gpg_keyid_for_commit)
>>>   for arg; do
>>>   # the first sed deletes all trailing blank lines at the end
>>>   git log -1 --pretty=%B | \
>>>   sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | \
>>>   sed "\$a${arg}" | \
>>> - git commit --amend -F-
>>> + git commit $gpg_keyid --amend -F-
>>>   done
>>>  }
>>>
>>> @@ -604,7 +617,7 @@ function update_rerere_cache
>>>
>>>  function commit_rerere_cache
>>>  {
>>> - local remote file commit_message
>>> + local remote file commit_message gpg_keyid
>>>
>>>   echo -n "Updating rerere cache... "
>>>
>>> @@ -640,7 +653,8 @@ function commit_rerere_cache
>>>   $(git --version)
>>>   EOF
>>>
>>> - if git commit -F $commit_message >& /dev/null; then
>>> + gpg_keyid=$(gpg_keyid_for_commit)
>>> + if git commit $gpg_keyid -F $commit_message >& /dev/null; then
>>>   echo -n "New commit. "
>>>   else
>>>   echo -n "Nothing changed. "
>>> @@ -653,13 +667,14 @@ function commit_rerere_cache
>>>
>>>  function dim_rebuild_tip
>>>  {
>>> - local integration_branch specfile first rerere repo remote
>>> + local integration_branch specfile first rerere repo remote gpg_keyid
>>>
>>>   integration_branch=drm-tip
>>>   spe

Re: [Intel-gfx] [maintainer-tools PATCH] dim: Sign commits in addition to tags

2017-10-31 Thread Sean Paul
On Tue, Oct 31, 2017 at 1:31 PM, Daniel Vetter  wrote:
> On Tue, Oct 31, 2017 at 5:14 PM, Sean Paul  wrote:
>> On Tue, Oct 31, 2017 at 4:27 AM, Jani Nikula
>>  wrote:
>>>
>>> Reminder, we have this new list dim-to...@lists.freedesktop.org for
>>> maintainer tools patches. Cc'd.
>>>
>>
>> Ahh, cool. I didn't realize dim grew up!
>>
>>> On Mon, 30 Oct 2017, Sean Paul  wrote:
 Expanding on Jani's work to sign tags, this patch adds signing for git
 commit/am.
>>>
>>> I guess I'd like more rationale here. Is this something we should be
>>> doing? Is anyone else doing this?
>>>
>>
>> Sure thing. Signing commits allows Dave to use --verify-signatures
>> when pulling. If something is not signed, we'll know it was either not
>> applied with dim, or was altered on fdo (both warrant investigation).
>>
>> I suspect no one else is doing this since most trees are single
>> maintainer, and it's not possible to sign commits via git send-email.
>> Since we have the committer model, and a bunch of people with access
>> to fdo and the tree, I think it's important to add this. Especially
>> since we can do it in dim without overhead.
>>
 Signed-off-by: Sean Paul 
 ---

 This has been lightly tested with dim apply-branch/dim push-branch.

 Sean

  dim | 78 
 +
  1 file changed, 51 insertions(+), 27 deletions(-)

 diff --git a/dim b/dim
 index 527989aff9ad..cd5e41f89a3a 100755
 --- a/dim
 +++ b/dim
 @@ -67,9 +67,6 @@ 
 DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
  # dim pull-request tag summary template
  
 DIM_TEMPLATE_TAG_SUMMARY=${DIM_TEMPLATE_TAG_SUMMARY:-$HOME/.dim.template.tagsummary}

 -# GPG key id for signing tags. If unset, don't sign.
 -DIM_GPG_KEYID=${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}
 -
  #
  # Internal configuration.
  #
 @@ -104,6 +101,20 @@ test_request_recipients=(
  # integration configuration
  integration_config=nightly.conf

 +# GPG key id for signing tags. If unset, don't sign.
 +function gpg_keyid_for_tag
 +{
 + echo "${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}"
 + return 0
 +}
 +
 +# GPG key id for committing (git commit/am). If unset, don't sign.
 +function gpg_keyid_for_commit
 +{
 + echo "${DIM_GPG_KEYID:+-S$DIM_GPG_KEYID}"
 + return 0
 +}
>>>
>>> This seems like an overly complicated way to achieve what you want.
>>>
>>> Just put these under "Internal configuration." instead:
>>>
>>> dim_gpg_sign_tag=${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}
>>> dim_gpg_sign_commit=${DIM_GPG_KEYID:+-S$DIM_GPG_KEYID}
>>>
>>> And use directly in git tag and commit, respectively?
>>>
>>
>> Yep, sounds good.
>>
>>> Although... perhaps starting to sign tags should not force signing
>>> commits?
>>>
>>
>> Why would it be desirable to *not* sign tags?
>
> Again, what's the threat model you're trying to defend against? Atm
> anyone with commit rights to fd.o can push whatever they want to. If
> they want to be evil, they can also push whatever kind of garbage they
> want to, including commit signature and and fake Link: and review
> tags. With pull requests/tags signing them prevents a
> man-in-the-midddle attack of the unprotected pull request in the mail,
> but I still don't see what signing commits protects against.

This is protecting against a bad actor (either through a committer's
account, or some other fdo account) gaining access to the tree on fdo
and either adding a malicious commit, or altering an existing commit.

Sean

> -Daniel
>
>>
>> Sean
>>
>>
>>> BR,
>>> Jani.
>>>
>>>
 +
  function read_integration_config
  {
   # clear everything first to allow configuration reload
 @@ -473,12 +484,14 @@ EOF
  # append all arguments as tags at the end of the commit message of HEAD
  function dim_commit_add_tag
  {
 + local gpg_keyid
 + gpg_keyid=$(gpg_keyid_for_commit)
   for arg; do
   # the first sed deletes all trailing blank lines at the end
   git log -1 --pretty=%B | \
   sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | \
   sed "\$a${arg}" | \
 - git commit --amend -F-
 + git commit $gpg_keyid --amend -F-
   done
  }

 @@ -604,7 +617,7 @@ function update_rerere_cache

  function commit_rerere_cache
  {
 - local remote file commit_message
 + local remote file commit_message gpg_keyid

   echo -n "Updating rerere cache... "

 @@ -640,7 +653,8 @@ function commit_rerere_cache
   $(git --version)
   EOF

 - if git commit -F $commit_message >& /dev/null; then
 + gpg_keyid=$(gpg_keyid_for_commit)
 + if git commit $gpg_keyid -F $commit_me

Re: [Intel-gfx] [PATCH v2 00/15] drm/fb-helper: Add .last_close and .output_poll_changed helpers

2017-10-31 Thread Noralf Trønnes


Den 30.10.2017 16.39, skrev Noralf Trønnes:

This patchset adds fbdev .last_close and .output_poll_changed helpers to
reduce fbdev emulation footprint in drivers.

I don't know which drivers have their own tree or not, so if you want me
to apply your patch to drm-misc, please let me know.

I will do a separate patchset for the cma helper drivers.

Noralf.

Changes since version 1:
- drm_device.drm_fb_helper_private -> drm_device.fb_helper (Ville)

Noralf Trønnes (15):
   drm/fb-helper: Handle function NULL argument
   drm: Add drm_device->fb_helper pointer
   drm/fb-helper: Add .last_close and .output_poll_changed helpers


Core patches 1-3 applied to drm-misc.
Thanks for reviewing!

Noralf.


   drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()
   drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()
   drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
   drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()
   drm/i915: Use drm_fb_helper_output_poll_changed()
   drm/msm: Use drm_fb_helper_lastclose() and _poll_changed()
   drm/nouveau: Use drm_fb_helper_output_poll_changed()
   drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()
   drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()
   drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed()
   drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed()
   staging: vboxvideo: Use drm_fb_helper_lastclose()

  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c |  9 +---
  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c  | 27 ---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c |  4 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h|  4 --
  drivers/gpu/drm/armada/armada_drm.h |  1 -
  drivers/gpu/drm/armada/armada_drv.c |  8 +---
  drivers/gpu/drm/armada/armada_fb.c  | 11 +
  drivers/gpu/drm/armada/armada_fbdev.c   |  8 
  drivers/gpu/drm/drm_fb_helper.c | 69 +++--
  drivers/gpu/drm/exynos/exynos_drm_drv.c |  8 +---
  drivers/gpu/drm/exynos/exynos_drm_fb.c  |  2 +-
  drivers/gpu/drm/exynos/exynos_drm_fbdev.c   | 18 
  drivers/gpu/drm/exynos/exynos_drm_fbdev.h   |  2 -
  drivers/gpu/drm/gma500/framebuffer.c|  9 +---
  drivers/gpu/drm/gma500/psb_drv.c| 15 +--
  drivers/gpu/drm/i915/intel_display.c|  2 +-
  drivers/gpu/drm/i915/intel_drv.h|  5 ---
  drivers/gpu/drm/i915/intel_fbdev.c  |  8 
  drivers/gpu/drm/msm/msm_drv.c   | 18 +---
  drivers/gpu/drm/nouveau/nouveau_display.c   |  3 +-
  drivers/gpu/drm/nouveau/nouveau_fbcon.c |  8 
  drivers/gpu/drm/nouveau/nouveau_fbcon.h |  2 -
  drivers/gpu/drm/nouveau/nouveau_vga.c   |  3 +-
  drivers/gpu/drm/nouveau/nv50_display.c  |  2 +-
  drivers/gpu/drm/omapdrm/omap_drv.c  | 34 +-
  drivers/gpu/drm/radeon/radeon_display.c |  9 +---
  drivers/gpu/drm/radeon/radeon_fb.c  | 22 -
  drivers/gpu/drm/radeon/radeon_kms.c |  5 +--
  drivers/gpu/drm/radeon/radeon_mode.h|  3 --
  drivers/gpu/drm/rockchip/rockchip_drm_drv.c |  9 +---
  drivers/gpu/drm/rockchip/rockchip_drm_fb.c  |  9 +---
  drivers/gpu/drm/tegra/drm.c | 13 +-
  drivers/gpu/drm/tegra/drm.h |  4 --
  drivers/gpu/drm/tegra/fb.c  | 14 --
  drivers/staging/vboxvideo/vbox_drv.c|  2 +-
  drivers/staging/vboxvideo/vbox_drv.h|  1 -
  drivers/staging/vboxvideo/vbox_main.c   | 12 -
  include/drm/drm_device.h|  9 
  include/drm/drm_fb_helper.h | 11 +
  39 files changed, 106 insertions(+), 297 deletions(-)



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


Re: [Intel-gfx] [PATCH v8 1/6] drm/i915 : Unifying seq_puts messages for feature support

2017-10-31 Thread Sujaritha



On 10/29/2017 09:49 PM, Sagar Arun Kamble wrote:



On 10/26/2017 11:24 PM, Daniele Ceraolo Spurio wrote:



On 25/10/17 06:31, Michal Wajdeczko wrote:
On Tue, 24 Oct 2017 19:21:20 +0200, Sujaritha Sundaresan 
 wrote:


Unifying the various seq_puts messages in debugfs to the simplest 
one for

feature support.
As Michal noted in the v7 review, if the goal is to unification of 
consistent output then I see some more in the debugfs that
might need to be updated: *_wm_latency_open, i915_ipc_status, 
i915_runtime_pm_status(returning early could be done later)

i915_llc (add change to return early).
Also, I think this patch can be separated from this series as it has 
very little dependency.


Sure, I will include the other updates to the patch. But I feel that it 
might be better to keep

the patch with series, since I'm including the change to HAS_GUC here.


v2: Clarifying the commit message (Anusha)

v3: Re-factoring code as per review (Michal)

v4: Rebase

v5: Split from following patch

v6: Re-factoring code (Michal, Sagar)
    Clarifying commit message (Sagar)

v7: Generalizing subject to drm/i915 (Sagar)

v8: Omitting DRRS seq_puts unification (Michal)

Suggested by: Michal Wajdeczko 
Signed-off-by: Sujaritha Sundaresan 
Cc: Anusha Srivatsa 
Cc: Michal Wajdeczko 
Cc: Oscar Mateo 
Cc: Sagar Arun Kamble 
---
 drivers/gpu/drm/i915/i915_debugfs.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c

index c65e381..8edd029 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1641,7 +1641,7 @@ static int i915_fbc_status(struct seq_file 
*m, void *unused)

 struct drm_i915_private *dev_priv = node_to_i915(m->private);
if (!HAS_FBC(dev_priv)) {
-    seq_puts(m, "FBC unsupported on this chipset\n");
+    seq_puts(m, "not supported\n");
 return 0;
 }
@@ -1809,7 +1809,7 @@ static int i915_ring_freq_table(struct 
seq_file *m, void *unused)

 unsigned int max_gpu_freq, min_gpu_freq;
if (!HAS_LLC(dev_priv)) {
-    seq_puts(m, "unsupported on this chipset\n");
+    seq_puts(m, "not supported\n");
 return 0;
 }
@@ -2361,8 +2361,10 @@ static int i915_huc_load_status_info(struct 
seq_file *m, void *data)

 struct drm_i915_private *dev_priv = node_to_i915(m->private);
 struct drm_printer p;
-    if (!HAS_HUC_UCODE(dev_priv))
+    if (!HAS_GUC(dev_priv)) {


Hmm, I think that in above code we should use HAS_HUC defined as:

/* HuC is inherent part of the GuC ... */
#define HAS_HUC(dev_priv)    HAS_GUC(dev_priv)

to make it clear that code checks HuC sub-feature (not other part
of the GuC or GuC itself). And additionally we can use above define
to explicitly document relation between GuC and HuC.

Michal



The suggested comment feels confusing to me. HuC is a different 
microcontroller and not a part of GuC. The only tie the 2 have is 
that GuC needs to do the authentication. It is however true that any 
platform that has a GuC also has a HuC so the suggested define itself 
is fine.


Daniele


+    seq_puts(m, "not supported\n");
 return 0;
+    }
p = drm_seq_file_printer(m);
 intel_uc_fw_dump(&dev_priv->huc.fw, &p);
@@ -2380,8 +2382,10 @@ static int i915_guc_load_status_info(struct 
seq_file *m, void *data)

 struct drm_printer p;
 u32 tmp, i;
-    if (!HAS_GUC_UCODE(dev_priv))
+    if (!HAS_GUC(dev_priv)) {
+    seq_puts(m, "not supported\n");
 return 0;
+    }
p = drm_seq_file_printer(m);
 intel_uc_fw_dump(&dev_priv->guc.fw, &p);
@@ -2650,7 +2654,7 @@ static int i915_edp_psr_status(struct 
seq_file *m, void *data)

 bool enabled = false;
if (!HAS_PSR(dev_priv)) {
-    seq_puts(m, "PSR not supported\n");
+    seq_puts(m, "not supported\n");
 return 0;
 }

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

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




Thanks for the review,

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


Re: [Intel-gfx] [PATCH v8 1/6] drm/i915 : Unifying seq_puts messages for feature support

2017-10-31 Thread Sujaritha



On 10/25/2017 06:31 AM, Michal Wajdeczko wrote:
On Tue, 24 Oct 2017 19:21:20 +0200, Sujaritha Sundaresan 
 wrote:


Unifying the various seq_puts messages in debugfs to the simplest one 
for

feature support.

v2: Clarifying the commit message (Anusha)

v3: Re-factoring code as per review (Michal)

v4: Rebase

v5: Split from following patch

v6: Re-factoring code (Michal, Sagar)
    Clarifying commit message (Sagar)

v7: Generalizing subject to drm/i915 (Sagar)

v8: Omitting DRRS seq_puts unification (Michal)

Suggested by: Michal Wajdeczko 
Signed-off-by: Sujaritha Sundaresan 
Cc: Anusha Srivatsa 
Cc: Michal Wajdeczko 
Cc: Oscar Mateo 
Cc: Sagar Arun Kamble 
---
 drivers/gpu/drm/i915/i915_debugfs.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c

index c65e381..8edd029 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1641,7 +1641,7 @@ static int i915_fbc_status(struct seq_file *m, 
void *unused)

 struct drm_i915_private *dev_priv = node_to_i915(m->private);
if (!HAS_FBC(dev_priv)) {
-    seq_puts(m, "FBC unsupported on this chipset\n");
+    seq_puts(m, "not supported\n");
 return 0;
 }
@@ -1809,7 +1809,7 @@ static int i915_ring_freq_table(struct seq_file 
*m, void *unused)

 unsigned int max_gpu_freq, min_gpu_freq;
if (!HAS_LLC(dev_priv)) {
-    seq_puts(m, "unsupported on this chipset\n");
+    seq_puts(m, "not supported\n");
 return 0;
 }
@@ -2361,8 +2361,10 @@ static int i915_huc_load_status_info(struct 
seq_file *m, void *data)

 struct drm_i915_private *dev_priv = node_to_i915(m->private);
 struct drm_printer p;
-    if (!HAS_HUC_UCODE(dev_priv))
+    if (!HAS_GUC(dev_priv)) {


Hmm, I think that in above code we should use HAS_HUC defined as:

/* HuC is inherent part of the GuC ... */
#define HAS_HUC(dev_priv)    HAS_GUC(dev_priv)

to make it clear that code checks HuC sub-feature (not other part
of the GuC or GuC itself). And additionally we can use above define
to explicitly document relation between GuC and HuC.

Michal


Sure, I will include the HAS_HUC condition and a comment that clarifies 
the HuC and GuC tie in the next revision.



+    seq_puts(m, "not supported\n");
 return 0;
+    }
p = drm_seq_file_printer(m);
 intel_uc_fw_dump(&dev_priv->huc.fw, &p);
@@ -2380,8 +2382,10 @@ static int i915_guc_load_status_info(struct 
seq_file *m, void *data)

 struct drm_printer p;
 u32 tmp, i;
-    if (!HAS_GUC_UCODE(dev_priv))
+    if (!HAS_GUC(dev_priv)) {
+    seq_puts(m, "not supported\n");
 return 0;
+    }
p = drm_seq_file_printer(m);
 intel_uc_fw_dump(&dev_priv->guc.fw, &p);
@@ -2650,7 +2654,7 @@ static int i915_edp_psr_status(struct seq_file 
*m, void *data)

 bool enabled = false;
if (!HAS_PSR(dev_priv)) {
-    seq_puts(m, "PSR not supported\n");
+    seq_puts(m, "not supported\n");
 return 0;
 }


Thanks for the review.

Regards,

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


Re: [Intel-gfx] [PATCH v8 1/6] drm/i915 : Unifying seq_puts messages for feature support

2017-10-31 Thread Sujaritha



On 10/26/2017 10:54 AM, Daniele Ceraolo Spurio wrote:



On 25/10/17 06:31, Michal Wajdeczko wrote:
On Tue, 24 Oct 2017 19:21:20 +0200, Sujaritha Sundaresan 
 wrote:


Unifying the various seq_puts messages in debugfs to the simplest 
one for

feature support.

v2: Clarifying the commit message (Anusha)

v3: Re-factoring code as per review (Michal)

v4: Rebase

v5: Split from following patch

v6: Re-factoring code (Michal, Sagar)
    Clarifying commit message (Sagar)

v7: Generalizing subject to drm/i915 (Sagar)

v8: Omitting DRRS seq_puts unification (Michal)

Suggested by: Michal Wajdeczko 
Signed-off-by: Sujaritha Sundaresan 
Cc: Anusha Srivatsa 
Cc: Michal Wajdeczko 
Cc: Oscar Mateo 
Cc: Sagar Arun Kamble 
---
 drivers/gpu/drm/i915/i915_debugfs.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c

index c65e381..8edd029 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1641,7 +1641,7 @@ static int i915_fbc_status(struct seq_file *m, 
void *unused)

 struct drm_i915_private *dev_priv = node_to_i915(m->private);
if (!HAS_FBC(dev_priv)) {
-    seq_puts(m, "FBC unsupported on this chipset\n");
+    seq_puts(m, "not supported\n");
 return 0;
 }
@@ -1809,7 +1809,7 @@ static int i915_ring_freq_table(struct 
seq_file *m, void *unused)

 unsigned int max_gpu_freq, min_gpu_freq;
if (!HAS_LLC(dev_priv)) {
-    seq_puts(m, "unsupported on this chipset\n");
+    seq_puts(m, "not supported\n");
 return 0;
 }
@@ -2361,8 +2361,10 @@ static int i915_huc_load_status_info(struct 
seq_file *m, void *data)

 struct drm_i915_private *dev_priv = node_to_i915(m->private);
 struct drm_printer p;
-    if (!HAS_HUC_UCODE(dev_priv))
+    if (!HAS_GUC(dev_priv)) {


Hmm, I think that in above code we should use HAS_HUC defined as:

/* HuC is inherent part of the GuC ... */
#define HAS_HUC(dev_priv)    HAS_GUC(dev_priv)

to make it clear that code checks HuC sub-feature (not other part
of the GuC or GuC itself). And additionally we can use above define
to explicitly document relation between GuC and HuC.

Michal



The suggested comment feels confusing to me. HuC is a different 
microcontroller and not a part of GuC. The only tie the 2 have is that 
GuC needs to do the authentication. It is however true that any 
platform that has a GuC also has a HuC so the suggested define itself 
is fine.


Daniele



I agree. I will include the condition and a comment that clearly 
mentions the GuC and HuC tie.

+    seq_puts(m, "not supported\n");
 return 0;
+    }
p = drm_seq_file_printer(m);
 intel_uc_fw_dump(&dev_priv->huc.fw, &p);
@@ -2380,8 +2382,10 @@ static int i915_guc_load_status_info(struct 
seq_file *m, void *data)

 struct drm_printer p;
 u32 tmp, i;
-    if (!HAS_GUC_UCODE(dev_priv))
+    if (!HAS_GUC(dev_priv)) {
+    seq_puts(m, "not supported\n");
 return 0;
+    }
p = drm_seq_file_printer(m);
 intel_uc_fw_dump(&dev_priv->guc.fw, &p);
@@ -2650,7 +2654,7 @@ static int i915_edp_psr_status(struct seq_file 
*m, void *data)

 bool enabled = false;
if (!HAS_PSR(dev_priv)) {
-    seq_puts(m, "PSR not supported\n");
+    seq_puts(m, "not supported\n");
 return 0;
 }

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


Thanks for the review.

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


Re: [Intel-gfx] [PATCH 1/2] drm/i915: Runtime disable for eDP DRRS

2017-10-31 Thread Rodrigo Vivi
On Tue, Oct 31, 2017 at 09:20:42AM +, Ramalingam C wrote:
> From: "C, Ramalingam" 
> 
> Module parameter enable_drrs(Boolean flag) is added to control the
> eDP Idleness drrs enable flow.

This goes on the opposite direction of the current trends.

Well, I'm a big fan of the parameters, but there's a big effort
going on to remove all kernel parameters. I believe it will
be just a matter of time that we have to remove fbc and psr as well.
So probably not a good idea to add something now that we will
have to rework soon.

Maybe we could add a on/off toggle on DRRS now and then
when we remove the parameter for fbc and psr we also add toggles
on debugfs...

Thanks,
Rodrigo.

> 
> Modification to this module parameter will be considered on next
> eDP_DRRS enable flow. So after module parameter update, a modeset
> will help to modify the feature state as per the module parameter's
> current state.
> 
> Possibility of disabling the DRRS, enables the testing of the
> frontbuffer tracking based features (FBC, DRRS and PSR) as standalone
> or any combination of the set.
> 
> Signed-off-by: C, Ramalingam 
> ---
>  drivers/gpu/drm/i915/i915_params.c | 3 +++
>  drivers/gpu/drm/i915/i915_params.h | 3 ++-
>  drivers/gpu/drm/i915/intel_dp.c| 6 ++
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_params.c 
> b/drivers/gpu/drm/i915/i915_params.c
> index b4faeb6aa2bd..32f06bb74f9d 100644
> --- a/drivers/gpu/drm/i915/i915_params.c
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -190,3 +190,6 @@ i915_param_named(enable_dpcd_backlight, bool, 0600,
>  
>  i915_param_named(enable_gvt, bool, 0400,
>   "Enable support for Intel GVT-g graphics virtualization host 
> support(default:false)");
> +
> +i915_param_named_unsafe(enable_drrs, bool, 0600,
> + "Enable DRRS. (True=Enabled, False=Disabled [Default])");
> diff --git a/drivers/gpu/drm/i915/i915_params.h 
> b/drivers/gpu/drm/i915/i915_params.h
> index c7292268ed43..3c6fdce1c122 100644
> --- a/drivers/gpu/drm/i915/i915_params.h
> +++ b/drivers/gpu/drm/i915/i915_params.h
> @@ -67,7 +67,8 @@
>   param(bool, nuclear_pageflip, false) \
>   param(bool, enable_dp_mst, true) \
>   param(bool, enable_dpcd_backlight, false) \
> - param(bool, enable_gvt, false)
> + param(bool, enable_gvt, false) \
> + param(bool, enable_drrs, false)
>  
>  #define MEMBER(T, member, ...) T member;
>  struct i915_params {
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index ca48bce23a6f..ff9964cf15cd 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -5568,6 +5568,11 @@ void intel_edp_drrs_enable(struct intel_dp *intel_dp,
>   return;
>   }
>  
> + if (!i915_modparams.enable_drrs) {
> + DRM_DEBUG_KMS("DRRS is disabled from modparams\n");
> + return;
> + }
> +
>   mutex_lock(&dev_priv->drrs.mutex);
>   if (WARN_ON(dev_priv->drrs.dp)) {
>   DRM_ERROR("DRRS already enabled\n");
> @@ -5817,6 +5822,7 @@ intel_dp_drrs_init(struct intel_connector 
> *intel_connector,
>   }
>  
>   dev_priv->drrs.type = dev_priv->vbt.drrs_type;
> + i915_modparams.enable_drrs = true;
>  
>   dev_priv->drrs.refresh_rate_type = DRRS_HIGH_RR;
>   DRM_DEBUG_KMS("seamless DRRS supported for eDP panel.\n");
> -- 
> 2.7.4
> 
___
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/cnl: Remove unnecessary check in cnl_setup_private_ppat

2017-10-31 Thread Patchwork
== Series Details ==

Series: drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat
URL   : https://patchwork.freedesktop.org/series/32792/
State : success

== Summary ==

Series 32792v1 drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat
https://patchwork.freedesktop.org/api/1.0/series/32792/revisions/1/mbox/

Test gem_mmap_gtt:
Subgroup basic-read-no-prefault:
dmesg-warn -> PASS   (fi-bsw-n3050)
Test kms_addfb_basic:
Subgroup invalid-set-prop:
incomplete -> PASS   (fi-cnl-y)
Test kms_flip:
Subgroup basic-flip-vs-dpms:
notrun -> INCOMPLETE (fi-cnl-y)

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:438s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:449s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:378s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:544s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:276s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:514s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:504s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:505s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:495s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:554s
fi-cnl-y total:217  pass:196  dwarn:0   dfail:0   fail:0   skip:20 
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:429s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:263s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:589s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:489s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:432s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:431s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:430s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:499s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:465s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:485s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:573s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:479s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:588s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:569s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:468s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:597s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:649s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:519s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:502s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:458s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:569s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:421s

411ec53a58b3cf22efe7e8c7e6af94945c15568d drm-tip: 2017y-10m-31d-18h-16m-29s UTC 
integration manifest
09a3dfdecca8 drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat

== Logs ==

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


Re: [Intel-gfx] [PATCH 1/2] drm/i915: Pass around crtc and connector states for audio

2017-10-31 Thread Ville Syrjälä
On Tue, Oct 31, 2017 at 11:19:03AM +0200, Jani Nikula wrote:
> On Mon, 30 Oct 2017, Ville Syrjala  wrote:
> > From: Ville Syrjälä 
> >
> > Explicitly pass the crtc and connector states into the audio
> > code enable/disable hooks, and plumb them all the way down.
> >
> > This gets rid of almost all crtc->config and encoder->crtc
> > uses. The one place where we still use them is
> > i915_audio_component_sync_audio_rate() since that gets called from
> > the audio driver and we don't have explicit states around then.
> 
> What a tedious patch to review!
> 
> On both,
> 
> Reviewed-by: Jani Nikula 

Thanks for suffering through the tedium. Series pushed to dinq.

> 
> 
> >
> > Cc: Jani Nikula 
> > Signed-off-by: Ville Syrjälä 
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h |  10 +-
> >  drivers/gpu/drm/i915/intel_audio.c  | 202 
> > 
> >  drivers/gpu/drm/i915/intel_ddi.c|   6 +-
> >  drivers/gpu/drm/i915/intel_dp.c |   3 +-
> >  drivers/gpu/drm/i915/intel_dp_mst.c |   3 +-
> >  drivers/gpu/drm/i915/intel_drv.h|   4 +-
> >  drivers/gpu/drm/i915/intel_hdmi.c   |   6 +-
> >  7 files changed, 132 insertions(+), 102 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h 
> > b/drivers/gpu/drm/i915/i915_drv.h
> > index 4a7325c4189c..c10fece58e86 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -726,10 +726,12 @@ struct drm_i915_display_funcs {
> > void (*crtc_disable)(struct intel_crtc_state *old_crtc_state,
> >  struct drm_atomic_state *old_state);
> > void (*update_crtcs)(struct drm_atomic_state *state);
> > -   void (*audio_codec_enable)(struct drm_connector *connector,
> > -  struct intel_encoder *encoder,
> > -  const struct drm_display_mode 
> > *adjusted_mode);
> > -   void (*audio_codec_disable)(struct intel_encoder *encoder);
> > +   void (*audio_codec_enable)(struct intel_encoder *encoder,
> > +  const struct intel_crtc_state *crtc_state,
> > +  const struct drm_connector_state 
> > *conn_state);
> > +   void (*audio_codec_disable)(struct intel_encoder *encoder,
> > +   const struct intel_crtc_state 
> > *old_crtc_state,
> > +   const struct drm_connector_state 
> > *old_conn_state);
> > void (*fdi_link_train)(struct intel_crtc *crtc,
> >const struct intel_crtc_state *crtc_state);
> > void (*init_clock_gating)(struct drm_i915_private *dev_priv);
> > diff --git a/drivers/gpu/drm/i915/intel_audio.c 
> > b/drivers/gpu/drm/i915/intel_audio.c
> > index 0ddba16fde1b..e56520037270 100644
> > --- a/drivers/gpu/drm/i915/intel_audio.c
> > +++ b/drivers/gpu/drm/i915/intel_audio.c
> > @@ -102,13 +102,13 @@ static const struct dp_aud_n_m dp_aud_n_m[] = {
> >  };
> >  
> >  static const struct dp_aud_n_m *
> > -audio_config_dp_get_n_m(struct intel_crtc *intel_crtc, int rate)
> > +audio_config_dp_get_n_m(const struct intel_crtc_state *crtc_state, int 
> > rate)
> >  {
> > int i;
> >  
> > for (i = 0; i < ARRAY_SIZE(dp_aud_n_m); i++) {
> > if (rate == dp_aud_n_m[i].sample_rate &&
> > -   intel_crtc->config->port_clock == dp_aud_n_m[i].clock)
> > +   crtc_state->port_clock == dp_aud_n_m[i].clock)
> > return &dp_aud_n_m[i];
> > }
> >  
> > @@ -157,8 +157,10 @@ static const struct {
> >  };
> >  
> >  /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
> > -static u32 audio_config_hdmi_pixel_clock(const struct drm_display_mode 
> > *adjusted_mode)
> > +static u32 audio_config_hdmi_pixel_clock(const struct intel_crtc_state 
> > *crtc_state)
> >  {
> > +   const struct drm_display_mode *adjusted_mode =
> > +   &crtc_state->base.adjusted_mode;
> > int i;
> >  
> > for (i = 0; i < ARRAY_SIZE(hdmi_audio_clock); i++) {
> > @@ -179,9 +181,11 @@ static u32 audio_config_hdmi_pixel_clock(const struct 
> > drm_display_mode *adjusted
> > return hdmi_audio_clock[i].config;
> >  }
> >  
> > -static int audio_config_hdmi_get_n(const struct drm_display_mode 
> > *adjusted_mode,
> > +static int audio_config_hdmi_get_n(const struct intel_crtc_state 
> > *crtc_state,
> >int rate)
> >  {
> > +   const struct drm_display_mode *adjusted_mode =
> > +   &crtc_state->base.adjusted_mode;
> > int i;
> >  
> > for (i = 0; i < ARRAY_SIZE(hdmi_aud_ncts); i++) {
> > @@ -220,7 +224,9 @@ static bool intel_eld_uptodate(struct drm_connector 
> > *connector,
> > return true;
> >  }
> >  
> > -static void g4x_audio_codec_disable(struct intel_encoder *encoder)
> > +static void g4x_audio_codec_disable(struct intel_encoder *encoder,
> > +   const struct intel_crtc_state 
> > *old_crtc_state,
> > +   const struct drm_connector_st

[Intel-gfx] [PATCH 00/10] drm/i915: Nuke dig_port->port and assorted cleanups

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

The main attraction of this series is removal of
intel_digital_port->port. Ever since the introduction of
intel_encoder->port it has been redundant, and I figured
it's high time we kill it.

The other stuff is mostly elimination of uses of the
legacy encoder->crtc pointer and intel_crtc->config. While those
do still work we do kinda want to kill them off, and instead use
the proper atomic states instead. Having multiple ways to do things
also tends to confuse people so the sooner we get this cleaned utp
the better. I think I mostly got the the encoder side done now,
apart from link training related code which will need more thought.

Entire series available here:
git://github.com/vsyrjala/linux.git nuke_dig_port_port_4

Ville Syrjälä (10):
  drm/i915: Eliminate some encoder->crtc usage from DP code
  drm/i915: Eliminate some encoder->crtc usage from DSI code
  drm/i915: Eliminate some encoder->crtc usage from SDVO code
  drm/i915: Eliminate some encoder->crtc usage from TV code
  drm/i915: Pass crtc state to DPIO PHY functions
  drm/i915: Eliminate crtc->config usage from CRT code
  drm/i915: Replace dig_port->port with encoder port for BXT DPLL
selection
  drm/i915: Nuke intel_digital_port->port
  drm/i915: Clean up PPS code calling conventions
  drm/i915: Clean up DP code local variables and calling conventions

 drivers/gpu/drm/i915/i915_debugfs.c   |   2 +-
 drivers/gpu/drm/i915/i915_drv.h   |  19 +-
 drivers/gpu/drm/i915/intel_crt.c  |  44 ++--
 drivers/gpu/drm/i915/intel_ddi.c  |  13 +-
 drivers/gpu/drm/i915/intel_display.c  |  13 +-
 drivers/gpu/drm/i915/intel_dp.c   | 432 +++---
 drivers/gpu/drm/i915/intel_dp_mst.c   |   6 +-
 drivers/gpu/drm/i915/intel_dpio_phy.c |  99 
 drivers/gpu/drm/i915/intel_dpll_mgr.c |  10 +-
 drivers/gpu/drm/i915/intel_drv.h  |   5 +-
 drivers/gpu/drm/i915/intel_dsi.c  |  17 +-
 drivers/gpu/drm/i915/intel_hdmi.c |  34 ++-
 drivers/gpu/drm/i915/intel_pipe_crc.c |   4 +-
 drivers/gpu/drm/i915/intel_psr.c  |   4 +-
 drivers/gpu/drm/i915/intel_sdvo.c |   4 +-
 drivers/gpu/drm/i915/intel_tv.c   |   4 +-
 16 files changed, 316 insertions(+), 394 deletions(-)

-- 
2.13.6

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


[Intel-gfx] [PATCH 03/10] drm/i915: Eliminate some encoder->crtc usage from SDVO code

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

Extract the current crtc from the crtc state rather than via
the legacy encoder->crtc pointer whenever possible.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_sdvo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c 
b/drivers/gpu/drm/i915/intel_sdvo.c
index 42ec2d1f7a61..2b8764897d68 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1512,7 +1512,7 @@ static void intel_disable_sdvo(struct intel_encoder 
*encoder,
 {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
-   struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
+   struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
u32 temp;
 
intel_sdvo_set_active_outputs(intel_sdvo, 0);
@@ -1571,7 +1571,7 @@ static void intel_enable_sdvo(struct intel_encoder 
*encoder,
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
-   struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
+   struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->base.crtc);
u32 temp;
bool input1, input2;
int i;
-- 
2.13.6

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


[Intel-gfx] [PATCH 01/10] drm/i915: Eliminate some encoder->crtc usage from DP code

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

Extract the current crtc from the crtc state rather than via
the legacy encoder->crtc pointer whenever possible.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_dp.c | 63 +++--
 1 file changed, 29 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index d27c0145ac91..4f64d83537d9 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -129,10 +129,12 @@ static struct intel_dp *intel_attached_dp(struct 
drm_connector *connector)
return enc_to_intel_dp(&intel_attached_encoder(connector)->base);
 }
 
-static void intel_dp_link_down(struct intel_dp *intel_dp);
+static void intel_dp_link_down(struct intel_encoder *encoder,
+  const struct intel_crtc_state *old_crtc_state);
 static bool edp_panel_vdd_on(struct intel_dp *intel_dp);
 static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
-static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
+static void vlv_init_panel_power_sequencer(struct intel_encoder *encoder,
+  const struct intel_crtc_state 
*crtc_state);
 static void vlv_steal_power_sequencer(struct drm_device *dev,
  enum pipe pipe);
 static void intel_dp_unset_edid(struct intel_dp *intel_dp);
@@ -1858,7 +1860,7 @@ static void intel_dp_prepare(struct intel_encoder 
*encoder,
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
enum port port = dp_to_dig_port(intel_dp)->port;
-   struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
+   struct intel_crtc *crtc = to_intel_crtc(pipe_config->base.crtc);
const struct drm_display_mode *adjusted_mode = 
&pipe_config->base.adjusted_mode;
 
intel_dp_set_link_params(intel_dp, pipe_config->port_clock,
@@ -2491,10 +2493,10 @@ static void ironlake_edp_pll_on(struct intel_dp 
*intel_dp,
udelay(200);
 }
 
-static void ironlake_edp_pll_off(struct intel_dp *intel_dp)
+static void ironlake_edp_pll_off(struct intel_dp *intel_dp,
+const struct intel_crtc_state *old_crtc_state)
 {
-   struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-   struct intel_crtc *crtc = to_intel_crtc(intel_dig_port->base.base.crtc);
+   struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
 
assert_pipe_disabled(dev_priv, crtc->pipe);
@@ -2624,7 +2626,7 @@ static void intel_dp_get_config(struct intel_encoder 
*encoder,
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev);
enum port port = dp_to_dig_port(intel_dp)->port;
-   struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
+   struct intel_crtc *crtc = to_intel_crtc(pipe_config->base.crtc);
 
if (encoder->type == INTEL_OUTPUT_EDP)
pipe_config->output_types |= BIT(INTEL_OUTPUT_EDP);
@@ -2723,12 +2725,10 @@ static void g4x_disable_dp(struct intel_encoder 
*encoder,
   const struct intel_crtc_state *old_crtc_state,
   const struct drm_connector_state *old_conn_state)
 {
-   struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
-
intel_disable_dp(encoder, old_crtc_state, old_conn_state);
 
/* disable the port before the pipe on g4x */
-   intel_dp_link_down(intel_dp);
+   intel_dp_link_down(encoder, old_crtc_state);
 }
 
 static void ilk_disable_dp(struct intel_encoder *encoder,
@@ -2754,33 +2754,29 @@ static void ilk_post_disable_dp(struct intel_encoder 
*encoder,
const struct drm_connector_state 
*old_conn_state)
 {
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
-   enum port port = dp_to_dig_port(intel_dp)->port;
+   enum port port = encoder->port;
 
-   intel_dp_link_down(intel_dp);
+   intel_dp_link_down(encoder, old_crtc_state);
 
/* Only ilk+ has port A */
if (port == PORT_A)
-   ironlake_edp_pll_off(intel_dp);
+   ironlake_edp_pll_off(intel_dp, old_crtc_state);
 }
 
 static void vlv_post_disable_dp(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state 
*old_conn_state)
 {
-   struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
-
-   intel_dp_link_down(intel_dp);
+   intel_dp_link_down(encoder, old_crtc_state);
 }
 
 static void chv_post_disable_dp(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state 
*old_conn_state)
 {
-

[Intel-gfx] [PATCH 04/10] drm/i915: Eliminate some encoder->crtc usage from TV code

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

Extract the current crtc from the crtc state rather than via
the legacy encoder->crtc pointer whenever possible.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_tv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index b18609cebe03..b3dabc219e6a 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -822,7 +822,7 @@ intel_enable_tv(struct intel_encoder *encoder,
 
/* Prevents vblank waits from timing out in intel_tv_detect_type() */
intel_wait_for_vblank(dev_priv,
- to_intel_crtc(encoder->base.crtc)->pipe);
+ to_intel_crtc(pipe_config->base.crtc)->pipe);
 
I915_WRITE(TV_CTL, I915_READ(TV_CTL) | TV_ENC_ENABLE);
 }
@@ -982,7 +982,7 @@ static void intel_tv_pre_enable(struct intel_encoder 
*encoder,
const struct drm_connector_state *conn_state)
 {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-   struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
+   struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->base.crtc);
struct intel_tv *intel_tv = enc_to_tv(encoder);
const struct tv_mode *tv_mode = intel_tv_mode_find(conn_state);
u32 tv_ctl;
-- 
2.13.6

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


[Intel-gfx] [PATCH 07/10] drm/i915: Replace dig_port->port with encoder port for BXT DPLL selection

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

Replace dig_port->port with encoder->port in the BXT DPLL selection.
We can do this because both the master encoder and the fake MST encoders
have the same encoder->port value, whereas using dig_port->port only
worked for the master encoder since the fake encoders were't derived
from intel_digital_port. This eliminates the DP MST special case.

Do this by hand because spatch is having problems with the control
flow due to the dig_port assignment happening in two different
branches.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_dpll_mgr.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c 
b/drivers/gpu/drm/i915/intel_dpll_mgr.c
index a83bf1c38e05..be74d4767c8a 100644
--- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
+++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
@@ -1802,7 +1802,6 @@ bxt_get_dpll(struct intel_crtc *crtc,
 {
struct intel_dpll_hw_state dpll_hw_state = { };
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
-   struct intel_digital_port *intel_dig_port;
struct intel_shared_dpll *pll;
int i, clock = crtc_state->port_clock;
 
@@ -1820,15 +1819,8 @@ bxt_get_dpll(struct intel_crtc *crtc,
 
crtc_state->dpll_hw_state = dpll_hw_state;
 
-   if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST)) {
-   struct intel_dp_mst_encoder *intel_mst = 
enc_to_mst(&encoder->base);
-
-   intel_dig_port = intel_mst->primary;
-   } else
-   intel_dig_port = enc_to_dig_port(&encoder->base);
-
/* 1:1 mapping between ports and PLLs */
-   i = (enum intel_dpll_id) intel_dig_port->port;
+   i = (enum intel_dpll_id) encoder->port;
pll = intel_get_shared_dpll_by_id(dev_priv, i);
 
DRM_DEBUG_KMS("[CRTC:%d:%s] using pre-allocated %s\n",
-- 
2.13.6

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


[Intel-gfx] [PATCH 08/10] drm/i915: Nuke intel_digital_port->port

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

Remove intel_digital_port->port and replace its users with
intel_encoder->port. intel_encoder->port is a superset of
intel_digital_port->port, and it works correctly even for
MST encoders.

Performed with cocci:
@@
@@
struct intel_digital_port {
   ...
-   enum port port;
   ...
}

@@
struct intel_digital_port *D;
expression E;
@@
- D->port = E;

@@
struct intel_digital_port *D;
@@
- D->port
+ D->base.port

@@
expression E;
@@
(
- dp_to_dig_port(E)->port
+ dp_to_dig_port(E)->base.port
|
- enc_to_dig_port(E)->port
+ to_intel_encoder(E)->port
)

@@
expression E;
@@
- to_intel_encoder(&E->base)
+ E

@@
struct intel_digital_port *D;
identifier I, M;
@@
  I = &D->base
<...
(
- D->base.M
+ I->M
|
- &D->base
+ I
)
...>

@@
identifier D;
expression E;
identifier M;
@@
 D = enc_to_dig_port(&E->base)
<...
(
- D->base.M
+ E->M
|
- &D->base
+ E
)
...>

@@
expression E;
identifier M;
@@
(
- enc_to_dig_port(&E->base)->base.M
+ E->M
|
- enc_to_dig_port(&E->base)->base
+ E
|
- enc_to_mst(&E->base)->primary->base.port
+ E->port
)

@@
expression E;
identifier D;
@@
- struct intel_digital_port *D = E;
... when != D

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/i915_debugfs.c   |   2 +-
 drivers/gpu/drm/i915/intel_ddi.c  |  13 ++---
 drivers/gpu/drm/i915/intel_display.c  |  13 +++--
 drivers/gpu/drm/i915/intel_dp.c   | 103 +-
 drivers/gpu/drm/i915/intel_dp_mst.c   |   6 +-
 drivers/gpu/drm/i915/intel_dpio_phy.c |  12 ++--
 drivers/gpu/drm/i915/intel_drv.h  |   5 +-
 drivers/gpu/drm/i915/intel_hdmi.c |  17 +++---
 drivers/gpu/drm/i915/intel_pipe_crc.c |   4 +-
 drivers/gpu/drm/i915/intel_psr.c  |   4 +-
 10 files changed, 87 insertions(+), 92 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 39883cd915db..d89321f0468c 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -3603,7 +3603,7 @@ static int i915_dp_mst_info(struct seq_file *m, void 
*unused)
continue;
 
seq_printf(m, "MST Source Port %c\n",
-  port_name(intel_dig_port->port));
+  port_name(intel_dig_port->base.port));
drm_dp_mst_dump_topology(m, &intel_dig_port->dp.mst_mgr);
}
drm_connector_list_iter_end(&conn_iter);
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index ace674cd79b9..65ab55496ab7 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1801,8 +1801,8 @@ static void skl_ddi_set_iboost(struct intel_encoder 
*encoder,
   int level, enum intel_output_type type)
 {
struct intel_digital_port *intel_dig_port = 
enc_to_dig_port(&encoder->base);
-   struct drm_i915_private *dev_priv = 
to_i915(intel_dig_port->base.base.dev);
-   enum port port = intel_dig_port->port;
+   struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+   enum port port = encoder->port;
uint8_t iboost;
 
if (type == INTEL_OUTPUT_HDMI)
@@ -2470,7 +2470,7 @@ void intel_ddi_prepare_link_retrain(struct intel_dp 
*intel_dp)
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
struct drm_i915_private *dev_priv =
to_i915(intel_dig_port->base.base.dev);
-   enum port port = intel_dig_port->port;
+   enum port port = intel_dig_port->base.port;
uint32_t val;
bool wait = false;
 
@@ -2698,7 +2698,7 @@ static struct intel_connector *
 intel_ddi_init_dp_connector(struct intel_digital_port *intel_dig_port)
 {
struct intel_connector *connector;
-   enum port port = intel_dig_port->port;
+   enum port port = intel_dig_port->base.port;
 
connector = intel_connector_alloc();
if (!connector)
@@ -2717,7 +2717,7 @@ static struct intel_connector *
 intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)
 {
struct intel_connector *connector;
-   enum port port = intel_dig_port->port;
+   enum port port = intel_dig_port->base.port;
 
connector = intel_connector_alloc();
if (!connector)
@@ -2733,7 +2733,7 @@ static bool intel_ddi_a_force_4_lanes(struct 
intel_digital_port *dport)
 {
struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
 
-   if (dport->port != PORT_A)
+   if (dport->base.port != PORT_A)
return false;
 
if (dport->saved_port_bits & DDI_A_4_LANES)
@@ -2836,7 +2836,6 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, 
enum port port)
intel_encoder->suspend = intel_dp_encoder_suspend;
intel_encoder->get_power_domains = intel_ddi_get_power_domains;
 
-   intel_dig_port->port = port;
intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &
  (DDI_BUF_PORT_REVERSAL |

[Intel-gfx] [PATCH 10/10] drm/i915: Clean up DP code local variables and calling conventions

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

Eliminate a ton of pointless 'dev' variables in the DP code, and pass
around 'dev_priv' instead of 'dev'.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_dp.c | 151 ++--
 1 file changed, 54 insertions(+), 97 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f875ba78c435..30ac187b2b97 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -438,10 +438,7 @@ intel_dp_pps_init(struct intel_dp *intel_dp);
 
 static void pps_lock(struct intel_dp *intel_dp)
 {
-   struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-   struct intel_encoder *encoder = &intel_dig_port->base;
-   struct drm_device *dev = encoder->base.dev;
-   struct drm_i915_private *dev_priv = to_i915(dev);
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
 
/*
 * See vlv_power_sequencer_reset() why we need
@@ -454,10 +451,7 @@ static void pps_lock(struct intel_dp *intel_dp)
 
 static void pps_unlock(struct intel_dp *intel_dp)
 {
-   struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-   struct intel_encoder *encoder = &intel_dig_port->base;
-   struct drm_device *dev = encoder->base.dev;
-   struct drm_i915_private *dev_priv = to_i915(dev);
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
 
mutex_unlock(&dev_priv->pps_mutex);
 
@@ -467,8 +461,8 @@ static void pps_unlock(struct intel_dp *intel_dp)
 static void
 vlv_power_sequencer_kick(struct intel_dp *intel_dp)
 {
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-   struct drm_i915_private *dev_priv = 
to_i915(intel_dig_port->base.base.dev);
enum pipe pipe = intel_dp->pps_pipe;
bool pll_enabled, release_cl_override = false;
enum dpio_phy phy = DPIO_PHY(pipe);
@@ -733,7 +727,6 @@ vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp)
 
 void intel_power_sequencer_reset(struct drm_i915_private *dev_priv)
 {
-   struct drm_device *dev = &dev_priv->drm;
struct intel_encoder *encoder;
 
if (WARN_ON(!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv) &&
@@ -750,7 +743,7 @@ void intel_power_sequencer_reset(struct drm_i915_private 
*dev_priv)
 * should use them always.
 */
 
-   for_each_intel_encoder(dev, encoder) {
+   for_each_intel_encoder(&dev_priv->drm, encoder) {
struct intel_dp *intel_dp;
 
if (encoder->type != INTEL_OUTPUT_DP &&
@@ -832,8 +825,7 @@ static int edp_notify_handler(struct notifier_block *this, 
unsigned long code,
 {
struct intel_dp *intel_dp = container_of(this, typeof(* intel_dp),
 edp_notifier);
-   struct drm_device *dev = intel_dp_to_dev(intel_dp);
-   struct drm_i915_private *dev_priv = to_i915(dev);
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
 
if (!intel_dp_is_edp(intel_dp) || code != SYS_RESTART)
return 0;
@@ -863,8 +855,7 @@ static int edp_notify_handler(struct notifier_block *this, 
unsigned long code,
 
 static bool edp_have_panel_power(struct intel_dp *intel_dp)
 {
-   struct drm_device *dev = intel_dp_to_dev(intel_dp);
-   struct drm_i915_private *dev_priv = to_i915(dev);
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
 
lockdep_assert_held(&dev_priv->pps_mutex);
 
@@ -877,8 +868,7 @@ static bool edp_have_panel_power(struct intel_dp *intel_dp)
 
 static bool edp_have_panel_vdd(struct intel_dp *intel_dp)
 {
-   struct drm_device *dev = intel_dp_to_dev(intel_dp);
-   struct drm_i915_private *dev_priv = to_i915(dev);
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
 
lockdep_assert_held(&dev_priv->pps_mutex);
 
@@ -892,8 +882,7 @@ static bool edp_have_panel_vdd(struct intel_dp *intel_dp)
 static void
 intel_dp_check_edp(struct intel_dp *intel_dp)
 {
-   struct drm_device *dev = intel_dp_to_dev(intel_dp);
-   struct drm_i915_private *dev_priv = to_i915(dev);
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
 
if (!intel_dp_is_edp(intel_dp))
return;
@@ -909,9 +898,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp)
 static uint32_t
 intel_dp_aux_wait_done(struct intel_dp *intel_dp, bool has_aux_irq)
 {
-   struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-   struct drm_device *dev = intel_dig_port->base.base.dev;
-   struct drm_i915_private *dev_priv = to_i915(dev);
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
i915_reg_t ch_ctl = intel_dp->aux_ch_ctl_reg;
uint32_t status;
bool done;
@@ -1478,

[Intel-gfx] [PATCH 02/10] drm/i915: Eliminate some encoder->crtc usage from DSI code

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

Extract the current crtc from the crtc state rather than via
the legacy encoder->crtc pointer whenever possible.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_dsi.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 2bff7ab25bf3..f09474b0c4d3 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -662,11 +662,11 @@ static void vlv_dsi_clear_device_ready(struct 
intel_encoder *encoder)
}
 }
 
-static void intel_dsi_port_enable(struct intel_encoder *encoder)
+static void intel_dsi_port_enable(struct intel_encoder *encoder,
+ const struct intel_crtc_state *crtc_state)
 {
-   struct drm_device *dev = encoder->base.dev;
-   struct drm_i915_private *dev_priv = to_i915(dev);
-   struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
+   struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+   struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
enum port port;
 
@@ -705,7 +705,7 @@ static void intel_dsi_port_enable(struct intel_encoder 
*encoder)
if (IS_BROXTON(dev_priv))
temp |= LANE_CONFIGURATION_DUAL_LINK_A;
else
-   temp |= intel_crtc->pipe ?
+   temp |= crtc->pipe ?
LANE_CONFIGURATION_DUAL_LINK_B :
LANE_CONFIGURATION_DUAL_LINK_A;
}
@@ -875,7 +875,7 @@ static void intel_dsi_pre_enable(struct intel_encoder 
*encoder,
 
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);
 
-   intel_dsi_port_enable(encoder);
+   intel_dsi_port_enable(encoder, pipe_config);
}
 
intel_panel_enable_backlight(pipe_config, conn_state);
@@ -1082,7 +1082,7 @@ static void bxt_dsi_get_pipe_config(struct intel_encoder 
*encoder,
struct drm_display_mode *adjusted_mode =
&pipe_config->base.adjusted_mode;
struct drm_display_mode *adjusted_mode_sw;
-   struct intel_crtc *intel_crtc;
+   struct intel_crtc *crtc = to_intel_crtc(pipe_config->base.crtc);
struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
unsigned int lane_count = intel_dsi->lane_count;
unsigned int bpp, fmt;
@@ -1093,8 +1093,7 @@ static void bxt_dsi_get_pipe_config(struct intel_encoder 
*encoder,
crtc_hblank_start_sw, crtc_hblank_end_sw;
 
/* FIXME: hw readout should not depend on SW state */
-   intel_crtc = to_intel_crtc(encoder->base.crtc);
-   adjusted_mode_sw = &intel_crtc->config->base.adjusted_mode;
+   adjusted_mode_sw = &crtc->config->base.adjusted_mode;
 
/*
 * Atleast one port is active as encoder->get_config called only if
-- 
2.13.6

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


[Intel-gfx] [PATCH 06/10] drm/i915: Eliminate crtc->config usage from CRT code

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

Replace crtc->config usage with the passed down crtc state.

Also take the opportunity for some s/pipe_config/crtc_state/ while at it.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_crt.c | 44 +---
 1 file changed, 19 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 9c000ac612da..9f31aea51dff 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -219,11 +219,9 @@ static void hsw_disable_crt(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state)
 {
-   struct drm_crtc *crtc = old_crtc_state->base.crtc;
-   struct drm_i915_private *dev_priv = to_i915(crtc->dev);
-   struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+   struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 
-   WARN_ON(!intel_crtc->config->has_pch_encoder);
+   WARN_ON(!old_crtc_state->has_pch_encoder);
 
intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, false);
 }
@@ -247,46 +245,42 @@ static void hsw_post_disable_crt(struct intel_encoder 
*encoder,
 }
 
 static void hsw_pre_pll_enable_crt(struct intel_encoder *encoder,
-  const struct intel_crtc_state *pipe_config,
+  const struct intel_crtc_state *crtc_state,
   const struct drm_connector_state *conn_state)
 {
-   struct drm_crtc *crtc = pipe_config->base.crtc;
-   struct drm_i915_private *dev_priv = to_i915(crtc->dev);
-   struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+   struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 
-   WARN_ON(!intel_crtc->config->has_pch_encoder);
+   WARN_ON(!crtc_state->has_pch_encoder);
 
intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, false);
 }
 
 static void hsw_pre_enable_crt(struct intel_encoder *encoder,
-  const struct intel_crtc_state *pipe_config,
+  const struct intel_crtc_state *crtc_state,
   const struct drm_connector_state *conn_state)
 {
-   struct drm_crtc *crtc = pipe_config->base.crtc;
-   struct drm_i915_private *dev_priv = to_i915(crtc->dev);
-   struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-   int pipe = intel_crtc->pipe;
+   struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+   struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
+   enum pipe pipe = crtc->pipe;
 
-   WARN_ON(!intel_crtc->config->has_pch_encoder);
+   WARN_ON(!crtc_state->has_pch_encoder);
 
intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
 
-   dev_priv->display.fdi_link_train(intel_crtc, pipe_config);
+   dev_priv->display.fdi_link_train(crtc, crtc_state);
 }
 
 static void hsw_enable_crt(struct intel_encoder *encoder,
-  const struct intel_crtc_state *pipe_config,
+  const struct intel_crtc_state *crtc_state,
   const struct drm_connector_state *conn_state)
 {
-   struct drm_crtc *crtc = pipe_config->base.crtc;
-   struct drm_i915_private *dev_priv = to_i915(crtc->dev);
-   struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-   int pipe = intel_crtc->pipe;
+   struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+   struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
+   enum pipe pipe = crtc->pipe;
 
-   WARN_ON(!intel_crtc->config->has_pch_encoder);
+   WARN_ON(!crtc_state->has_pch_encoder);
 
-   intel_crt_set_dpms(encoder, pipe_config, DRM_MODE_DPMS_ON);
+   intel_crt_set_dpms(encoder, crtc_state, DRM_MODE_DPMS_ON);
 
intel_wait_for_vblank(dev_priv, pipe);
intel_wait_for_vblank(dev_priv, pipe);
@@ -295,10 +289,10 @@ static void hsw_enable_crt(struct intel_encoder *encoder,
 }
 
 static void intel_enable_crt(struct intel_encoder *encoder,
-const struct intel_crtc_state *pipe_config,
+const struct intel_crtc_state *crtc_state,
 const struct drm_connector_state *conn_state)
 {
-   intel_crt_set_dpms(encoder, pipe_config, DRM_MODE_DPMS_ON);
+   intel_crt_set_dpms(encoder, crtc_state, DRM_MODE_DPMS_ON);
 }
 
 static enum drm_mode_status
-- 
2.13.6

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


[Intel-gfx] [PATCH 09/10] drm/i915: Clean up PPS code calling conventions

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

No need to pass 'dev' or 'dev_priv' when the function already takes
'intel_dp'. Also let's prefer passing 'dev_priv' instead of 'dev'
when we have to pass one or the other.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_dp.c | 99 +
 1 file changed, 42 insertions(+), 57 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b81535fdef1d..f875ba78c435 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -135,7 +135,7 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp);
 static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
 static void vlv_init_panel_power_sequencer(struct intel_encoder *encoder,
   const struct intel_crtc_state 
*crtc_state);
-static void vlv_steal_power_sequencer(struct drm_device *dev,
+static void vlv_steal_power_sequencer(struct drm_i915_private *dev_priv,
  enum pipe pipe);
 static void intel_dp_unset_edid(struct intel_dp *intel_dp);
 
@@ -429,14 +429,12 @@ static void intel_dp_unpack_aux(uint32_t src, uint8_t 
*dst, int dst_bytes)
 }
 
 static void
-intel_dp_init_panel_power_sequencer(struct drm_device *dev,
-   struct intel_dp *intel_dp);
+intel_dp_init_panel_power_sequencer(struct intel_dp *intel_dp);
 static void
-intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev,
- struct intel_dp *intel_dp,
+intel_dp_init_panel_power_sequencer_registers(struct intel_dp *intel_dp,
  bool force_disable_vdd);
 static void
-intel_dp_pps_init(struct drm_device *dev, struct intel_dp *intel_dp);
+intel_dp_pps_init(struct intel_dp *intel_dp);
 
 static void pps_lock(struct intel_dp *intel_dp)
 {
@@ -580,9 +578,8 @@ static enum pipe vlv_find_free_pps(struct drm_i915_private 
*dev_priv)
 static enum pipe
 vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
 {
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-   struct drm_device *dev = intel_dig_port->base.base.dev;
-   struct drm_i915_private *dev_priv = to_i915(dev);
enum pipe pipe;
 
lockdep_assert_held(&dev_priv->pps_mutex);
@@ -605,7 +602,7 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
if (WARN_ON(pipe == INVALID_PIPE))
pipe = PIPE_A;
 
-   vlv_steal_power_sequencer(dev, pipe);
+   vlv_steal_power_sequencer(dev_priv, pipe);
intel_dp->pps_pipe = pipe;
 
DRM_DEBUG_KMS("picked pipe %c power sequencer for port %c\n",
@@ -613,8 +610,8 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
  port_name(intel_dig_port->base.port));
 
/* init power sequencer on this pipe and port */
-   intel_dp_init_panel_power_sequencer(dev, intel_dp);
-   intel_dp_init_panel_power_sequencer_registers(dev, intel_dp, true);
+   intel_dp_init_panel_power_sequencer(intel_dp);
+   intel_dp_init_panel_power_sequencer_registers(intel_dp, true);
 
/*
 * Even vdd force doesn't work until we've made
@@ -628,9 +625,7 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
 static int
 bxt_power_sequencer_idx(struct intel_dp *intel_dp)
 {
-   struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-   struct drm_device *dev = intel_dig_port->base.base.dev;
-   struct drm_i915_private *dev_priv = to_i915(dev);
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
 
lockdep_assert_held(&dev_priv->pps_mutex);
 
@@ -651,7 +646,7 @@ bxt_power_sequencer_idx(struct intel_dp *intel_dp)
 * Only the HW needs to be reprogrammed, the SW state is fixed and
 * has been setup during connector init.
 */
-   intel_dp_init_panel_power_sequencer_registers(dev, intel_dp, false);
+   intel_dp_init_panel_power_sequencer_registers(intel_dp, false);
 
return 0;
 }
@@ -703,9 +698,8 @@ vlv_initial_pps_pipe(struct drm_i915_private *dev_priv,
 static void
 vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp)
 {
+   struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-   struct drm_device *dev = intel_dig_port->base.base.dev;
-   struct drm_i915_private *dev_priv = to_i915(dev);
enum port port = intel_dig_port->base.port;
 
lockdep_assert_held(&dev_priv->pps_mutex);
@@ -733,8 +727,8 @@ vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp)
DRM_DEBUG_KMS("initial power sequencer for port %c: pipe %c\n",
  port_name(port), pipe_name(intel_dp->pps_pipe));
 
-   intel_dp_init_panel_power_sequencer(dev, intel_dp);
-   i

[Intel-gfx] [PATCH 05/10] drm/i915: Pass crtc state to DPIO PHY functions

2017-10-31 Thread Ville Syrjala
From: Ville Syrjälä 

Rather than digging through encoder->crtc and crtc->config in the
DPIO PHY functions, pass down the correct crtc state from the caller.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/i915_drv.h   | 19 +---
 drivers/gpu/drm/i915/intel_dp.c   | 16 +++
 drivers/gpu/drm/i915/intel_dpio_phy.c | 87 +--
 drivers/gpu/drm/i915/intel_hdmi.c | 17 ---
 4 files changed, 72 insertions(+), 67 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c10fece58e86..e483cf5a4332 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -4192,18 +4192,25 @@ void chv_set_phy_signal_level(struct intel_encoder 
*encoder,
  u32 deemph_reg_value, u32 margin_reg_value,
  bool uniq_trans_scale);
 void chv_data_lane_soft_reset(struct intel_encoder *encoder,
+ const struct intel_crtc_state *crtc_state,
  bool reset);
-void chv_phy_pre_pll_enable(struct intel_encoder *encoder);
-void chv_phy_pre_encoder_enable(struct intel_encoder *encoder);
+void chv_phy_pre_pll_enable(struct intel_encoder *encoder,
+   const struct intel_crtc_state *crtc_state);
+void chv_phy_pre_encoder_enable(struct intel_encoder *encoder,
+   const struct intel_crtc_state *crtc_state);
 void chv_phy_release_cl2_override(struct intel_encoder *encoder);
-void chv_phy_post_pll_disable(struct intel_encoder *encoder);
+void chv_phy_post_pll_disable(struct intel_encoder *encoder,
+ const struct intel_crtc_state *old_crtc_state);
 
 void vlv_set_phy_signal_level(struct intel_encoder *encoder,
  u32 demph_reg_value, u32 preemph_reg_value,
  u32 uniqtranscale_reg_value, u32 tx3_demph);
-void vlv_phy_pre_pll_enable(struct intel_encoder *encoder);
-void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder);
-void vlv_phy_reset_lanes(struct intel_encoder *encoder);
+void vlv_phy_pre_pll_enable(struct intel_encoder *encoder,
+   const struct intel_crtc_state *crtc_state);
+void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder,
+   const struct intel_crtc_state *crtc_state);
+void vlv_phy_reset_lanes(struct intel_encoder *encoder,
+const struct intel_crtc_state *old_crtc_state);
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val);
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 4f64d83537d9..0151c8d18b79 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2781,7 +2781,7 @@ static void chv_post_disable_dp(struct intel_encoder 
*encoder,
mutex_lock(&dev_priv->sb_lock);
 
/* Assert data lane reset */
-   chv_data_lane_soft_reset(encoder, true);
+   chv_data_lane_soft_reset(encoder, old_crtc_state, true);
 
mutex_unlock(&dev_priv->sb_lock);
 }
@@ -3091,7 +3091,7 @@ static void vlv_pre_enable_dp(struct intel_encoder 
*encoder,
  const struct intel_crtc_state *pipe_config,
  const struct drm_connector_state *conn_state)
 {
-   vlv_phy_pre_encoder_enable(encoder);
+   vlv_phy_pre_encoder_enable(encoder, pipe_config);
 
intel_enable_dp(encoder, pipe_config, conn_state);
 }
@@ -3102,14 +3102,14 @@ static void vlv_dp_pre_pll_enable(struct intel_encoder 
*encoder,
 {
intel_dp_prepare(encoder, pipe_config);
 
-   vlv_phy_pre_pll_enable(encoder);
+   vlv_phy_pre_pll_enable(encoder, pipe_config);
 }
 
 static void chv_pre_enable_dp(struct intel_encoder *encoder,
  const struct intel_crtc_state *pipe_config,
  const struct drm_connector_state *conn_state)
 {
-   chv_phy_pre_encoder_enable(encoder);
+   chv_phy_pre_encoder_enable(encoder, pipe_config);
 
intel_enable_dp(encoder, pipe_config, conn_state);
 
@@ -3123,14 +3123,14 @@ static void chv_dp_pre_pll_enable(struct intel_encoder 
*encoder,
 {
intel_dp_prepare(encoder, pipe_config);
 
-   chv_phy_pre_pll_enable(encoder);
+   chv_phy_pre_pll_enable(encoder, pipe_config);
 }
 
 static void chv_dp_post_pll_disable(struct intel_encoder *encoder,
-   const struct intel_crtc_state *pipe_config,
-   const struct drm_connector_state 
*conn_state)
+   const struct intel_crtc_state 
*old_crtc_state,
+   const struct drm_connector_state 
*old_conn_state)
 {
-   chv_phy_post_pll_disable(encoder);
+   chv_phy_post_pll_disable(encoder, old_crtc_state);
 }
 
 /*
diff --git a/driver

Re: [Intel-gfx] ✗ Fi.CI.IGT: warning for GuC based reset engine

2017-10-31 Thread Michel Thierry

On 10/31/2017 3:20 AM, Chris Wilson wrote:

Quoting Patchwork (2017-10-30 23:20:13)

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6267/shards.html


https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6267/shard-kbl1/igt@prime_b...@wait-hang-render.html
is suspicious.
-Chris



It is suspicious (I just double checked that prime_busy runs fine in my 
skl). I don't know if the log is complete or it was killed before 
starting the subtest. Instead of:

[  ] [IGT] prime_busy: executing
[  ] [IGT] prime_busy: starting subtest wait-hang-render

the log only has:

<7>[   59.430514] [IGT] kms_plane_lowres: exiting, ret=77
<7>[   59.522502] [IGT] prime_busy: executing
��

(and a few tests were returning EBADFD).
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] ✗ Fi.CI.IGT: warning for GuC based reset engine

2017-10-31 Thread Chris Wilson
Quoting Michel Thierry (2017-10-31 20:56:03)
> On 10/31/2017 3:20 AM, Chris Wilson wrote:
> > Quoting Patchwork (2017-10-30 23:20:13)
> >> For more details see: 
> >> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6267/shards.html
> > 
> > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6267/shard-kbl1/igt@prime_b...@wait-hang-render.html
> > is suspicious.
> > -Chris
> > 
> 
> It is suspicious (I just double checked that prime_busy runs fine in my 
> skl). I don't know if the log is complete or it was killed before 
> starting the subtest. Instead of:
> [  ] [IGT] prime_busy: executing
> [  ] [IGT] prime_busy: starting subtest wait-hang-render
> 
> the log only has:
> 
> <7>[   59.430514] [IGT] kms_plane_lowres: exiting, ret=77
> <7>[   59.522502] [IGT] prime_busy: executing
> ��

Yup, that just tells us that the machine was rebooted before the dmesg
was written to disk. Usually a sign of a panic, but no pstore oops.

It was only that this purported to be a hang test, and until very
recently broke intel_gpu_reset, that I worried.
-Chris
___
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 [1/2] drm/i915: Pass around crtc and connector states for audio

2017-10-31 Thread Patchwork
== Series Details ==

Series: series starting with [1/2] drm/i915: Pass around crtc and connector 
states for audio
URL   : https://patchwork.freedesktop.org/series/32858/
State : success

== Summary ==

Series 32858v1 series starting with [1/2] drm/i915: Pass around crtc and 
connector states for audio
https://patchwork.freedesktop.org/api/1.0/series/32858/revisions/1/mbox/

Test gem_mmap_gtt:
Subgroup basic-read-no-prefault:
dmesg-warn -> PASS   (fi-bsw-n3050)
Test kms_addfb_basic:
Subgroup invalid-set-prop:
incomplete -> PASS   (fi-cnl-y)
Test kms_flip:
Subgroup basic-flip-vs-dpms:
notrun -> INCOMPLETE (fi-cnl-y)

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:443s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:455s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:378s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:526s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:277s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:505s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:506s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:494s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:550s
fi-cnl-y total:217  pass:196  dwarn:0   dfail:0   fail:0   skip:20 
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:431s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:263s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:587s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:490s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:428s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:429s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:427s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:498s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:465s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:491s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:574s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:481s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:589s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:456s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:584s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:649s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:518s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:503s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:462s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:574s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:420s
fi-bxt-dsi failed to connect after reboot
fi-pnv-d510 failed to connect after reboot

411ec53a58b3cf22efe7e8c7e6af94945c15568d drm-tip: 2017y-10m-31d-18h-16m-29s UTC 
integration manifest
756dca3f2f57 drm/i915: Remove most encoder->type uses from the audio code
9204bc274980 drm/i915: Pass around crtc and connector states for audio

== Logs ==

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


[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat

2017-10-31 Thread Patchwork
== Series Details ==

Series: drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat
URL   : https://patchwork.freedesktop.org/series/32792/
State : success

== Summary ==

Test kms_cursor_legacy:
Subgroup flip-vs-cursor-toggle:
fail   -> PASS   (shard-hsw) fdo#102670
Test kms_flip:
Subgroup plain-flip-ts-check-interruptible:
pass   -> FAIL   (shard-hsw) fdo#100368

fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368

shard-hswtotal:2539 pass:1431 dwarn:1   dfail:0   fail:10  skip:1097 
time:9304s

== Logs ==

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


Re: [Intel-gfx] [PATCH i-g-t] kms_atomic_transition: Add subtest time limit/randomize plane, pipe combinations

2017-10-31 Thread Chris Wilson
Quoting Imre Deak (2017-10-31 13:44:47)
> Doing modeset on internal panels may have a considerable overhead due to
> the panel specific power sequencing delays. To avoid long test runtimes
> limit the runtime of each subtest. Randomize the plane/pipe combinations
> to preserve the test coverage on such panels at least over multiple test
> runs.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103334
> Cc: Maarten Lankhorst 
> Signed-off-by: Imre Deak 
> ---
>  tests/kms_atomic_transition.c | 175 
> --
>  1 file changed, 150 insertions(+), 25 deletions(-)
> 
> diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
> index 4c295125..ac67fc3a 100644
> --- a/tests/kms_atomic_transition.c
> +++ b/tests/kms_atomic_transition.c
> @@ -39,6 +39,14 @@
>  #define DRM_CAP_CURSOR_HEIGHT 0x9
>  #endif
>  
> +#define MAX_SUBTEST_DURATION_NS (20ULL * NSEC_PER_SEC)
> +
> +struct test_config {
> +   igt_display_t *display;
> +   bool user_seed;
> +   int seed;
> +};
> +
>  struct plane_parms {
> struct igt_fb *fb;
> uint32_t width, height;
> @@ -401,6 +409,28 @@ static void wait_for_transition(igt_display_t *display, 
> enum pipe pipe, bool non
> }
>  }
>  
> +/* Copied from https://benpfaff.org/writings/clc/shuffle.html */
> +static void shuffle_array(uint32_t *array, int size, int seed)
> +{
> +   int i;
> +
> +   for (i = 0; i < size; i++) {
> +   int j = i + rand() / (RAND_MAX / (size - i) + 1);
> +
> +   igt_swap(array[i], array[j]);
> +   }
> +}

igt_permute_array()

Not saying anything, but I was told using CI for stochastic coverage was
a flat no...
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.BAT: warning for drm/i915: Nuke dig_port->port and assorted cleanups

2017-10-31 Thread Patchwork
== Series Details ==

Series: drm/i915: Nuke dig_port->port and assorted cleanups
URL   : https://patchwork.freedesktop.org/series/32928/
State : warning

== Summary ==

Series 32928v1 drm/i915: Nuke dig_port->port and assorted cleanups
https://patchwork.freedesktop.org/api/1.0/series/32928/revisions/1/mbox/

Test gem_mmap_gtt:
Subgroup basic-read-no-prefault:
dmesg-warn -> PASS   (fi-bsw-n3050)
Test gem_ringfill:
Subgroup basic-default:
pass   -> SKIP   (fi-bsw-n3050)
Test kms_addfb_basic:
Subgroup invalid-set-prop:
incomplete -> PASS   (fi-cnl-y)
Test kms_flip:
Subgroup basic-flip-vs-dpms:
notrun -> INCOMPLETE (fi-cnl-y)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
pass   -> INCOMPLETE (fi-kbl-7560u) fdo#102846
Test drv_module_reload:
Subgroup basic-reload-inject:
pass   -> DMESG-WARN (fi-bsw-n3050)

fdo#102846 https://bugs.freedesktop.org/show_bug.cgi?id=102846

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:444s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:451s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:380s
fi-bsw-n3050 total:289  pass:241  dwarn:1   dfail:0   fail:0   skip:47  
time:544s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:280s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:513s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:505s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:512s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:496s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:558s
fi-cnl-y total:217  pass:196  dwarn:0   dfail:0   fail:0   skip:20 
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:433s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:267s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:583s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:493s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:432s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:432s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:434s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:500s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:465s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:495s
fi-kbl-7560u total:246  pass:229  dwarn:0   dfail:0   fail:0   skip:16 
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:481s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:584s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:570s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:470s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:595s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:650s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:519s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:499s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:458s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:582s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:431s

411ec53a58b3cf22efe7e8c7e6af94945c15568d drm-tip: 2017y-10m-31d-18h-16m-29s UTC 
integration manifest
d4826b1e0136 drm/i915: Clean up DP code local variables and calling conventions
c4cdb306d950 drm/i915: Clean up PPS code calling conventions
f32265769a0c drm/i915: Nuke intel_digital_port->port
a2d56e82ad90 drm/i915: Replace dig_port->port with encoder port for BXT DPLL 
selection
7a0ad2c31e0a drm/i915: Eliminate crtc->config usage from CRT code
a8cc74c811fd drm/i915: Pass crtc state to DPIO PHY functions
f5828a2aae0d drm/i915: Eliminate some encoder->crtc usage from TV code
8e9d9cab31e1 drm/i915: Eliminate some encoder->crtc usage from SDVO code
1c04393578a0 drm/i915: Eliminate some encoder->crtc usage from DSI code
5f1fe1e2d77f drm/i915: Eliminate some encoder->crtc usage from DP code

== Logs ==

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


[Intel-gfx] [PATCH v6] drm/i915/guc: Add support for reset engine using GuC commands

2017-10-31 Thread Michel Thierry
This patch adds per engine reset and recovery (TDR) support when GuC is
used to submit workloads to GPU.

In the case of i915 directly submission to ELSP, driver manages hang
detection, recovery and resubmission. With GuC submission these tasks
are shared between driver and GuC. i915 is still responsible for detecting
a hang, and when it does it only requests GuC to reset that Engine. GuC
internally manages acquiring forcewake and idling the engine before
resetting it.

Once the reset is successful, i915 takes over again and handles the
resubmission. The scheduler in i915 knows which requests are pending so
after resetting a engine, pending workloads/requests are resubmitted
again.

v2: s/i915_guc_request_engine_reset/i915_guc_reset_engine/ to match the
non-guc function names.

v3: Removed debug message about engine restarting from which request,
since the new baseline do it regardless of submission mode. (Chris)

v4: Rebase.

v5: Do not pass unnecessary reporting flags to the fw (Jeff);
tasklet_schedule(&execlists->irq_tasklet) handles the resubmit; rebase.

v6: Rename the existing reset engine function and share a similar
interface between guc and non-guc paths (Chris).

Signed-off-by: Michel Thierry 
Cc: Chris Wilson 
---
 drivers/gpu/drm/i915/i915_drv.c   | 15 +--
 drivers/gpu/drm/i915/i915_drv.h   |  2 ++
 drivers/gpu/drm/i915/intel_guc.c  | 24 
 drivers/gpu/drm/i915/intel_guc_fwif.h |  1 +
 drivers/gpu/drm/i915/intel_uncore.c   |  5 -
 5 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index af745749509c..359333a423cf 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1950,6 +1950,12 @@ void i915_reset(struct drm_i915_private *i915, unsigned 
int flags)
goto finish;
 }
 
+static inline int intel_gt_reset_engine(struct drm_i915_private *dev_priv,
+   struct intel_engine_cs *engine)
+{
+   return intel_gpu_reset(dev_priv, intel_engine_flag(engine));
+}
+
 /**
  * i915_reset_engine - reset GPU engine to recover from a hang
  * @engine: engine to reset
@@ -1984,10 +1990,15 @@ int i915_reset_engine(struct intel_engine_cs *engine, 
unsigned int flags)
goto out;
}
 
-   ret = intel_gpu_reset(engine->i915, intel_engine_flag(engine));
+   if (!engine->i915->guc.execbuf_client)
+   ret = intel_gt_reset_engine(engine->i915, engine);
+   else
+   ret = intel_guc_reset_engine(&engine->i915->guc, engine);
+
if (ret) {
/* If we fail here, we expect to fallback to a global reset */
-   DRM_DEBUG_DRIVER("Failed to reset %s, ret=%d\n",
+   DRM_DEBUG_DRIVER("%sFailed to reset %s, ret=%d\n",
+(engine->i915->guc.execbuf_client ? "GUC ":""),
 engine->name, ret);
goto out;
}
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index cff1b57598c3..ce2725696187 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -3330,6 +3330,8 @@ extern int i915_reset_engine(struct intel_engine_cs 
*engine,
 
 extern bool intel_has_reset_engine(struct drm_i915_private *dev_priv);
 extern int intel_reset_guc(struct drm_i915_private *dev_priv);
+extern int intel_guc_reset_engine(struct intel_guc *guc,
+ struct intel_engine_cs *engine);
 extern void intel_engine_init_hangcheck(struct intel_engine_cs *engine);
 extern void intel_hangcheck_init(struct drm_i915_private *dev_priv);
 extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_guc.c b/drivers/gpu/drm/i915/intel_guc.c
index f74d50fdaeb0..9678630a1c70 100644
--- a/drivers/gpu/drm/i915/intel_guc.c
+++ b/drivers/gpu/drm/i915/intel_guc.c
@@ -24,6 +24,7 @@
 
 #include "intel_guc.h"
 #include "i915_drv.h"
+#include "i915_guc_submission.h"
 
 static void gen8_guc_raise_irq(struct intel_guc *guc)
 {
@@ -283,6 +284,29 @@ int intel_guc_suspend(struct drm_i915_private *dev_priv)
return intel_guc_send(guc, data, ARRAY_SIZE(data));
 }
 
+/**
+ * intel_guc_reset_engine() - ask GuC to reset an engine
+ * @guc:   intel_guc structure
+ * @engine:engine to be reset
+ */
+int intel_guc_reset_engine(struct intel_guc *guc,
+  struct intel_engine_cs *engine)
+{
+   u32 data[7];
+
+   GEM_BUG_ON(!guc->execbuf_client);
+
+   data[0] = INTEL_GUC_ACTION_REQUEST_ENGINE_RESET;
+   data[1] = engine->guc_id;
+   data[2] = 0;
+   data[3] = 0;
+   data[4] = 0;
+   data[5] = guc->execbuf_client->stage_id;
+   data[6] = guc_ggtt_offset(guc->shared_data);
+
+   return intel_guc_send(guc, data, ARRAY_SIZE(data));
+}
+
 /**
  * intel_guc_resume() - notify GuC resuming from suspend state
  * @dev

Re: [Intel-gfx] [PATCH] drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat

2017-10-31 Thread Rodrigo Vivi
On Mon, Oct 30, 2017 at 05:41:50PM +, Daniele Ceraolo Spurio wrote:
> 
> 
> On 27/10/17 15:32, Michel Thierry wrote:
> > There is no need check if PPGTT is disabled because that not possible
> > in CNL. Execlists and GuC submission modes rely on at least aliasing
> > PPGTT and even intel_sanitize_enable_ppgtt says: "We don't allow disabling
> > PPGTT for gen9+ as it's a requirement for execlists, the sole mechanism
> > available to submit work."
> > 
> > Suggested-by: Daniele Ceraolo Spurio 
> > Cc: Rodrigo Vivi 
> > Signed-off-by: Michel Thierry 
> > ---
> 
> Reviewed-by: Daniele Ceraolo Spurio 

Merged to dinq. Thanks for the patch and review.

> 
> >   drivers/gpu/drm/i915/i915_gem_gtt.c | 6 --
> >   1 file changed, 6 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c 
> > b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > index 7ebfc8ee479e..302ffe0cf3c7 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > @@ -3206,12 +3206,6 @@ static void cnl_setup_private_ppat(struct intel_ppat 
> > *ppat)
> > ppat->match = bdw_private_pat_match;
> > ppat->clear_value = GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(3);
> > -   /* XXX: spec is unclear if this is still needed for CNL+ */
> > -   if (!USES_PPGTT(ppat->i915)) {
> > -   __alloc_ppat_entry(ppat, 0, GEN8_PPAT_UC);
> > -   return;
> > -   }
> > -
> > __alloc_ppat_entry(ppat, 0, GEN8_PPAT_WB | GEN8_PPAT_LLC);
> > __alloc_ppat_entry(ppat, 1, GEN8_PPAT_WC | GEN8_PPAT_LLCELLC);
> > __alloc_ppat_entry(ppat, 2, GEN8_PPAT_WT | GEN8_PPAT_LLCELLC);
> > 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: set minimum CD clock to twice the BCLK.

2017-10-31 Thread Kumar, Abhay



On 10/30/2017 5:21 PM, Pandiyan, Dhinakaran wrote:

On Sun, 2017-10-29 at 03:04 +, Kumar, Abhay wrote:

+ Subhransu

-Original Message-
From: Intel-gfx [mailto:intel-gfx-boun...@lists.freedesktop.org] On Behalf Of 
Kumar, Abhay
Sent: Thursday, October 26, 2017 12:10 PM
To: Jani Nikula ; Dhinakaran Pandiyan 
; subransu.s.pru...@intel.com
Cc: intel-gfx@lists.freedesktop.org; Nujella, Sathyanarayana 

Subject: Re: [Intel-gfx] [PATCH] drm/i915: set minimum CD clock to twice the 
BCLK.



On 10/26/2017 1:45 AM, Jani Nikula wrote:

On Wed, 25 Oct 2017, Dhinakaran Pandiyan  wrote:

On Wednesday, October 25, 2017 3:02:12 PM PDT abhay.ku...@intel.com wrote:

From: Abhay Kumar 

In glk when device boots with only 1366x768 panel, HDA codec doesn't comeup.
This result in no audio forever as cdclk is < 96Mhz.

Forever... or until next modeset with audio enabled?

Soundcard probing/detection and creation happens only during bootup.  So even 
though we do modeset later there is no soundcard driver to handle the event.

This chagne will ensure CD clock to be twice of  BCLK.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102937
Signed-off-by: Abhay Kumar 
---
   drivers/gpu/drm/i915/intel_cdclk.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_cdclk.c
b/drivers/gpu/drm/i915/intel_cdclk.c index
e8884c2ade98..185a70f0921c
100644
--- a/drivers/gpu/drm/i915/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/intel_cdclk.c
@@ -1920,7 +1920,7 @@ int intel_crtc_compute_min_cdclk(const struct
intel_crtc_state *crtc_state) /* According to BSpec, "The CD clock
frequency must be at least twice * the frequency of the Azalia
BCLK." and BCLK is 96 MHz by default. */
-   if (crtc_state->has_audio && INTEL_GEN(dev_priv) >= 9)
+   if (INTEL_GEN(dev_priv) >= 9)

Why should cdclk be increased when audio is not being enabled?

Indeed. I can easily imagine a counter-bug reporting excessive cdclk
when audio is not enabled.

During bootup time audio driver is trying to acquire HDA audio power well 
inside i915 and then it will send HDA verb commands.
since cdclk is lower than 96Mhz  HDA will not comeup resulting in timeout.  
This was working fine  before SKL/APL since there was no 2 PPC .

Is it ok to bump  up cdclk while bootup of system/HDA and then reduce to needed 
CDCLK?

I think it is worth exploring, do you have code to test whether it
solves this particular issue?
No i don't have test code for this but what i learned from other OS that 
glk run at 148000 and cnl 96000*2 due to this limitation all the time.


@Shubhransu : can you please answer this doubt which we all have. This 
we should be able to get from HDA specs.





wondering if this approach can cause any issue to subsequent HDA verb commands 
..



BR,
Jani.


min_cdclk = max(2 * 96000, min_cdclk);

if (min_cdclk > dev_priv->max_cdclk_freq) {

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

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


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


[Intel-gfx] ✓ Fi.CI.BAT: success for GuC based reset engine (rev2)

2017-10-31 Thread Patchwork
== Series Details ==

Series: GuC based reset engine (rev2)
URL   : https://patchwork.freedesktop.org/series/32859/
State : success

== Summary ==

Series 32859v2 GuC based reset engine
https://patchwork.freedesktop.org/api/1.0/series/32859/revisions/2/mbox/

Test chamelium:
Subgroup dp-crc-fast:
fail   -> PASS   (fi-kbl-7500u) fdo#102514
Test drv_module_reload:
Subgroup basic-no-display:
fail   -> PASS   (fi-hsw-4770r)

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:450s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:453s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:380s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:553s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:276s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:515s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:507s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:513s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:492s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:557s
fi-cnl-y total:217  pass:196  dwarn:0   dfail:0   fail:0   skip:20 
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:435s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:265s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:587s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:495s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:435s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:426s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:425s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:506s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:465s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:489s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:574s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:472s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:584s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:569s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:455s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:591s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:653s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:521s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:496s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:463s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:567s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:421s

98f067e087ab9294555a9bdd6a056c4156777117 drm-tip: 2017y-10m-31d-20h-56m-13s UTC 
integration manifest
2fda8dacaf77 HAX enable GuC submission for CI
2f3b79915935 drm/i915/guc: Add support for reset engine using GuC commands
614ac0cbdb82 drm/i915/guc: Rename the function that resets the GuC

== Logs ==

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


[Intel-gfx] [PATCH 1/2] drm/i915/guc: Add GuC Load time to dmesg log.

2017-10-31 Thread Anusha Srivatsa
Calculate the time that GuC takes to load using
jiffies. This information could be very useful in
determining if GuC is taking unreasonably long time
to load in a certain platforms.

v2: Calculate time before logs are collected.
Move the guc_load_time variable as a part of
intel_uc_fw struct. Store only final result
which is to be exported to debugfs. (Michal)
Add the load time in the print message as well.

v3: Remove debugfs entry. Remove local variable
guc_finish_load. (Daniel, Tvrtko)

v4: Use ktime_get() instead of jiffies. Use DRM_NOTE
if time taken to load is more than the threshold. On
load times within acceptable range, use DRM_DEBUG_DRIVER
(Tvrtko)

v5: Rebased. Do not expose the load time variable in a global
struct (Tvrtko, Joonas)

Cc: Chris Wilson 
Cc: Daniel Vetter 
Cc: Michal Wajdeczko 
Cc: Oscar Mateo 
Cc: Sujaritha Sundaresan 
Cc: Tvrtko Ursulin 
Signed-off-by: Anusha Srivatsa 
---
 drivers/gpu/drm/i915/intel_guc_fw.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_guc_fw.c 
b/drivers/gpu/drm/i915/intel_guc_fw.c
index ef67a36..4ce9a30 100644
--- a/drivers/gpu/drm/i915/intel_guc_fw.c
+++ b/drivers/gpu/drm/i915/intel_guc_fw.c
@@ -133,7 +133,8 @@ static int guc_ucode_xfer_dma(struct drm_i915_private 
*dev_priv,
unsigned long offset;
struct sg_table *sg = vma->pages;
u32 status, rsa[UOS_RSA_SCRATCH_MAX_COUNT];
-   int i, ret = 0;
+   int i, ret = 0, load_time;
+   ktime_t start_load;
 
/* where RSA signature starts */
offset = guc_fw->rsa_offset;
@@ -160,6 +161,7 @@ static int guc_ucode_xfer_dma(struct drm_i915_private 
*dev_priv,
I915_WRITE(DMA_ADDR_1_HIGH, DMA_ADDRESS_SPACE_WOPCM);
 
/* Finally start the DMA */
+   start_load = ktime_get();
I915_WRITE(DMA_CTRL, _MASKED_BIT_ENABLE(UOS_MOVE | START_DMA));
 
/*
@@ -172,13 +174,18 @@ static int guc_ucode_xfer_dma(struct drm_i915_private 
*dev_priv,
 */
ret = wait_for(guc_ucode_response(dev_priv, &status), 100);
 
+   load_time = ktime_ms_delta(ktime_get(), start_load);
+
DRM_DEBUG_DRIVER("DMA status 0x%x, GuC status 0x%x\n",
I915_READ(DMA_CTRL), status);
 
if ((status & GS_BOOTROM_MASK) == GS_BOOTROM_RSA_FAILED) {
DRM_ERROR("GuC firmware signature verification failed\n");
ret = -ENOEXEC;
-   }
+   } else if (load_time > 20)
+   DRM_NOTE("GuC load takes more than acceptable threshold\n");
+   else
+   DRM_DEBUG_DRIVER("GuC loaded in %d ms\n", load_time);
 
DRM_DEBUG_DRIVER("returning %d\n", ret);
 
-- 
2.7.4

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


[Intel-gfx] [PATCH 2/2] drm/i915/huc: Add HuC Load time to dmesg log.

2017-10-31 Thread Anusha Srivatsa
This patch uses jiffies to calculate the huc
load time.This information can be useful for testing
to know how much time huc takes to load.

v2: Remove debugfs entry. Remove local variable
huc_finish_load. (Daniel, Tvrtko)

v3: Use ktime_get() for more accurate timings.
Ensure the load is successful, before load times
is printed. (Tvrtko, Michal)

v4: Rebase. Do not expose the load time variable in a gobal
struct. Use int for load time (Tvrtko, Joonas)

Cc: Chris Wilson 
Cc: Daniel Vetter 
Cc: Michal Wajdeczko 
Cc: Oscar Mateo Lozano 
Cc: Sujaritha Sundaresan 
Cc: Tvrtko Ursulin 
Signed-off-by: Anusha Srivatsa 
---
 drivers/gpu/drm/i915/intel_huc.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_huc.c b/drivers/gpu/drm/i915/intel_huc.c
index 98d1725..3e3ce14 100644
--- a/drivers/gpu/drm/i915/intel_huc.c
+++ b/drivers/gpu/drm/i915/intel_huc.c
@@ -127,7 +127,8 @@ static int huc_ucode_xfer(struct intel_uc_fw *huc_fw, 
struct i915_vma *vma)
struct drm_i915_private *dev_priv = huc_to_i915(huc);
unsigned long offset = 0;
u32 size;
-   int ret;
+   int ret, load_time;
+   ktime_t start_load;
 
GEM_BUG_ON(huc_fw->type != INTEL_UC_FW_TYPE_HUC);
 
@@ -148,13 +149,19 @@ static int huc_ucode_xfer(struct intel_uc_fw *huc_fw, 
struct i915_vma *vma)
I915_WRITE(DMA_COPY_SIZE, size);
 
/* Start the DMA */
+   start_load = ktime_get();
I915_WRITE(DMA_CTRL, _MASKED_BIT_ENABLE(HUC_UKERNEL | START_DMA));
 
/* Wait for DMA to finish */
ret = intel_wait_for_register_fw(dev_priv, DMA_CTRL, START_DMA, 0, 100);
 
+   load_time = ktime_ms_delta(ktime_get(), start_load);
+
DRM_DEBUG_DRIVER("HuC DMA transfer wait over with ret %d\n", ret);
 
+   if (!ret)
+   DRM_DEBUG_DRIVER("HuC is loaded in %d ms\n", load_time);
+
/* Disable the bits once DMA is over */
I915_WRITE(DMA_CTRL, _MASKED_BIT_DISABLE(HUC_UKERNEL));
 
-- 
2.7.4

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


[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat

2017-10-31 Thread Patchwork
== Series Details ==

Series: drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat
URL   : https://patchwork.freedesktop.org/series/32792/
State : failure

== Summary ==

Series 32792v1 drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat
https://patchwork.freedesktop.org/api/1.0/series/32792/revisions/1/mbox/

Test chamelium:
Subgroup dp-crc-fast:
fail   -> PASS   (fi-kbl-7500u) fdo#102514
Test gem_exec_flush:
Subgroup basic-batch-kernel-default-uc:
pass   -> INCOMPLETE (fi-glk-dsi)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
dmesg-warn -> PASS   (fi-byt-n2820) fdo#101705
Test drv_module_reload:
Subgroup basic-no-display:
fail   -> PASS   (fi-hsw-4770r)

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:445s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:458s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:380s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:537s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:275s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:505s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:502s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:502s
fi-byt-n2820 total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:489s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:551s
fi-cnl-y total:217  pass:196  dwarn:0   dfail:0   fail:0   skip:20 
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:424s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:263s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:581s
fi-glk-dsi   total:61   pass:44   dwarn:0   dfail:0   fail:0   skip:16 
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:429s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:429s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:426s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:500s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:471s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:493s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:576s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:483s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:587s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:571s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:460s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:593s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:649s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:520s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:513s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:458s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:570s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:424s

98f067e087ab9294555a9bdd6a056c4156777117 drm-tip: 2017y-10m-31d-20h-56m-13s UTC 
integration manifest
fc7c19c1505e drm/i915/cnl: Remove unnecessary check in cnl_setup_private_ppat

== Logs ==

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


[Intel-gfx] ✗ Fi.CI.IGT: failure for GuC based reset engine (rev2)

2017-10-31 Thread Patchwork
== Series Details ==

Series: GuC based reset engine (rev2)
URL   : https://patchwork.freedesktop.org/series/32859/
State : failure

== Summary ==

Test drv_module_reload:
Subgroup basic-reload-inject:
pass   -> DMESG-WARN (shard-hsw) fdo#102707
Test kms_sysfs_edid_timing:
pass   -> FAIL   (shard-hsw) fdo#100047
Test kms_flip:
Subgroup flip-vs-dpms-interruptible:
pass   -> INCOMPLETE (shard-hsw)

fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047

shard-hswtotal:2536 pass:1426 dwarn:2   dfail:0   fail:10  skip:1097 
time:9009s

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6284/shards.html
___
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 [1/2] drm/i915/guc: Add GuC Load time to dmesg log.

2017-10-31 Thread Patchwork
== Series Details ==

Series: series starting with [1/2] drm/i915/guc: Add GuC Load time to dmesg log.
URL   : https://patchwork.freedesktop.org/series/32936/
State : success

== Summary ==

Series 32936v1 series starting with [1/2] drm/i915/guc: Add GuC Load time to 
dmesg log.
https://patchwork.freedesktop.org/api/1.0/series/32936/revisions/1/mbox/

Test drv_module_reload:
Subgroup basic-no-display:
fail   -> PASS   (fi-hsw-4770r)
dmesg-warn -> INCOMPLETE (fi-cfl-s) fdo#103206

fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:445s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:459s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:380s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:548s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:276s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:524s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:508s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:509s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:486s
fi-cfl-s total:287  pass:253  dwarn:2   dfail:0   fail:0   skip:31 
fi-cnl-y total:217  pass:196  dwarn:0   dfail:0   fail:0   skip:20 
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:435s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:263s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:583s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:496s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:429s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:430s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:428s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:497s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:466s
fi-kbl-7500u total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  
time:490s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:578s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:481s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:582s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:567s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:454s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:598s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:652s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:526s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:505s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:463s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:570s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:422s

98f067e087ab9294555a9bdd6a056c4156777117 drm-tip: 2017y-10m-31d-20h-56m-13s UTC 
integration manifest
15988f30344c drm/i915/huc: Add HuC Load time to dmesg log.
9b50a2ba1a14 drm/i915/guc: Add GuC Load time to dmesg log.

== Logs ==

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


[Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915/guc: Add GuC Load time to dmesg log.

2017-10-31 Thread Patchwork
== Series Details ==

Series: series starting with [1/2] drm/i915/guc: Add GuC Load time to dmesg log.
URL   : https://patchwork.freedesktop.org/series/32936/
State : success

== Summary ==

Test drv_module_reload:
Subgroup basic-reload-inject:
pass   -> DMESG-WARN (shard-hsw) fdo#102707
Test kms_setmode:
Subgroup basic:
fail   -> PASS   (shard-hsw) fdo#99912
Test kms_busy:
Subgroup extended-modeset-hang-newfb-with-reset-render-A:
dmesg-warn -> PASS   (shard-hsw) fdo#102249
Test kms_flip:
Subgroup plain-flip-fb-recreate:
pass   -> FAIL   (shard-hsw) fdo#100368

fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102249 https://bugs.freedesktop.org/show_bug.cgi?id=102249
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368

shard-hswtotal:2539 pass:1432 dwarn:1   dfail:0   fail:9   skip:1097 
time:9217s

== Logs ==

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


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm tree

2017-10-31 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  include/drm/drmP.h

between commit:

  e7646f84ad4f ("drm: Add new LEASE debug level")

from the drm tree and commit:

  02c9656b2f0d ("drm: Move debug macros out of drmP.h")

from the drm-misc tree.

I fixed it up (I used the drm-misc version of the file and added the below
merge fix patch) and can carry the fix as necessary. This is now fixed
as far as linux-next is concerned, but any non trivial conflicts should
be mentioned to your upstream maintainer when your tree is submitted for
merging.  You may also want to consider cooperating with the maintainer
of the conflicting tree to minimise any particularly complex conflicts.

From: Stephen Rothwell 
Date: Wed, 1 Nov 2017 14:33:07 +1100
Subject: [PATCH] drm-misc: merge fix up for DEBUG printing macros move

Signed-off-by: Stephen Rothwell 
---
 include/drm/drm_print.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index 7b9c86a6ca3e..edcea83a5050 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -171,6 +171,7 @@ static inline struct drm_printer drm_debug_printer(const 
char *prefix)
 #define DRM_UT_ATOMIC  0x10
 #define DRM_UT_VBL 0x20
 #define DRM_UT_STATE   0x40
+#define DRM_UT_LEASE   0x80
 
 __printf(6, 7)
 void drm_dev_printk(const struct device *dev, const char *level,
@@ -287,6 +288,9 @@ void drm_printk(const char *level, unsigned int category,
 #define DRM_DEBUG_VBL(fmt, ...)\
drm_printk(KERN_DEBUG, DRM_UT_VBL, fmt, ##__VA_ARGS__)
 
+#define DRM_DEBUG_LEASE(fmt, ...)  \
+   drm_printk(KERN_DEBUG, DRM_UT_LEASE, fmt, ##__VA_ARGS__)
+
 #define _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, level, fmt, args...)\
 ({ \
static DEFINE_RATELIMIT_STATE(_rs,  \


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


Re: [Intel-gfx] [PATCH v2 2/2] Test case for drm_vblank_cleanup refcount validation patch

2017-10-31 Thread PrasannaKumar Muralidharan
Hi Daniel,

On 31 October 2017 at 21:57, Daniel Vetter  wrote:
> On Tue, Oct 31, 2017 at 08:37:21PM +0530, PrasannaKumar Muralidharan wrote:
>> My patch is supposed to catch problem with drivers. It warns when
>> vblank refcount is non-zero in drm_vblank_cleanup call. From CI log it
>> can be seen that warning being triggered. I feel that my patch is
>> exposing existing issue.
>>
>> If I misinterpreted something please let me know.
>
> This is probably what's happening, but I can't merge a patch that breaks
> CI. So we need to track down that issue before merging.

I understand. Being new to DRM subsystem I don't know if I can
contribute in finding the issue. I would be able to help if I could
get some guidance.

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


Re: [Intel-gfx] [PATCH] drm/i915: Fix DPLL warning when starting guest VM

2017-10-31 Thread Zhenyu Wang
On 2017.10.31 03:09:04 +, Zhao, Xinda wrote:
> > 
> > On Mon, Oct 30, 2017 at 03:49:28PM +0200, Ville Syrjälä wrote:
> > > On Mon, Oct 30, 2017 at 04:17:06PM +0800, Zhao, Xinda wrote:
> > > > The warning is occurred in guest VM when trying to get clock in
> > > > encoder initialization.
> > 
> > What does guest VM mean here? gvt? If so, why do you claim to have an
> > enabled port without an enabled pipe?
> 
> [xinda] 
> Yes, gvt-g. 
> 
> We emulate a DP device on port B that is fixed to pipe A for each guest VM by 
> setting following register, it is mandatory.
> TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= (PORT_B << TRANS_DDI_PORT_SHIFT);
> 
> We don't emulate the status of pipe, whether it is enabled or not, it depends 
> on the i915 setting in guest VM, it is optional.
> The PIPECONF register will be trapped, but the behavior will not be emulated.
>

Looks that's wrong behavior which means full virtualized display brokenness
that still depends on some real hw status?

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


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] [maintainer-tools PATCH] dim: Sign commits in addition to tags

2017-10-31 Thread Jani Nikula

Reminder, we have this new list dim-to...@lists.freedesktop.org for
maintainer tools patches. Cc'd.

On Mon, 30 Oct 2017, Sean Paul  wrote:
> Expanding on Jani's work to sign tags, this patch adds signing for git
> commit/am.

I guess I'd like more rationale here. Is this something we should be
doing? Is anyone else doing this?

> Signed-off-by: Sean Paul 
> ---
>
> This has been lightly tested with dim apply-branch/dim push-branch.
>
> Sean
>
>  dim | 78 
> +
>  1 file changed, 51 insertions(+), 27 deletions(-)
>
> diff --git a/dim b/dim
> index 527989aff9ad..cd5e41f89a3a 100755
> --- a/dim
> +++ b/dim
> @@ -67,9 +67,6 @@ 
> DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
>  # dim pull-request tag summary template
>  
> DIM_TEMPLATE_TAG_SUMMARY=${DIM_TEMPLATE_TAG_SUMMARY:-$HOME/.dim.template.tagsummary}
>  
> -# GPG key id for signing tags. If unset, don't sign.
> -DIM_GPG_KEYID=${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}
> -
>  #
>  # Internal configuration.
>  #
> @@ -104,6 +101,20 @@ test_request_recipients=(
>  # integration configuration
>  integration_config=nightly.conf
>  
> +# GPG key id for signing tags. If unset, don't sign.
> +function gpg_keyid_for_tag
> +{
> + echo "${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}"
> + return 0
> +}
> +
> +# GPG key id for committing (git commit/am). If unset, don't sign.
> +function gpg_keyid_for_commit
> +{
> + echo "${DIM_GPG_KEYID:+-S$DIM_GPG_KEYID}"
> + return 0
> +}

This seems like an overly complicated way to achieve what you want.

Just put these under "Internal configuration." instead:

dim_gpg_sign_tag=${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}
dim_gpg_sign_commit=${DIM_GPG_KEYID:+-S$DIM_GPG_KEYID}

And use directly in git tag and commit, respectively?

Although... perhaps starting to sign tags should not force signing
commits?

BR,
Jani.


> +
>  function read_integration_config
>  {
>   # clear everything first to allow configuration reload
> @@ -473,12 +484,14 @@ EOF
>  # append all arguments as tags at the end of the commit message of HEAD
>  function dim_commit_add_tag
>  {
> + local gpg_keyid
> + gpg_keyid=$(gpg_keyid_for_commit)
>   for arg; do
>   # the first sed deletes all trailing blank lines at the end
>   git log -1 --pretty=%B | \
>   sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | \
>   sed "\$a${arg}" | \
> - git commit --amend -F-
> + git commit $gpg_keyid --amend -F-
>   done
>  }
>  
> @@ -604,7 +617,7 @@ function update_rerere_cache
>  
>  function commit_rerere_cache
>  {
> - local remote file commit_message
> + local remote file commit_message gpg_keyid
>  
>   echo -n "Updating rerere cache... "
>  
> @@ -640,7 +653,8 @@ function commit_rerere_cache
>   $(git --version)
>   EOF
>  
> - if git commit -F $commit_message >& /dev/null; then
> + gpg_keyid=$(gpg_keyid_for_commit)
> + if git commit $gpg_keyid -F $commit_message >& /dev/null; then
>   echo -n "New commit. "
>   else
>   echo -n "Nothing changed. "
> @@ -653,13 +667,14 @@ function commit_rerere_cache
>  
>  function dim_rebuild_tip
>  {
> - local integration_branch specfile first rerere repo remote
> + local integration_branch specfile first rerere repo remote gpg_keyid
>  
>   integration_branch=drm-tip
>   specfile=$(mktemp)
>   first=1
>  
>   rerere=$DIM_PREFIX/drm-rerere
> + gpg_keyid=$(gpg_keyid_for_commit)
>  
>   cd $rerere
>   if git status --porcelain | grep -q -v "^[ ?][ ?]"; then
> @@ -731,7 +746,7 @@ function dim_rebuild_tip
>  
>   # because we filter out fast-forward merges there will
>   # always be something to commit
> - git commit --no-edit --quiet
> + git commit $gpg_keyid --no-edit --quiet
>   echo "Done."
>   fi
>  
> @@ -743,7 +758,7 @@ function dim_rebuild_tip
>   echo -n "Adding integration manifest $integration_branch: 
> $dim_timestamp... "
>   mv $specfile integration-manifest
>   git add integration-manifest
> - git commit --quiet -m "$integration_branch: $dim_timestamp integration 
> manifest"
> + git commit $gpg_keyid --quiet -m "$integration_branch: $dim_timestamp 
> integration manifest"
>   echo "Done."
>  
>   remote=$(repo_to_remote drm-tip)
> @@ -848,7 +863,7 @@ function dim_push
>  
>  function apply_patch #patch_file
>  {
> - local patch message_id committer_email patch_from sob rv
> + local patch message_id committer_email patch_from sob rv gpg_keyid
>  
>   patch="$1"
>   shift
> @@ -860,7 +875,8 @@ function apply_patch #patch_file
>   sob=-s
>   fi
>  
> - git am --scissors -3 $sob "$@" $patch
> + gpg_keyid=$(gpg_keyid_for_commit)
> +

Re: [Intel-gfx] [PATCH] drm/i915: Fix DPLL warning when starting guest VM

2017-10-31 Thread Zhao, Xinda


> -Original Message-
> From: Zhenyu Wang [mailto:zhen...@linux.intel.com]
> Sent: Tuesday, October 31, 2017 2:52 PM
> To: Zhao, Xinda 
> Cc: ville.syrj...@linux.intel.com; intel-gfx@lists.freedesktop.org;
> intel-gvt-...@lists.freedesktop.org
> Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix DPLL warning when starting
> guest VM
> 
> On 2017.10.31 03:09:04 +, Zhao, Xinda wrote:
> > >
> > > On Mon, Oct 30, 2017 at 03:49:28PM +0200, Ville Syrjälä wrote:
> > > > On Mon, Oct 30, 2017 at 04:17:06PM +0800, Zhao, Xinda wrote:
> > > > > The warning is occurred in guest VM when trying to get clock in
> > > > > encoder initialization.
> > >
> > > What does guest VM mean here? gvt? If so, why do you claim to have
> > > an enabled port without an enabled pipe?
> >
> > [xinda]
> > Yes, gvt-g.
> >
> > We emulate a DP device on port B that is fixed to pipe A for each guest VM
> by setting following register, it is mandatory.
> > TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= (PORT_B <<
> TRANS_DDI_PORT_SHIFT);
> >
> > We don't emulate the status of pipe, whether it is enabled or not, it
> depends on the i915 setting in guest VM, it is optional.
> > The PIPECONF register will be trapped, but the behavior will not be
> emulated.
> >
> 
> Looks that's wrong behavior which means full virtualized display brokenness
> that still depends on some real hw status?

[xinda] 
Yes, consider the situation that PIPE A may be disabled in real hw, PIPE A 
should also be emulated in gvt, I will cook a new patch for this.
 
> --
> Open Source Technology Center, Intel ltd.
> 
> $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v2 5/7] drm/i915: check LSPCON vendor OUI

2017-10-31 Thread Maarten Lankhorst
Hey,

Op 09-08-17 om 08:46 schreef Shashank Sharma:
> Intel LSPCON chip is provided by 2 vendors:
> - Megachips America (MCA)
> - Parade technologies (Parade tech)
>
> Its important to know the vendor of this chip, as the address to
> write AVI infoframes is different for those two.
>
> This patch reads the vendor OUI signature, and marks into LSPCON
> encoder structure for future usages.
>
> This patch also does a small re-arrangement of the code, by moving
> lspcon mode change into probe function.
>
> V2: Use dp->desc for OUI detection, dont add a helper for this
> (Ville)
>
> Cc: Imre Deak 
> Cc: Ville Syrjälä 
> Signed-off-by: Shashank Sharma 
> ---
>  drivers/gpu/drm/i915/intel_drv.h|  6 
>  drivers/gpu/drm/i915/intel_lspcon.c | 69 
> +
>  2 files changed, 61 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h 
> b/drivers/gpu/drm/i915/intel_drv.h
> index 7eadac0..adab635 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1043,9 +1043,15 @@ struct intel_dp {
>   struct intel_dp_compliance compliance;
>  };
>  
> +enum lspcon_vendor {
> + LSPCON_VENDOR_MCA,
> + LSPCON_VENDOR_PARADE
> +};
> +
>  struct intel_lspcon {
>   bool active;
>   enum drm_lspcon_mode mode;
> + enum lspcon_vendor vendor;
>  };
>  
>  struct intel_digital_port {
> diff --git a/drivers/gpu/drm/i915/intel_lspcon.c 
> b/drivers/gpu/drm/i915/intel_lspcon.c
> index 5abef482..93507c5 100644
> --- a/drivers/gpu/drm/i915/intel_lspcon.c
> +++ b/drivers/gpu/drm/i915/intel_lspcon.c
> @@ -27,6 +27,10 @@
>  #include 
>  #include "intel_drv.h"
>  
> +/* LSPCON OUI Vendor ID(signatures) */
> +#define LSPCON_VENDOR_PARADE_OUI 0x001CF8
> +#define LSPCON_VENDOR_MCA_OUI 0x0060AD
> +
>  static struct intel_dp *lspcon_to_intel_dp(struct intel_lspcon *lspcon)
>  {
>   struct intel_digital_port *dig_port =
> @@ -50,6 +54,40 @@ static const char *lspcon_mode_name(enum drm_lspcon_mode 
> mode)
>   }
>  }
>  
> +static bool lspcon_detect_vendor(struct intel_lspcon *lspcon)
> +{
> + struct intel_dp *dp = lspcon_to_intel_dp(lspcon);
> + struct drm_dp_dpcd_ident *ident;
> + u32 vendor_oui;
> +
> + if (drm_dp_read_desc(&dp->aux, &dp->desc, drm_dp_is_branch(dp->dpcd))) {
> + DRM_ERROR("Can't read description\n");
> + return false;
> + }
> +
> + ident = &dp->desc.ident;
> + vendor_oui = (ident->oui[0] << 16) | (ident->oui[1] << 8) |
> +   ident->oui[2];
> +
> + switch (vendor_oui) {
> + case LSPCON_VENDOR_MCA_OUI:
> + lspcon->vendor = LSPCON_VENDOR_MCA;
> + DRM_DEBUG_KMS("Vendor: Mega Chips\n");
> + break;
> +
> + case LSPCON_VENDOR_PARADE_OUI:
> + lspcon->vendor = LSPCON_VENDOR_PARADE;
> + DRM_DEBUG_KMS("Vendor: Parade Tech\n");
> + break;
> +
> + default:
> + DRM_ERROR("Invalid/Unknown vendor OUI\n");
MISSING_CASE(vendor_oui) ?
> + return false;
> + }
> +
> + return true;
> +}
> +
>  static enum drm_lspcon_mode lspcon_get_current_mode(struct intel_lspcon 
> *lspcon)
>  {
>   enum drm_lspcon_mode current_mode;
> @@ -151,7 +189,18 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
>   /* Yay ... got a LSPCON device */
>   DRM_DEBUG_KMS("LSPCON detected\n");
>   lspcon->mode = lspcon_wait_mode(lspcon, expected_mode);
> - lspcon->active = true;
> +
> + /*
> +  * In the SW state machine, lets Put LSPCON in PCON mode only.
> +  * In this way, it will work with both HDMI 1.4 sinks as well as HDMI
> +  * 2.0 sinks.
> +  */
> + if (lspcon->active && lspcon->mode != DRM_LSPCON_MODE_PCON) {
> + if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON) < 0) {
> + DRM_ERROR("LSPCON mode change to PCON failed\n");
> + return false;
> + }
> + }
>   return true;
>  }
>  
> @@ -223,25 +272,17 @@ bool lspcon_init(struct intel_digital_port 
> *intel_dig_port)
>   return false;
>   }
>  
> - /*
> - * In the SW state machine, lets Put LSPCON in PCON mode only.
> - * In this way, it will work with both HDMI 1.4 sinks as well as HDMI
> - * 2.0 sinks.
> - */
> - if (lspcon->active && lspcon->mode != DRM_LSPCON_MODE_PCON) {
> - if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON) < 0) {
> - DRM_ERROR("LSPCON mode change to PCON failed\n");
> - return false;
> - }
> - }
> -
>   if (!intel_dp_read_dpcd(dp)) {
>   DRM_ERROR("LSPCON DPCD read failed\n");
>   return false;
>   }
>  
> - drm_dp_read_desc(&dp->aux, &dp->desc, drm_dp_is_branch(dp->dpcd));
> + if (!lspcon_detect_vendor(lspcon)) {
> + DRM_ERROR("LSPCON vendor detection failed\n");
> + return false;
> + }
E

Re: [Intel-gfx] [maintainer-tools PATCH] dim: Sign commits in addition to tags

2017-10-31 Thread Daniel Vetter
On Tue, Oct 31, 2017 at 10:27:24AM +0200, Jani Nikula wrote:
> 
> Reminder, we have this new list dim-to...@lists.freedesktop.org for
> maintainer tools patches. Cc'd.
> 
> On Mon, 30 Oct 2017, Sean Paul  wrote:
> > Expanding on Jani's work to sign tags, this patch adds signing for git
> > commit/am.
> 
> I guess I'd like more rationale here. Is this something we should be
> doing? Is anyone else doing this?

Same here. I get why signing tags makes sense, because email is an
entirely unsecured protocol. Signing commits otoh seems mildly silly.
What's the threat/attack model that prevents?

And if we go with signed commits, shouldn't we encourage contributors to
sign their mails and have some means to add the verification of the same
to the commit? This is what happens when you merge a signed patch at least
...

I'm confused about this.
-Daniel

> 
> > Signed-off-by: Sean Paul 
> > ---
> >
> > This has been lightly tested with dim apply-branch/dim push-branch.
> >
> > Sean
> >
> >  dim | 78 
> > +
> >  1 file changed, 51 insertions(+), 27 deletions(-)
> >
> > diff --git a/dim b/dim
> > index 527989aff9ad..cd5e41f89a3a 100755
> > --- a/dim
> > +++ b/dim
> > @@ -67,9 +67,6 @@ 
> > DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
> >  # dim pull-request tag summary template
> >  
> > DIM_TEMPLATE_TAG_SUMMARY=${DIM_TEMPLATE_TAG_SUMMARY:-$HOME/.dim.template.tagsummary}
> >  
> > -# GPG key id for signing tags. If unset, don't sign.
> > -DIM_GPG_KEYID=${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}
> > -
> >  #
> >  # Internal configuration.
> >  #
> > @@ -104,6 +101,20 @@ test_request_recipients=(
> >  # integration configuration
> >  integration_config=nightly.conf
> >  
> > +# GPG key id for signing tags. If unset, don't sign.
> > +function gpg_keyid_for_tag
> > +{
> > +   echo "${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}"
> > +   return 0
> > +}
> > +
> > +# GPG key id for committing (git commit/am). If unset, don't sign.
> > +function gpg_keyid_for_commit
> > +{
> > +   echo "${DIM_GPG_KEYID:+-S$DIM_GPG_KEYID}"
> > +   return 0
> > +}
> 
> This seems like an overly complicated way to achieve what you want.
> 
> Just put these under "Internal configuration." instead:
> 
> dim_gpg_sign_tag=${DIM_GPG_KEYID:+-u $DIM_GPG_KEYID}
> dim_gpg_sign_commit=${DIM_GPG_KEYID:+-S$DIM_GPG_KEYID}
> 
> And use directly in git tag and commit, respectively?
> 
> Although... perhaps starting to sign tags should not force signing
> commits?
> 
> BR,
> Jani.
> 
> 
> > +
> >  function read_integration_config
> >  {
> > # clear everything first to allow configuration reload
> > @@ -473,12 +484,14 @@ EOF
> >  # append all arguments as tags at the end of the commit message of HEAD
> >  function dim_commit_add_tag
> >  {
> > +   local gpg_keyid
> > +   gpg_keyid=$(gpg_keyid_for_commit)
> > for arg; do
> > # the first sed deletes all trailing blank lines at the end
> > git log -1 --pretty=%B | \
> > sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | \
> > sed "\$a${arg}" | \
> > -   git commit --amend -F-
> > +   git commit $gpg_keyid --amend -F-
> > done
> >  }
> >  
> > @@ -604,7 +617,7 @@ function update_rerere_cache
> >  
> >  function commit_rerere_cache
> >  {
> > -   local remote file commit_message
> > +   local remote file commit_message gpg_keyid
> >  
> > echo -n "Updating rerere cache... "
> >  
> > @@ -640,7 +653,8 @@ function commit_rerere_cache
> > $(git --version)
> > EOF
> >  
> > -   if git commit -F $commit_message >& /dev/null; then
> > +   gpg_keyid=$(gpg_keyid_for_commit)
> > +   if git commit $gpg_keyid -F $commit_message >& /dev/null; then
> > echo -n "New commit. "
> > else
> > echo -n "Nothing changed. "
> > @@ -653,13 +667,14 @@ function commit_rerere_cache
> >  
> >  function dim_rebuild_tip
> >  {
> > -   local integration_branch specfile first rerere repo remote
> > +   local integration_branch specfile first rerere repo remote gpg_keyid
> >  
> > integration_branch=drm-tip
> > specfile=$(mktemp)
> > first=1
> >  
> > rerere=$DIM_PREFIX/drm-rerere
> > +   gpg_keyid=$(gpg_keyid_for_commit)
> >  
> > cd $rerere
> > if git status --porcelain | grep -q -v "^[ ?][ ?]"; then
> > @@ -731,7 +746,7 @@ function dim_rebuild_tip
> >  
> > # because we filter out fast-forward merges there will
> > # always be something to commit
> > -   git commit --no-edit --quiet
> > +   git commit $gpg_keyid --no-edit --quiet
> > echo "Done."
> > fi
> >  
> > @@ -743,7 +758,7 @@ function dim_rebuild_tip
> > echo -n "Adding integration manifest $integration_branch: 
> > $dim_timestamp... "
> > mv $specfile integration-manifest
> > git add integration-manifest
> > -   git

Re: [Intel-gfx] [PATCH 1/2] drm/i915: Pass around crtc and connector states for audio

2017-10-31 Thread Jani Nikula
On Mon, 30 Oct 2017, Ville Syrjala  wrote:
> From: Ville Syrjälä 
>
> Explicitly pass the crtc and connector states into the audio
> code enable/disable hooks, and plumb them all the way down.
>
> This gets rid of almost all crtc->config and encoder->crtc
> uses. The one place where we still use them is
> i915_audio_component_sync_audio_rate() since that gets called from
> the audio driver and we don't have explicit states around then.

What a tedious patch to review!

On both,

Reviewed-by: Jani Nikula 


>
> Cc: Jani Nikula 
> Signed-off-by: Ville Syrjälä 
> ---
>  drivers/gpu/drm/i915/i915_drv.h |  10 +-
>  drivers/gpu/drm/i915/intel_audio.c  | 202 
> 
>  drivers/gpu/drm/i915/intel_ddi.c|   6 +-
>  drivers/gpu/drm/i915/intel_dp.c |   3 +-
>  drivers/gpu/drm/i915/intel_dp_mst.c |   3 +-
>  drivers/gpu/drm/i915/intel_drv.h|   4 +-
>  drivers/gpu/drm/i915/intel_hdmi.c   |   6 +-
>  7 files changed, 132 insertions(+), 102 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 4a7325c4189c..c10fece58e86 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -726,10 +726,12 @@ struct drm_i915_display_funcs {
>   void (*crtc_disable)(struct intel_crtc_state *old_crtc_state,
>struct drm_atomic_state *old_state);
>   void (*update_crtcs)(struct drm_atomic_state *state);
> - void (*audio_codec_enable)(struct drm_connector *connector,
> -struct intel_encoder *encoder,
> -const struct drm_display_mode 
> *adjusted_mode);
> - void (*audio_codec_disable)(struct intel_encoder *encoder);
> + void (*audio_codec_enable)(struct intel_encoder *encoder,
> +const struct intel_crtc_state *crtc_state,
> +const struct drm_connector_state 
> *conn_state);
> + void (*audio_codec_disable)(struct intel_encoder *encoder,
> + const struct intel_crtc_state 
> *old_crtc_state,
> + const struct drm_connector_state 
> *old_conn_state);
>   void (*fdi_link_train)(struct intel_crtc *crtc,
>  const struct intel_crtc_state *crtc_state);
>   void (*init_clock_gating)(struct drm_i915_private *dev_priv);
> diff --git a/drivers/gpu/drm/i915/intel_audio.c 
> b/drivers/gpu/drm/i915/intel_audio.c
> index 0ddba16fde1b..e56520037270 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -102,13 +102,13 @@ static const struct dp_aud_n_m dp_aud_n_m[] = {
>  };
>  
>  static const struct dp_aud_n_m *
> -audio_config_dp_get_n_m(struct intel_crtc *intel_crtc, int rate)
> +audio_config_dp_get_n_m(const struct intel_crtc_state *crtc_state, int rate)
>  {
>   int i;
>  
>   for (i = 0; i < ARRAY_SIZE(dp_aud_n_m); i++) {
>   if (rate == dp_aud_n_m[i].sample_rate &&
> - intel_crtc->config->port_clock == dp_aud_n_m[i].clock)
> + crtc_state->port_clock == dp_aud_n_m[i].clock)
>   return &dp_aud_n_m[i];
>   }
>  
> @@ -157,8 +157,10 @@ static const struct {
>  };
>  
>  /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
> -static u32 audio_config_hdmi_pixel_clock(const struct drm_display_mode 
> *adjusted_mode)
> +static u32 audio_config_hdmi_pixel_clock(const struct intel_crtc_state 
> *crtc_state)
>  {
> + const struct drm_display_mode *adjusted_mode =
> + &crtc_state->base.adjusted_mode;
>   int i;
>  
>   for (i = 0; i < ARRAY_SIZE(hdmi_audio_clock); i++) {
> @@ -179,9 +181,11 @@ static u32 audio_config_hdmi_pixel_clock(const struct 
> drm_display_mode *adjusted
>   return hdmi_audio_clock[i].config;
>  }
>  
> -static int audio_config_hdmi_get_n(const struct drm_display_mode 
> *adjusted_mode,
> +static int audio_config_hdmi_get_n(const struct intel_crtc_state *crtc_state,
>  int rate)
>  {
> + const struct drm_display_mode *adjusted_mode =
> + &crtc_state->base.adjusted_mode;
>   int i;
>  
>   for (i = 0; i < ARRAY_SIZE(hdmi_aud_ncts); i++) {
> @@ -220,7 +224,9 @@ static bool intel_eld_uptodate(struct drm_connector 
> *connector,
>   return true;
>  }
>  
> -static void g4x_audio_codec_disable(struct intel_encoder *encoder)
> +static void g4x_audio_codec_disable(struct intel_encoder *encoder,
> + const struct intel_crtc_state 
> *old_crtc_state,
> + const struct drm_connector_state 
> *old_conn_state)
>  {
>   struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>   uint32_t eldv, tmp;
> @@ -239,11 +245,12 @@ static void g4x_audio_codec_disable(struct 
> intel_encoder *encoder)
>   I915_WRITE(G4X_AUD_CNTL_ST, tmp);
>  }
>  
> -static void g4x_audio_codec

Re: [Intel-gfx] ✓ Fi.CI.IGT: success for tests: add device information tests

2017-10-31 Thread Petri Latvala
On Mon, Oct 30, 2017 at 02:11:10PM +, Patchwork wrote:
> == Series Details ==
> 
> Series: tests: add device information tests
> URL   : https://patchwork.freedesktop.org/series/32764/
> State : success
> 
> == Summary ==
> 
> Test kms_flip:
> Subgroup basic-flip-vs-wf_vblank:
> fail   -> PASS   (shard-hsw) fdo#100368
> Subgroup wf_vblank-vs-dpms-interruptible:
> pass   -> DMESG-WARN (shard-hsw) fdo#102614
> Test kms_busy:
> Subgroup extended-modeset-hang-newfb-with-reset-render-A:
> pass   -> DMESG-WARN (shard-hsw) fdo#102249 +2
> 


Status of new tests are not shown here.

Only SNB, HSW and APL execute shards for patchwork, and their results are:

All new tests skipped, except for topology-pre-gen8 which failed on SNB and HSW.

https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_442/shard-hsw4/igt@intel_device_i...@topology-pre-gen8.html



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


[Intel-gfx] [PATCH 0/2] DRRS coverage in frontbuffer tracking IGT

2017-10-31 Thread Ramalingam C
From: "C, Ramalingam" 

FBC, DRRS and PSR are based on front buffer tracking infra.
So the features in this set, needs to be tested for all possible test
cases of front buffer tracking, individually and in all combinations
of the features.

eDP Idleness DRRS is implemented based on front buffer tracking.
So DRRS is added as a feature to get tested in kms_frontbuffer_tracking.

Till now if DRRS is enabled from VBT(platform) and panel, DRRS will be
always enabled and active. Considering PSR's effectiveness over DRRS,
recently DRRS is not enabled if PSR is enabled.

But to test FBC individually, we need to disable the DRRS and PSR.
This series adds the corresponding changes(module param enable_drrs) to
kernel, to control the DRRS enable path.

With this kernel changes IGT/Userspace will be able to disable the eDP
DRRS in runtime.

C, Ramalingam (2):
  drm/i915: Runtime disable for eDP DRRS
  i915/drrs/debugfs: module param and psr status

 drivers/gpu/drm/i915/i915_debugfs.c | 11 ++-
 drivers/gpu/drm/i915/i915_params.c  |  3 +++
 drivers/gpu/drm/i915/i915_params.h  |  3 ++-
 drivers/gpu/drm/i915/intel_dp.c |  6 ++
 4 files changed, 21 insertions(+), 2 deletions(-)

BS, Lohith (1):
  tests/kms_frontbuffer_tracking: Idleness DRRS coverage

 tests/kms_frontbuffer_tracking.c | 136 +++
 1 file changed, 124 insertions(+), 12 deletions(-)

-- 
2.7.4

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


[Intel-gfx] [PATCH 1/2] drm/i915: Runtime disable for eDP DRRS

2017-10-31 Thread Ramalingam C
From: "C, Ramalingam" 

Module parameter enable_drrs(Boolean flag) is added to control the
eDP Idleness drrs enable flow.

Modification to this module parameter will be considered on next
eDP_DRRS enable flow. So after module parameter update, a modeset
will help to modify the feature state as per the module parameter's
current state.

Possibility of disabling the DRRS, enables the testing of the
frontbuffer tracking based features (FBC, DRRS and PSR) as standalone
or any combination of the set.

Signed-off-by: C, Ramalingam 
---
 drivers/gpu/drm/i915/i915_params.c | 3 +++
 drivers/gpu/drm/i915/i915_params.h | 3 ++-
 drivers/gpu/drm/i915/intel_dp.c| 6 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_params.c 
b/drivers/gpu/drm/i915/i915_params.c
index b4faeb6aa2bd..32f06bb74f9d 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -190,3 +190,6 @@ i915_param_named(enable_dpcd_backlight, bool, 0600,
 
 i915_param_named(enable_gvt, bool, 0400,
"Enable support for Intel GVT-g graphics virtualization host 
support(default:false)");
+
+i915_param_named_unsafe(enable_drrs, bool, 0600,
+   "Enable DRRS. (True=Enabled, False=Disabled [Default])");
diff --git a/drivers/gpu/drm/i915/i915_params.h 
b/drivers/gpu/drm/i915/i915_params.h
index c7292268ed43..3c6fdce1c122 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -67,7 +67,8 @@
param(bool, nuclear_pageflip, false) \
param(bool, enable_dp_mst, true) \
param(bool, enable_dpcd_backlight, false) \
-   param(bool, enable_gvt, false)
+   param(bool, enable_gvt, false) \
+   param(bool, enable_drrs, false)
 
 #define MEMBER(T, member, ...) T member;
 struct i915_params {
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index ca48bce23a6f..ff9964cf15cd 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5568,6 +5568,11 @@ void intel_edp_drrs_enable(struct intel_dp *intel_dp,
return;
}
 
+   if (!i915_modparams.enable_drrs) {
+   DRM_DEBUG_KMS("DRRS is disabled from modparams\n");
+   return;
+   }
+
mutex_lock(&dev_priv->drrs.mutex);
if (WARN_ON(dev_priv->drrs.dp)) {
DRM_ERROR("DRRS already enabled\n");
@@ -5817,6 +5822,7 @@ intel_dp_drrs_init(struct intel_connector 
*intel_connector,
}
 
dev_priv->drrs.type = dev_priv->vbt.drrs_type;
+   i915_modparams.enable_drrs = true;
 
dev_priv->drrs.refresh_rate_type = DRRS_HIGH_RR;
DRM_DEBUG_KMS("seamless DRRS supported for eDP panel.\n");
-- 
2.7.4

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


[Intel-gfx] [PATCH 2/2] i915/drrs/debugfs: module param and psr status

2017-10-31 Thread Ramalingam C
From: "C, Ramalingam" 

When DRRS is disabled, i915_drrs_status is updated with the runtime
disable state of drrs due to
i915_modparams.enable_drrs - module parameters
psr.enabled -   psr active status

Signed-off-by: C, Ramalingam 
---
 drivers/gpu/drm/i915/i915_debugfs.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 5b58d2b897c7..0a0ae22fc9c2 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -3569,7 +3569,16 @@ static void drrs_status_per_crtc(struct seq_file *m,
 
/* disable_drrs() will make drrs->dp NULL */
if (!drrs->dp) {
-   seq_puts(m, "Idleness DRRS: Disabled");
+   seq_puts(m, "Idleness DRRS: Disabled\n");
+
+   if (!i915_modparams.enable_drrs)
+   seq_puts(m,
+   "\tModule parameter enable_drrs is disabled\n");
+
+   if (dev_priv->psr.enabled)
+   seq_puts(m,
+   "\tAs PSR is enabled, DRRS is not enabled\n");
+
mutex_unlock(&drrs->mutex);
return;
}
-- 
2.7.4

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


[Intel-gfx] [PATCH i-g-t] tests/kms_frontbuffer_tracking: Idleness DRRS coverage

2017-10-31 Thread Ramalingam C
From: Lohith BS 

By default the DRRS state will be at DRRS_HIGH_RR. When a Display
content is Idle for more than 1Sec Idleness will be declared and
DRRS_LOW_RR will be invoked, changing the refresh rate to the
lower most refresh rate supported by the panel. As soon as there
is a display content change there will be a DRRS state transition
as DRRS_LOW_RR--> DRRS_HIGH_RR, changing the refresh rate to the
highest refresh rate supported by the panel.

To test this, Idleness DRRS IGT will probe the DRRS state at below
instances and compare with the expected state.

InstanceExpected State
1. Immediately after rendering the still image  DRRS_HIGH_RR
2. After a delay of 1.2Sec  DRRS_LOW_RR
3. After changing the frame buffer  DRRS_HIGH_RR
4. After a delay of 1.2Sec  DRRS_LOW_RR
5. After changing the frame buffer  DRRS_HIGH_RR
6. After a delay of 1.2Sec  DRRS_LOW_RR

The test checks the driver DRRS state from the debugfs entry.
To check the actual refresh-rate, the number of vblanks received
per sec.
The refresh-rate calculated is checked against the expected refresh-rate
with a tolerance value of 2.

This patch is a continuation of the earlier work
https://patchwork.freedesktop.org/patch/45472/ towards igt for idleness
DRRS. The code is tested on Broxton BXT_T platform.

v2: Addressed the comments and suggestions from Vlad, Marius.
The signoff details from the earlier work are also included.

v3: Modified vblank rate calculation by using reply-sequence,
provided by drmWaitVBlank, as suggested by Chris Wilson.

v4: As suggested from Chris Wilson and Daniel Vetter
1) Avoided using pthread for calculating vblank refresh rate,
   instead used drmWaitVBlank reply sequence.
2) Avoided using kernel-specific info like transitional delays,
   instead polling mechanism with timeout is used.
3) Included edp-DRRS as a subtest in kms_frontbuffer_tracking.c,
   instead of having a separate test.

v5: This patch adds DRRS as a new feature in the
kms_frontbuffer_tracking IGT.
DRRS switch to lower vrefresh rate is tested at slow-draw
subtest. This is in continuation of last patch
"https://patchwork.freedesktop.org/patch/162726/";

v6: This patch adds runtime enable and disable feature for
testing DRRS

Signed-off-by: Lohith BS 
Signed-off-by: aknautiy 
---
 tests/kms_frontbuffer_tracking.c | 134 +++
 1 file changed, 123 insertions(+), 11 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index a068c8afb6d8..fdb4f57d4698 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -34,7 +34,7 @@
 
 
 IGT_TEST_DESCRIPTION("Test the Kernel's frontbuffer tracking mechanism and "
-"its related features: FBC and PSR");
+"its related features: FBC, DRRS and PSR");
 
 /*
  * One of the aspects of this test is that, for every subtest, we try different
@@ -105,8 +105,9 @@ struct test_mode {
FEATURE_NONE  = 0,
FEATURE_FBC   = 1,
FEATURE_PSR   = 2,
-   FEATURE_COUNT = 4,
-   FEATURE_DEFAULT = 4,
+   FEATURE_DRRS  = 4,
+   FEATURE_COUNT = 6,
+   FEATURE_DEFAULT = 6,
} feature;
 
/* Possible pixel formats. We just use FORMAT_DEFAULT for most tests and
@@ -178,10 +179,8 @@ struct {
 
 struct {
bool can_test;
-} psr = {
-   .can_test = false,
-};
-
+} psr = { .can_test = false,},
+drrs = { .can_test = false,};
 
 #define SINK_CRC_SIZE 12
 typedef struct {
@@ -822,6 +821,54 @@ static void psr_print_status(void)
igt_info("PSR status:\n%s\n", buf);
 }
 
+static bool is_drrs_high(void)
+{
+   char buf[256];
+
+   debugfs_read("i915_drrs_status", buf);
+   return strstr(buf, "DRRS_HIGH_RR");
+}
+
+static bool is_drrs_low(void)
+{
+   char buf[256];
+
+   debugfs_read("i915_drrs_status", buf);
+   return strstr(buf, "DRRS_LOW_RR");
+}
+
+static bool is_drrs_supported(void)
+{
+   char buf[256];
+
+   debugfs_read("i915_drrs_status", buf);
+   return strstr(buf, "DRRS Supported: Yes");
+}
+
+static bool is_drrs_inactive(void)
+{
+   char buf[256];
+
+   debugfs_read("i915_drrs_status", buf);
+
+   if (strstr(buf, "No active crtc found"))
+   return true;
+   if (strstr(buf, "Idleness DRRS: Disabled"))
+   return true;
+   if (strstr(buf, "DRRS Supported : No"))
+   return true;
+
+   return false;
+}
+
+static void drrs_print_status(void)
+{
+   char buf[256];
+
+   debugfs_read("i915_drrs_status", buf);
+   igt_info("DRRS STATUS :\n%s\n", buf);
+}
+
 static struc

[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Runtime disable for eDP DRRS

2017-10-31 Thread Patchwork
== Series Details ==

Series: series starting with [1/2] drm/i915: Runtime disable for eDP DRRS
URL   : https://patchwork.freedesktop.org/series/32887/
State : failure

== Summary ==

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
scripts/kconfig/Makefile:37: recipe for target 'silentoldconfig' failed
make[2]: *** [silentoldconfig] Error 1
Makefile:547: recipe for target 'silentoldconfig' failed
make[1]: *** [silentoldconfig] Error 2
  SYSTBL  arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_64.h
  SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_x32.h
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
make: *** No rule to make target 'include/config/auto.conf', needed by 
'include/config/kernel.release'.  Stop.

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


[Intel-gfx] sound tree breaks make clean

2017-10-31 Thread Daniel Vetter
Hi all,

The following commit

commit 60d4981ccf3603669c8de304619048ad5da707bd
Author: Takashi Iwai 
Date:   Tue Oct 24 09:15:23 2017 +0200

sound: Retire OSS


breaks

$ make defconfig && make clean

(just make clean in an already clean tree seems to work).

We've taken the sound tree out of drm-tip and our CI for now to work
around this.

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
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 [1/2] drm/i915: Runtime disable for eDP DRRS

2017-10-31 Thread Patchwork
== Series Details ==

Series: series starting with [1/2] drm/i915: Runtime disable for eDP DRRS
URL   : https://patchwork.freedesktop.org/series/32887/
State : success

== Summary ==

Series 32887v1 series starting with [1/2] drm/i915: Runtime disable for eDP DRRS
https://patchwork.freedesktop.org/api/1.0/series/32887/revisions/1/mbox/

Test chamelium:
Subgroup dp-crc-fast:
fail   -> PASS   (fi-kbl-7500u) fdo#102514
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
pass   -> INCOMPLETE (fi-kbl-7560u) fdo#102846

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#102846 https://bugs.freedesktop.org/show_bug.cgi?id=102846

fi-bdw-5557u total:289  pass:266  dwarn:0   dfail:0   fail:2   skip:21  
time:458s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:450s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:375s
fi-bsw-n3050 total:289  pass:241  dwarn:0   dfail:0   fail:2   skip:46  
time:543s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:264s
fi-bxt-dsi   total:289  pass:257  dwarn:0   dfail:0   fail:2   skip:30  
time:507s
fi-bxt-j4205 total:289  pass:258  dwarn:0   dfail:0   fail:2   skip:29  
time:505s
fi-byt-j1900 total:289  pass:251  dwarn:1   dfail:0   fail:2   skip:35  
time:510s
fi-byt-n2820 total:289  pass:247  dwarn:1   dfail:0   fail:2   skip:39  
time:485s
fi-cfl-s total:289  pass:251  dwarn:4   dfail:0   fail:2   skip:32  
time:572s
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:421s
fi-glk-1 total:289  pass:259  dwarn:0   dfail:0   fail:2   skip:28  
time:588s
fi-hsw-4770  total:289  pass:260  dwarn:0   dfail:0   fail:2   skip:27  
time:448s
fi-hsw-4770r total:289  pass:260  dwarn:0   dfail:0   fail:2   skip:27  
time:444s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:419s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:501s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:462s
fi-kbl-7500u total:289  pass:262  dwarn:1   dfail:0   fail:2   skip:24  
time:505s
fi-kbl-7560u total:245  pass:228  dwarn:0   dfail:0   fail:0   skip:16 
fi-kbl-7567u total:289  pass:267  dwarn:0   dfail:0   fail:2   skip:20  
time:499s
fi-kbl-r total:289  pass:260  dwarn:0   dfail:0   fail:2   skip:27  
time:592s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:545s
fi-skl-6260u total:289  pass:267  dwarn:0   dfail:0   fail:2   skip:20  
time:465s
fi-skl-6600u total:289  pass:260  dwarn:0   dfail:0   fail:2   skip:27  
time:598s
fi-skl-6700hqtotal:289  pass:261  dwarn:0   dfail:0   fail:2   skip:26  
time:660s
fi-skl-6700k total:289  pass:263  dwarn:0   dfail:0   fail:2   skip:24  
time:535s
fi-skl-6770hqtotal:289  pass:267  dwarn:0   dfail:0   fail:2   skip:20  
time:515s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:458s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:559s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:415s
fi-gdg-551 failed to connect after reboot

5cbec54b8fde4142d7e3f09e62fc9e17fb9fe516 drm-tip: 2017y-10m-31d-00h-01m-01s UTC 
integration manifest
ca8a42579aef i915/drrs/debugfs: module param and psr status
c958c8e33a91 drm/i915: Runtime disable for eDP DRRS

== Logs ==

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


Re: [Intel-gfx] [PATCH v5 2/2] drm/i915: Acquire PUNIT->PMIC bus for intel_uncore_forcewake_reset()

2017-10-31 Thread Ingo Molnar

* Hans de Goede  wrote:

> intel_uncore_forcewake_reset() does forcewake puts and gets as such
> we need to make sure that no-one tries to access the PUNIT->PMIC bus
> (on systems where this bus is shared) while it runs, otherwise bad
> things happen.
> 
> Normally this is taken care of by the i915_pmic_bus_access_notifier()
> which does an intel_uncore_forcewake_get(FORCEWAKE_ALL) when some other
> driver tries to access the PMIC bus, so that later forcewake gets are
> no-ops (for the duration of the bus access).
> 
> But intel_uncore_forcewake_reset gets called in 3 cases:
> 1) Before registering the pmic_bus_access_notifier
> 2) After unregistering the pmic_bus_access_notifier
> 3) To reset forcewake state on a GPU reset
> 
> In all 3 cases the i915_pmic_bus_access_notifier() protection is
> insufficient.
> 
> This commit fixes this race by calling iosf_mbi_punit_acquire() before
> calling intel_uncore_forcewake_reset(). In the case where it is called
> directly after unregistering the pmic_bus_access_notifier, we need to
> hold the punit-lock over both calls to avoid a race where
> intel_uncore_fw_release_timer() may execute between the 2 calls.
> 
> Signed-off-by: Hans de Goede 
> Reviewed-by: Imre Deak 
> ---
> Changes in v2:
> -Rebase on current (July 6th 2017) drm-next
> 
> Changes in v3:
> -Keep punit acquired / locked over the unregister + forcewake_reset
>  call combo to avoid a race hitting between the 2 calls
> -This requires modifying iosf_mbi_unregister_pmic_bus_access_notifier
>  to not take the lock itself, since we are the only users this is done
>  in this same commit
> 
> Changes in v4:
> -Fix missing rename in doc-comment
> -Add and use iosf_mbi_assert_punit_acquired() helper
> -Add missing acquire surrounding intel_uncore_forcewake_reset() inside
>  intel_uncore_check_forcewake_domains()
> -Add Imre's Reviewed-by
> 
> Changes in v5:
> -Separate out arch/x86 iosf_mbi changes into a separate patch
> ---
>  drivers/gpu/drm/i915/intel_uncore.c   | 17 +
>  drivers/gpu/drm/i915/selftests/intel_uncore.c |  3 +++
>  2 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c 
> b/drivers/gpu/drm/i915/intel_uncore.c
> index 8c2ce81f01c2..0da81faf3981 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -229,6 +229,7 @@ intel_uncore_fw_release_timer(struct hrtimer *timer)
>   return HRTIMER_NORESTART;
>  }
>  
> +/* Note callers must have acquired the PUNIT->PMIC bus, before calling this. 
> */
>  static void intel_uncore_forcewake_reset(struct drm_i915_private *dev_priv,
>bool restore)
>  {
> @@ -237,6 +238,8 @@ static void intel_uncore_forcewake_reset(struct 
> drm_i915_private *dev_priv,
>   int retry_count = 100;
>   enum forcewake_domains fw, active_domains;
>  
> + iosf_mbi_assert_punit_acquired();
> +
>   /* Hold uncore.lock across reset to prevent any register access
>* with forcewake not set correctly. Wait until all pending
>* timers are run before holding.
> @@ -416,14 +419,18 @@ static void __intel_uncore_early_sanitize(struct 
> drm_i915_private *dev_priv,
>  GT_FIFO_CTL_RC6_POLICY_STALL);
>   }
>  
> + iosf_mbi_punit_acquire();
>   intel_uncore_forcewake_reset(dev_priv, restore_forcewake);
> + iosf_mbi_punit_release();
>  }
>  
>  void intel_uncore_suspend(struct drm_i915_private *dev_priv)
>  {
> - iosf_mbi_unregister_pmic_bus_access_notifier(
> + iosf_mbi_punit_acquire();
> + iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
>   &dev_priv->uncore.pmic_bus_access_nb);
>   intel_uncore_forcewake_reset(dev_priv, false);
> + iosf_mbi_punit_release();
>  }
>  
>  void intel_uncore_resume_early(struct drm_i915_private *dev_priv)
> @@ -1315,12 +1322,14 @@ void intel_uncore_init(struct drm_i915_private 
> *dev_priv)
>  
>  void intel_uncore_fini(struct drm_i915_private *dev_priv)
>  {
> - iosf_mbi_unregister_pmic_bus_access_notifier(
> - &dev_priv->uncore.pmic_bus_access_nb);
> -
>   /* Paranoia: make sure we have disabled everything before we exit. */
>   intel_uncore_sanitize(dev_priv);
> +
> + iosf_mbi_punit_acquire();
> + iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
> + &dev_priv->uncore.pmic_bus_access_nb);
>   intel_uncore_forcewake_reset(dev_priv, false);
> + iosf_mbi_punit_release();
>  }
>  
>  static const struct reg_whitelist {
> diff --git a/drivers/gpu/drm/i915/selftests/intel_uncore.c 
> b/drivers/gpu/drm/i915/selftests/intel_uncore.c
> index 3cac22eb47ce..733d87fe7737 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_uncore.c
> @@ -148,7 +148,10 @@ static int intel_uncore_check_forcewake_domains(struct 
> drm_i915_private *dev_pri
>   for_each_set_bit(offset, valid, FW_RANGE) {
> 

Re: [Intel-gfx] [PATCH v5 2/2] drm/i915: Acquire PUNIT->PMIC bus for intel_uncore_forcewake_reset()

2017-10-31 Thread Daniel Vetter
On Tue, Oct 31, 2017 at 10:50:06AM +0100, Ingo Molnar wrote:
> 
> * Hans de Goede  wrote:
> 
> > intel_uncore_forcewake_reset() does forcewake puts and gets as such
> > we need to make sure that no-one tries to access the PUNIT->PMIC bus
> > (on systems where this bus is shared) while it runs, otherwise bad
> > things happen.
> > 
> > Normally this is taken care of by the i915_pmic_bus_access_notifier()
> > which does an intel_uncore_forcewake_get(FORCEWAKE_ALL) when some other
> > driver tries to access the PMIC bus, so that later forcewake gets are
> > no-ops (for the duration of the bus access).
> > 
> > But intel_uncore_forcewake_reset gets called in 3 cases:
> > 1) Before registering the pmic_bus_access_notifier
> > 2) After unregistering the pmic_bus_access_notifier
> > 3) To reset forcewake state on a GPU reset
> > 
> > In all 3 cases the i915_pmic_bus_access_notifier() protection is
> > insufficient.
> > 
> > This commit fixes this race by calling iosf_mbi_punit_acquire() before
> > calling intel_uncore_forcewake_reset(). In the case where it is called
> > directly after unregistering the pmic_bus_access_notifier, we need to
> > hold the punit-lock over both calls to avoid a race where
> > intel_uncore_fw_release_timer() may execute between the 2 calls.
> > 
> > Signed-off-by: Hans de Goede 
> > Reviewed-by: Imre Deak 
> > ---
> > Changes in v2:
> > -Rebase on current (July 6th 2017) drm-next
> > 
> > Changes in v3:
> > -Keep punit acquired / locked over the unregister + forcewake_reset
> >  call combo to avoid a race hitting between the 2 calls
> > -This requires modifying iosf_mbi_unregister_pmic_bus_access_notifier
> >  to not take the lock itself, since we are the only users this is done
> >  in this same commit
> > 
> > Changes in v4:
> > -Fix missing rename in doc-comment
> > -Add and use iosf_mbi_assert_punit_acquired() helper
> > -Add missing acquire surrounding intel_uncore_forcewake_reset() inside
> >  intel_uncore_check_forcewake_domains()
> > -Add Imre's Reviewed-by
> > 
> > Changes in v5:
> > -Separate out arch/x86 iosf_mbi changes into a separate patch
> > ---
> >  drivers/gpu/drm/i915/intel_uncore.c   | 17 +
> >  drivers/gpu/drm/i915/selftests/intel_uncore.c |  3 +++
> >  2 files changed, 16 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_uncore.c 
> > b/drivers/gpu/drm/i915/intel_uncore.c
> > index 8c2ce81f01c2..0da81faf3981 100644
> > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > @@ -229,6 +229,7 @@ intel_uncore_fw_release_timer(struct hrtimer *timer)
> > return HRTIMER_NORESTART;
> >  }
> >  
> > +/* Note callers must have acquired the PUNIT->PMIC bus, before calling 
> > this. */
> >  static void intel_uncore_forcewake_reset(struct drm_i915_private *dev_priv,
> >  bool restore)
> >  {
> > @@ -237,6 +238,8 @@ static void intel_uncore_forcewake_reset(struct 
> > drm_i915_private *dev_priv,
> > int retry_count = 100;
> > enum forcewake_domains fw, active_domains;
> >  
> > +   iosf_mbi_assert_punit_acquired();
> > +
> > /* Hold uncore.lock across reset to prevent any register access
> >  * with forcewake not set correctly. Wait until all pending
> >  * timers are run before holding.
> > @@ -416,14 +419,18 @@ static void __intel_uncore_early_sanitize(struct 
> > drm_i915_private *dev_priv,
> >GT_FIFO_CTL_RC6_POLICY_STALL);
> > }
> >  
> > +   iosf_mbi_punit_acquire();
> > intel_uncore_forcewake_reset(dev_priv, restore_forcewake);
> > +   iosf_mbi_punit_release();
> >  }
> >  
> >  void intel_uncore_suspend(struct drm_i915_private *dev_priv)
> >  {
> > -   iosf_mbi_unregister_pmic_bus_access_notifier(
> > +   iosf_mbi_punit_acquire();
> > +   iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
> > &dev_priv->uncore.pmic_bus_access_nb);
> > intel_uncore_forcewake_reset(dev_priv, false);
> > +   iosf_mbi_punit_release();
> >  }
> >  
> >  void intel_uncore_resume_early(struct drm_i915_private *dev_priv)
> > @@ -1315,12 +1322,14 @@ void intel_uncore_init(struct drm_i915_private 
> > *dev_priv)
> >  
> >  void intel_uncore_fini(struct drm_i915_private *dev_priv)
> >  {
> > -   iosf_mbi_unregister_pmic_bus_access_notifier(
> > -   &dev_priv->uncore.pmic_bus_access_nb);
> > -
> > /* Paranoia: make sure we have disabled everything before we exit. */
> > intel_uncore_sanitize(dev_priv);
> > +
> > +   iosf_mbi_punit_acquire();
> > +   iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
> > +   &dev_priv->uncore.pmic_bus_access_nb);
> > intel_uncore_forcewake_reset(dev_priv, false);
> > +   iosf_mbi_punit_release();
> >  }
> >  
> >  static const struct reg_whitelist {
> > diff --git a/drivers/gpu/drm/i915/selftests/intel_uncore.c 
> > b/drivers/gpu/drm/i915/selftests/intel_uncore.c
> > index 3cac22eb47ce..733d87fe7737 100644
> > --- a/drivers/gpu/

Re: [Intel-gfx] sound tree breaks make clean

2017-10-31 Thread Takashi Iwai
On Tue, 31 Oct 2017 10:41:15 +0100,
Daniel Vetter wrote:
> 
> Hi all,
> 
> The following commit
> 
> commit 60d4981ccf3603669c8de304619048ad5da707bd
> Author: Takashi Iwai 
> Date:   Tue Oct 24 09:15:23 2017 +0200
> 
> sound: Retire OSS
> 
> 
> breaks
> 
> $ make defconfig && make clean
> 
> (just make clean in an already clean tree seems to work).
> 
> We've taken the sound tree out of drm-tip and our CI for now to work
> around this.

Ouch, I forgot to check this.  There was a leftover in
sound/Makefile.  I'll fix it up.


thanks,

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


Re: [Intel-gfx] [PATCH v5 2/2] drm/i915: Acquire PUNIT->PMIC bus for intel_uncore_forcewake_reset()

2017-10-31 Thread Hans de Goede

Hi,

On 31-10-17 10:50, Ingo Molnar wrote:


* Hans de Goede  wrote:


intel_uncore_forcewake_reset() does forcewake puts and gets as such
we need to make sure that no-one tries to access the PUNIT->PMIC bus
(on systems where this bus is shared) while it runs, otherwise bad
things happen.

Normally this is taken care of by the i915_pmic_bus_access_notifier()
which does an intel_uncore_forcewake_get(FORCEWAKE_ALL) when some other
driver tries to access the PMIC bus, so that later forcewake gets are
no-ops (for the duration of the bus access).

But intel_uncore_forcewake_reset gets called in 3 cases:
1) Before registering the pmic_bus_access_notifier
2) After unregistering the pmic_bus_access_notifier
3) To reset forcewake state on a GPU reset

In all 3 cases the i915_pmic_bus_access_notifier() protection is
insufficient.

This commit fixes this race by calling iosf_mbi_punit_acquire() before
calling intel_uncore_forcewake_reset(). In the case where it is called
directly after unregistering the pmic_bus_access_notifier, we need to
hold the punit-lock over both calls to avoid a race where
intel_uncore_fw_release_timer() may execute between the 2 calls.

Signed-off-by: Hans de Goede 
Reviewed-by: Imre Deak 
---
Changes in v2:
-Rebase on current (July 6th 2017) drm-next

Changes in v3:
-Keep punit acquired / locked over the unregister + forcewake_reset
  call combo to avoid a race hitting between the 2 calls
-This requires modifying iosf_mbi_unregister_pmic_bus_access_notifier
  to not take the lock itself, since we are the only users this is done
  in this same commit

Changes in v4:
-Fix missing rename in doc-comment
-Add and use iosf_mbi_assert_punit_acquired() helper
-Add missing acquire surrounding intel_uncore_forcewake_reset() inside
  intel_uncore_check_forcewake_domains()
-Add Imre's Reviewed-by

Changes in v5:
-Separate out arch/x86 iosf_mbi changes into a separate patch
---
  drivers/gpu/drm/i915/intel_uncore.c   | 17 +
  drivers/gpu/drm/i915/selftests/intel_uncore.c |  3 +++
  2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c 
b/drivers/gpu/drm/i915/intel_uncore.c
index 8c2ce81f01c2..0da81faf3981 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -229,6 +229,7 @@ intel_uncore_fw_release_timer(struct hrtimer *timer)
return HRTIMER_NORESTART;
  }
  
+/* Note callers must have acquired the PUNIT->PMIC bus, before calling this. */

  static void intel_uncore_forcewake_reset(struct drm_i915_private *dev_priv,
 bool restore)
  {
@@ -237,6 +238,8 @@ static void intel_uncore_forcewake_reset(struct 
drm_i915_private *dev_priv,
int retry_count = 100;
enum forcewake_domains fw, active_domains;
  
+	iosf_mbi_assert_punit_acquired();

+
/* Hold uncore.lock across reset to prevent any register access
 * with forcewake not set correctly. Wait until all pending
 * timers are run before holding.
@@ -416,14 +419,18 @@ static void __intel_uncore_early_sanitize(struct 
drm_i915_private *dev_priv,
   GT_FIFO_CTL_RC6_POLICY_STALL);
}
  
+	iosf_mbi_punit_acquire();

intel_uncore_forcewake_reset(dev_priv, restore_forcewake);
+   iosf_mbi_punit_release();
  }
  
  void intel_uncore_suspend(struct drm_i915_private *dev_priv)

  {
-   iosf_mbi_unregister_pmic_bus_access_notifier(
+   iosf_mbi_punit_acquire();
+   iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
&dev_priv->uncore.pmic_bus_access_nb);
intel_uncore_forcewake_reset(dev_priv, false);
+   iosf_mbi_punit_release();
  }
  
  void intel_uncore_resume_early(struct drm_i915_private *dev_priv)

@@ -1315,12 +1322,14 @@ void intel_uncore_init(struct drm_i915_private 
*dev_priv)
  
  void intel_uncore_fini(struct drm_i915_private *dev_priv)

  {
-   iosf_mbi_unregister_pmic_bus_access_notifier(
-   &dev_priv->uncore.pmic_bus_access_nb);
-
/* Paranoia: make sure we have disabled everything before we exit. */
intel_uncore_sanitize(dev_priv);
+
+   iosf_mbi_punit_acquire();
+   iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
+   &dev_priv->uncore.pmic_bus_access_nb);
intel_uncore_forcewake_reset(dev_priv, false);
+   iosf_mbi_punit_release();
  }
  
  static const struct reg_whitelist {

diff --git a/drivers/gpu/drm/i915/selftests/intel_uncore.c 
b/drivers/gpu/drm/i915/selftests/intel_uncore.c
index 3cac22eb47ce..733d87fe7737 100644
--- a/drivers/gpu/drm/i915/selftests/intel_uncore.c
+++ b/drivers/gpu/drm/i915/selftests/intel_uncore.c
@@ -148,7 +148,10 @@ static int intel_uncore_check_forcewake_domains(struct 
drm_i915_private *dev_pri
for_each_set_bit(offset, valid, FW_RANGE) {
i915_reg_t reg = { offset };
  
+		iosf_mbi_punit_acquire();

intel_uncore_forcewake_reset(d

Re: [Intel-gfx] [PATCH v3 4/7] drm/fb-helper: Apply panel orientation connector prop to the primary plane

2017-10-31 Thread Daniel Vetter
On Mon, Oct 30, 2017 at 12:09:27PM +0100, Hans de Goede wrote:
> Hi,
> 
> On 30-10-17 10:52, Daniel Vetter wrote:
> > On Mon, Oct 23, 2017 at 09:14:22AM +0200, Hans de Goede wrote:
> > > Apply the "panel orientation" drm connector prop to the primary plane so
> > > that fbcon and fbdev using userspace programs display the right way up.
> > > 
> > > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=94894
> > > Signed-off-by: Hans de Goede 
> > > ---
> > > Changes in v2:
> > > -New patch in v2 of this patch-set
> > > 
> > > Changes in v3:
> > > -Use a rotation member in struct drm_fb_helper_crtc and set that from
> > >   drm_setup_crtcs instead of looping over all crtc's to find the right one
> > >   later
> > > -Since we now no longer look at rotation quirks directly in the fbcon 
> > > code,
> > >   set fb_info.fbcon_rotate_hint when the panel is not mounted upright and
> > >   we cannot use hardware rotation
> > > ---
> > >   drivers/gpu/drm/drm_fb_helper.c | 76 
> > > +++--
> > >   include/drm/drm_fb_helper.h |  8 +
> > >   2 files changed, 82 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_fb_helper.c 
> > > b/drivers/gpu/drm/drm_fb_helper.c
> > > index 116d1f1337c7..e0f95f2cc52f 100644
> > > --- a/drivers/gpu/drm/drm_fb_helper.c
> > > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > > @@ -41,6 +41,7 @@
> > >   #include 
> > >   #include 
> > > +#include "drm_crtc_internal.h"
> > >   #include "drm_crtc_helper_internal.h"
> > >   static bool drm_fbdev_emulation = true;
> > > @@ -350,6 +351,7 @@ EXPORT_SYMBOL(drm_fb_helper_debug_leave);
> > >   static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, 
> > > bool active)
> > >   {
> > >   struct drm_device *dev = fb_helper->dev;
> > > + struct drm_plane_state *plane_state;
> > >   struct drm_plane *plane;
> > >   struct drm_atomic_state *state;
> > >   int i, ret;
> > > @@ -368,8 +370,6 @@ static int restore_fbdev_mode_atomic(struct 
> > > drm_fb_helper *fb_helper, bool activ
> > >   retry:
> > >   plane_mask = 0;
> > >   drm_for_each_plane(plane, dev) {
> > > - struct drm_plane_state *plane_state;
> > > -
> > >   plane_state = drm_atomic_get_plane_state(state, plane);
> > >   if (IS_ERR(plane_state)) {
> > >   ret = PTR_ERR(plane_state);
> > > @@ -392,6 +392,11 @@ static int restore_fbdev_mode_atomic(struct 
> > > drm_fb_helper *fb_helper, bool activ
> > >   for (i = 0; i < fb_helper->crtc_count; i++) {
> > >   struct drm_mode_set *mode_set = 
> > > &fb_helper->crtc_info[i].mode_set;
> > > + struct drm_plane *primary = mode_set->crtc->primary;
> > > +
> > > + /* Cannot fail as we've already gotten the plane state above */
> > > + plane_state = drm_atomic_get_new_plane_state(state, primary);
> > > + plane_state->rotation = fb_helper->crtc_info[i].rotation;
> > >   ret = __drm_atomic_helper_set_config(mode_set, state);
> > >   if (ret != 0)
> > > @@ -2334,6 +2339,57 @@ static int drm_pick_crtcs(struct drm_fb_helper 
> > > *fb_helper,
> > >   return best_score;
> > >   }
> > > +/*
> > > + * This function checks if rotation is necessary because of panel 
> > > orientation
> > > + * and if it is, if it is supported.
> > > + * If rotation is necessary and supported, its gets set in 
> > > fb_crtc.rotation.
> > > + * If rotation is necessary but not supported, a DRM_MODE_ROTATE_* flag 
> > > gets
> > > + * or-ed into fb_helper->rotations. In drm_setup_crtcs_fb() we check if 
> > > only
> > > + * one bit is set and then we set fb_info.fbcon_rotate_hint to make 
> > > fbcon do
> > > + * the unsupported rotation.
> > > + */
> > > +static void drm_setup_crtc_rotation(struct drm_fb_helper *fb_helper,
> > > + struct drm_fb_helper_crtc *fb_crtc,
> > > + struct drm_connector *connector)
> > > +{
> > > + struct drm_plane *plane = fb_crtc->mode_set.crtc->primary;
> > > + uint64_t valid_mask = 0;
> > > + int i, rotation;
> > > +
> > > + fb_crtc->rotation = DRM_MODE_ROTATE_0;
> > > +
> > > + switch (connector->display_info.panel_orientation) {
> > > + case DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP:
> > > + rotation = DRM_MODE_ROTATE_180;
> > > + break;
> > > + case DRM_MODE_PANEL_ORIENTATION_LEFT_UP:
> > > + rotation = DRM_MODE_ROTATE_90;
> > > + break;
> > > + case DRM_MODE_PANEL_ORIENTATION_RIGHT_UP:
> > > + rotation = DRM_MODE_ROTATE_270;
> > > + break;
> > 
> > For 90/270 hw rotation you need to flip the coordinates/sizes of the fb.
> 
> You're probably right, I don't have any hardware supporting
> 270 degree rotation to test this with.
> 
> > > + default:
> > > + rotation = DRM_MODE_ROTATE_0;
> > > + }
> > > +
> > > + if (rotation == DRM_MODE_ROTATE_0 || !plane->rotation_property) 

Re: [Intel-gfx] [PATCH v3 3/7] drm: Add support for a panel-orientation connector property

2017-10-31 Thread Daniel Vetter
On Mon, Oct 30, 2017 at 11:57:10AM +0100, Hans de Goede wrote:
> Hi,
> 
> On 30-10-17 10:43, Daniel Vetter wrote:
> > On Mon, Oct 23, 2017 at 09:14:21AM +0200, Hans de Goede wrote:
> > > On some devices the LCD panel is mounted in the casing in such a way that
> > > the up/top side of the panel does not match with the top side of the
> > > device (e.g. it is mounted upside-down).
> > > 
> > > This commit adds the necessary infra for lcd-panel drm_connector-s to
> > > have a "panel orientation" property to communicate how the panel is
> > > orientated vs the casing.
> > > 
> > > Userspace can use this property to check for non-normal orientation and
> > > then adjust the displayed image accordingly by rotating it to compensate.
> > > 
> > > Signed-off-by: Hans de Goede 
> > > ---
> > > Changes in v2:
> > > -Rebased on 4.14-rc1
> > > -Store panel_orientation in drm_display_info, so that drm_fb_helper.c can
> > >   access it easily
> > > -Have a single drm_connector_init_panel_orientation_property rather then
> > >   create and attach functions. The caller is expected to set
> > >   drm_display_info.panel_orientation before calling this, then this will
> > >   check for platform specific quirks overriding the panel_orientation and 
> > > if
> > >   the panel_orientation is set after this then it will attach the 
> > > property.
> > > ---
> > >   drivers/gpu/drm/Kconfig |  1 +
> > >   drivers/gpu/drm/drm_connector.c | 73 
> > > +
> > >   include/drm/drm_connector.h | 11 +++
> > >   include/drm/drm_mode_config.h   |  7 
> > >   include/uapi/drm/drm_mode.h |  7 
> > >   5 files changed, 99 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> > > index 9d005ac98c2b..0b166e626eb6 100644
> > > --- a/drivers/gpu/drm/Kconfig
> > > +++ b/drivers/gpu/drm/Kconfig
> > > @@ -7,6 +7,7 @@
> > >   menuconfig DRM
> > >   tristate "Direct Rendering Manager (XFree86 4.1.0 and higher 
> > > DRI support)"
> > >   depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && HAS_DMA
> > > + select DRM_PANEL_ORIENTATION_QUIRKS
> > >   select HDMI
> > >   select FB_CMDLINE
> > >   select I2C
> > > diff --git a/drivers/gpu/drm/drm_connector.c 
> > > b/drivers/gpu/drm/drm_connector.c
> > > index 704fc8934616..129c83a84320 100644
> > > --- a/drivers/gpu/drm/drm_connector.c
> > > +++ b/drivers/gpu/drm/drm_connector.c
> > > @@ -24,6 +24,7 @@
> > >   #include 
> > >   #include 
> > >   #include 
> > > +#include 
> > >   #include "drm_crtc_internal.h"
> > >   #include "drm_internal.h"
> > > @@ -212,6 +213,8 @@ int drm_connector_init(struct drm_device *dev,
> > >   mutex_init(&connector->mutex);
> > >   connector->edid_blob_ptr = NULL;
> > >   connector->status = connector_status_unknown;
> > > + connector->display_info.panel_orientation =
> > > + DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
> > >   drm_connector_get_cmdline_mode(connector);
> > > @@ -664,6 +667,13 @@ static const struct drm_prop_enum_list 
> > > drm_aspect_ratio_enum_list[] = {
> > >   { DRM_MODE_PICTURE_ASPECT_16_9, "16:9" },
> > >   };
> > > +static const struct drm_prop_enum_list drm_panel_orientation_enum_list[] 
> > > = {
> > > + { DRM_MODE_PANEL_ORIENTATION_NORMAL,"Normal"},
> > > + { DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP, "Upside Down"   },
> > > + { DRM_MODE_PANEL_ORIENTATION_LEFT_UP,   "Left Side Up"  },
> > > + { DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,  "Right Side Up" },
> > > +};
> > > +
> > >   static const struct drm_prop_enum_list drm_dvi_i_select_enum_list[] = {
> > >   { DRM_MODE_SUBCONNECTOR_Automatic, "Automatic" }, /* DVI-I and 
> > > TV-out */
> > >   { DRM_MODE_SUBCONNECTOR_DVID,  "DVI-D" }, /* DVI-I  */
> > > @@ -768,6 +778,18 @@ DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name,
> > >*
> > >* CRTC_ID:
> > >*  Mode object ID of the &drm_crtc this connector should be 
> > > connected to.
> > > + *
> > > + * Connectors for LCD panels may also have one standardized property:
> > > + *
> > > + * panel orientation:
> > > + *   On some devices the LCD panel is mounted in the casing in such 
> > > a way
> > > + *   that the up/top side of the panel does not match with the top 
> > > side of
> > > + *   the device. Userspace can use this property to check for this.
> > > + *   Note that input coordinates from touchscreens (input devices 
> > > with
> > > + *   INPUT_PROP_DIRECT) will still map 1:1 to the actual LCD panel
> > > + *   coordinates, so if userspace rotates the picture to adjust for
> > > + *   the orientation it must also apply the same transformation to 
> > > the
> > > + *   touchscreen input coordinates.
> > >*/
> > >   int drm_connector_create_standard_properties(struct drm_device *dev)
> > > @@ -1234,6 +1256,57 @@ void 
> > > drm_mode_connector_set_link_status_property(struct drm_connector 

Re: [Intel-gfx] [PATCH 2/3] drm/i915/guc: Add support for reset engine using GuC commands

2017-10-31 Thread Chris Wilson
Quoting Michel Thierry (2017-10-31 04:38:30)
> On 30/10/17 14:09, Chris Wilson wrote:
> > Quoting Michel Thierry (2017-10-30 18:56:15)
> >> This patch adds per engine reset and recovery (TDR) support when GuC is
> >> used to submit workloads to GPU.
> >>
> >> In the case of i915 directly submission to ELSP, driver manages hang
> >> detection, recovery and resubmission. With GuC submission these tasks
> >> are shared between driver and GuC. i915 is still responsible for detecting
> >> a hang, and when it does it only requests GuC to reset that Engine. GuC
> >> internally manages acquiring forcewake and idling the engine before 
> >> actually
> >> resetting it.
> >>
> >> Once the reset is successful, i915 takes over again and handles 
> >> resubmission.
> >> The scheduler in i915 knows which requests are pending so after resetting
> >> a engine, pending workloads/requests are resubmitted again.
> >>
> >> v2: s/i915_guc_request_engine_reset/i915_guc_reset_engine/ to match the
> >> non-guc funtion names.
> >>
> >> v3: Removed debug message about engine restarting from which request,
> >> since the new baseline do it regardless of submission mode. (Chris)
> >>
> >> v4: Rebase.
> >>
> >> v5: Do not pass unnecessary reporting flags to the fw (Jeff);
> >> tasklet_schedule(&execlists->irq_tasklet) handles the resubmit; rebase.
> > 
> > In your experience, how did our test coverage fare?
> > 
> > Could you use live_hangcheck effectively? (The drv_selftest would need
> > some hand holding to pass along guc options. But for livetesting we
> > should probably get to the point of being able to load/unload the guc
> > interface so that we cover both execlists and guc.) Did you find
> > "gem_exec_whisper --r hang*", did you try gem_concurrent_all?
> >   
> 
> live_hangcheck runs ok with guc (as long as i915_params.h has guc 
> submission enabled). Do you see a benefit on adding an option in 
> drv_selftest to override the submission mode? I can add it to my list.

I'd rather take the path of loading/unloading guc in the kernel to
ensure we have coverage of both on all platforms where that makes sense.
That way the kernel remains in control of the coverage it deems
necessary.

The alternative would be a for_each_param_value() loop in drv_selftests
which doesn't inspired me with forward/backward testing confidence.

For the time being, knowing that you did check live_hangcheck is enough
for me to cross it off the checklist.

The larger question behind "how did our test coverage fare" is did it
find any bugs during development? If not, we need more tests ;)
 
> You got me in gem_concurrent_all, I forgot to schedule it a few weeks ago.
> 
> >> +/**
> >> + * intel_guc_reset_engine() - ask GuC to reset an engine
> >> + * @engine:engine to be reset
> >> + */
> >> +int intel_guc_reset_engine(struct intel_engine_cs *engine)
> >> +{
> >> +   struct drm_i915_private *dev_priv = engine->i915;
> >> +   struct intel_guc *guc = &dev_priv->guc;
> >> +   u32 data[7];
> >> +
> >> +   GEM_BUG_ON(!guc->execbuf_client);
> >> +
> >> +   data[0] = INTEL_GUC_ACTION_REQUEST_ENGINE_RESET;
> >> +   data[1] = engine->guc_id;
> >> +   data[2] = 0;
> >> +   data[3] = 0;
> >> +   data[4] = 0;
> >> +   data[5] = guc->execbuf_client->stage_id;
> >> +   data[6] = guc_ggtt_offset(guc->shared_data);
> >> +
> >> +   return intel_guc_send(guc, data, ARRAY_SIZE(data));
> > 
> > Is this a synchronous action? We expect that following the completion of
> > the reset routine, we are ready to reinit the hw. The same rule needs to
> > apply the guc, I think.
> 
> Right now the action is synchronous, the fw won't reply to the action 
> until all the steps are completed. It also is fast enough, I haven't 
> seen it time out (which would be promoted to full reset and reload the 
> fw). But, do you have a crystal ball?

Just REQUEST is a red flag that there may be an asynchronous REPLY/ACK.

Aside: we need to start planning/adding fault_injection tests.
intel_guc_send() seems a good choice for an if(should_fail()).
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] ✗ Fi.CI.IGT: warning for GuC based reset engine

2017-10-31 Thread Chris Wilson
Quoting Patchwork (2017-10-30 23:20:13)
> For more details see: 
> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6267/shards.html

https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6267/shard-kbl1/igt@prime_b...@wait-hang-render.html
is suspicious.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v2 2/2] Test case for drm_vblank_cleanup refcount validation patch

2017-10-31 Thread Daniel Vetter
On Mon, Oct 30, 2017 at 06:01:12PM +0530, PrasannaKumar Muralidharan wrote:
> Hi Daniel,
> 
> On 30 October 2017 at 15:40, Daniel Vetter  wrote:
> > On Wed, Oct 25, 2017 at 08:44:45PM +0530, PrasannaKumar Muralidharan wrote:
> >> Hi All,
> >>
> >> On 24 October 2017 at 22:18, PrasannaKumar Muralidharan
> >>  wrote:
> >> > In i915 driver unload drm_vblank_get is added to test whether
> >> > drm_vblank_cleanup refcount validation patch is working.
> >> >
> >> > Signed-off-by: PrasannaKumar Muralidharan 
> >> > ---
> >> > Changes in v2:
> >> > Use drm_crtc_vblank_get instead of _put. In previous patch _put was 
> >> > wrongly
> >> > used.
> >> >
> >> >  drivers/gpu/drm/i915/i915_drv.c | 7 +++
> >> >  1 file changed, 7 insertions(+)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/i915_drv.c 
> >> > b/drivers/gpu/drm/i915/i915_drv.c
> >> > index 9f45cfe..4aee1c0 100644
> >> > --- a/drivers/gpu/drm/i915/i915_drv.c
> >> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> >> > @@ -1373,6 +1373,13 @@ void i915_driver_unload(struct drm_device *dev)
> >> > struct drm_i915_private *dev_priv = to_i915(dev);
> >> > struct pci_dev *pdev = dev_priv->drm.pdev;
> >> >
> >> > +   enum pipe pipe;
> >> > +   for_each_pipe(dev_priv, pipe) {
> >> > +   struct intel_crtc *crtc = 
> >> > intel_get_crtc_for_pipe(dev_priv,
> >> > + pipe);
> >> > +   drm_crtc_vblank_get(&crtc->base);
> >> > +   }
> >> > +
> >> > i915_driver_unregister(dev_priv);
> >> >
> >> > if (i915_gem_suspend(dev_priv))
> >> > --
> >> > 2.10.0
> >> >
> >>
> >> From 
> >> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6167/fi-ilk-650/igt@drv_module_rel...@basic-reload.html
> >> it can be seen that this patch triggers warning when vblank->refcount
> >> > 0 in vblank cleanup. This tests patch 1 successfully.
> >>
> >> I think patch 1 is good to go.
> >
> > Yeah it works, but we don't know whether it breaks anything yet. Can you
> > pls resubmit just the first patch? Abusing CI was just an idea to get it
> > fully tested, before we can merge it still needs to pass full CI. We just
> > had an issue 2 weeks ago where CI blew up because an untested patch landed
> > that broke every test :-/
> > -Daniel
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> 
> I have already sent that patch alone. Please look at
> https://patchwork.freedesktop.org/patch/184866/.

Seems to fail in CI:

https://patchwork.freedesktop.org/series/32648/

I guess you need to test this on a local box somewhere to figure out
what's wrong.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 1/2] drm/i915: Reject unknown syncobj flags

2017-10-31 Thread Tvrtko Ursulin
From: Tvrtko Ursulin 

We have to reject unknown flags for uAPI considerations, and also
because the curent implementation limits their i915 storage space
to two bits.

v2: (Chris Wilson)
 * Fix fail in ABI check.
 * Added unknown flags and BUILD_BUG_ON.

v3:
 * Use ARCH_KMALLOC_MINALIGN instead of alignof. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin 
Fixes: cf6e7bac6357 ("drm/i915: Add support for drm syncobjs")
Cc: Jason Ekstrand 
Cc: Chris Wilson 
Cc: Jani Nikula 
Cc: Joonas Lahtinen 
Cc: Rodrigo Vivi 
Cc: David Airlie 
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 8 
 include/uapi/drm/i915_drm.h| 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 3d7190764f10..a53be7d01055 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -2100,6 +2100,11 @@ get_fence_array(struct drm_i915_gem_execbuffer2 *args,
goto err;
}
 
+   if (fence.flags & __I915_EXEC_FENCE_UNKNOWN_FLAGS) {
+   err = -EINVAL;
+   goto err;
+   }
+
syncobj = drm_syncobj_find(file, fence.handle);
if (!syncobj) {
DRM_DEBUG("Invalid syncobj handle provided\n");
@@ -2107,6 +2112,9 @@ get_fence_array(struct drm_i915_gem_execbuffer2 *args,
goto err;
}
 
+   BUILD_BUG_ON(~(ARCH_KMALLOC_MINALIGN - 1) &
+~__I915_EXEC_FENCE_UNKNOWN_FLAGS);
+
fences[n] = ptr_pack_bits(syncobj, fence.flags, 2);
}
 
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 125bde7d9504..ac3c6503ca27 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -839,6 +839,7 @@ struct drm_i915_gem_exec_fence {
 
 #define I915_EXEC_FENCE_WAIT(1<<0)
 #define I915_EXEC_FENCE_SIGNAL  (1<<1)
+#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1))
__u32 flags;
 };
 
-- 
2.9.5

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


[Intel-gfx] [PATCH 2/2] drm/i915: Warn in debug builds of incorrect usages of ptr_pack_bits

2017-10-31 Thread Tvrtko Ursulin
From: Tvrtko Ursulin 

GEM_BUG_ON if the packed bits do not fit into the specified width.

Signed-off-by: Tvrtko Ursulin 
---
 drivers/gpu/drm/i915/i915_utils.h | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_utils.h 
b/drivers/gpu/drm/i915/i915_utils.h
index af3d7cc53fa1..6a6b497b7dca 100644
--- a/drivers/gpu/drm/i915/i915_utils.h
+++ b/drivers/gpu/drm/i915/i915_utils.h
@@ -83,8 +83,10 @@
(typeof(ptr))(__v & -BIT(n));   \
 })
 
-#define ptr_pack_bits(ptr, bits, n)\
-   ((typeof(ptr))((unsigned long)(ptr) | (bits)))
+#define ptr_pack_bits(ptr, bits, n) ({ \
+   GEM_BUG_ON((bits) & -BIT(n));   \
+   ((typeof(ptr))((unsigned long)(ptr) | (bits))); \
+})
 
 #define page_mask_bits(ptr) ptr_mask_bits(ptr, PAGE_SHIFT)
 #define page_unmask_bits(ptr) ptr_unmask_bits(ptr, PAGE_SHIFT)
-- 
2.9.5

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


Re: [Intel-gfx] [PATCH v3 4/7] drm/fb-helper: Apply panel orientation connector prop to the primary plane

2017-10-31 Thread Hans de Goede

Hi,

On 31-10-17 11:14, Daniel Vetter wrote:

On Mon, Oct 30, 2017 at 12:09:27PM +0100, Hans de Goede wrote:

Hi,

On 30-10-17 10:52, Daniel Vetter wrote:

On Mon, Oct 23, 2017 at 09:14:22AM +0200, Hans de Goede wrote:

Apply the "panel orientation" drm connector prop to the primary plane so
that fbcon and fbdev using userspace programs display the right way up.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=94894
Signed-off-by: Hans de Goede 
---
Changes in v2:
-New patch in v2 of this patch-set

Changes in v3:
-Use a rotation member in struct drm_fb_helper_crtc and set that from
   drm_setup_crtcs instead of looping over all crtc's to find the right one
   later
-Since we now no longer look at rotation quirks directly in the fbcon code,
   set fb_info.fbcon_rotate_hint when the panel is not mounted upright and
   we cannot use hardware rotation
---
   drivers/gpu/drm/drm_fb_helper.c | 76 
+++--
   include/drm/drm_fb_helper.h |  8 +
   2 files changed, 82 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 116d1f1337c7..e0f95f2cc52f 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -41,6 +41,7 @@
   #include 
   #include 
+#include "drm_crtc_internal.h"
   #include "drm_crtc_helper_internal.h"
   static bool drm_fbdev_emulation = true;
@@ -350,6 +351,7 @@ EXPORT_SYMBOL(drm_fb_helper_debug_leave);
   static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper, bool 
active)
   {
struct drm_device *dev = fb_helper->dev;
+   struct drm_plane_state *plane_state;
struct drm_plane *plane;
struct drm_atomic_state *state;
int i, ret;
@@ -368,8 +370,6 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper 
*fb_helper, bool activ
   retry:
plane_mask = 0;
drm_for_each_plane(plane, dev) {
-   struct drm_plane_state *plane_state;
-
plane_state = drm_atomic_get_plane_state(state, plane);
if (IS_ERR(plane_state)) {
ret = PTR_ERR(plane_state);
@@ -392,6 +392,11 @@ static int restore_fbdev_mode_atomic(struct drm_fb_helper 
*fb_helper, bool activ
for (i = 0; i < fb_helper->crtc_count; i++) {
struct drm_mode_set *mode_set = 
&fb_helper->crtc_info[i].mode_set;
+   struct drm_plane *primary = mode_set->crtc->primary;
+
+   /* Cannot fail as we've already gotten the plane state above */
+   plane_state = drm_atomic_get_new_plane_state(state, primary);
+   plane_state->rotation = fb_helper->crtc_info[i].rotation;
ret = __drm_atomic_helper_set_config(mode_set, state);
if (ret != 0)
@@ -2334,6 +2339,57 @@ static int drm_pick_crtcs(struct drm_fb_helper 
*fb_helper,
return best_score;
   }
+/*
+ * This function checks if rotation is necessary because of panel orientation
+ * and if it is, if it is supported.
+ * If rotation is necessary and supported, its gets set in fb_crtc.rotation.
+ * If rotation is necessary but not supported, a DRM_MODE_ROTATE_* flag gets
+ * or-ed into fb_helper->rotations. In drm_setup_crtcs_fb() we check if only
+ * one bit is set and then we set fb_info.fbcon_rotate_hint to make fbcon do
+ * the unsupported rotation.
+ */
+static void drm_setup_crtc_rotation(struct drm_fb_helper *fb_helper,
+   struct drm_fb_helper_crtc *fb_crtc,
+   struct drm_connector *connector)
+{
+   struct drm_plane *plane = fb_crtc->mode_set.crtc->primary;
+   uint64_t valid_mask = 0;
+   int i, rotation;
+
+   fb_crtc->rotation = DRM_MODE_ROTATE_0;
+
+   switch (connector->display_info.panel_orientation) {
+   case DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP:
+   rotation = DRM_MODE_ROTATE_180;
+   break;
+   case DRM_MODE_PANEL_ORIENTATION_LEFT_UP:
+   rotation = DRM_MODE_ROTATE_90;
+   break;
+   case DRM_MODE_PANEL_ORIENTATION_RIGHT_UP:
+   rotation = DRM_MODE_ROTATE_270;
+   break;


For 90/270 hw rotation you need to flip the coordinates/sizes of the fb.


You're probably right, I don't have any hardware supporting
270 degree rotation to test this with.


+   default:
+   rotation = DRM_MODE_ROTATE_0;
+   }
+
+   if (rotation == DRM_MODE_ROTATE_0 || !plane->rotation_property) {
+   fb_helper->rotations |= rotation;
+   return;
+   }
+
+   for (i = 0; i < plane->rotation_property->num_values; i++)
+   valid_mask |= (1ULL << plane->rotation_property->values[i]);


This isn't a good enough check for atomic drivers (and not for gen9+ intel
hw), since we might expose 90° rotations, but it only works if you have
the correct tiling format.

For atomic drivers it'd be really good if we could do a TEST_ONLY commit
fir

Re: [Intel-gfx] [PATCH v2 08/15] drm/i915: Use drm_fb_helper_output_poll_changed()

2017-10-31 Thread Daniel Vetter
On Mon, Oct 30, 2017 at 04:39:44PM +0100, Noralf Trønnes wrote:
> This driver can use drm_fb_helper_output_poll_changed() as its
> .output_poll_changed callback.
> 
> Cc: Jani Nikula 
> Cc: Joonas Lahtinen 
> Cc: Rodrigo Vivi 
> Signed-off-by: Noralf Trønnes 
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 +-
>  drivers/gpu/drm/i915/intel_drv.h | 5 -
>  drivers/gpu/drm/i915/intel_fbdev.c   | 8 
>  3 files changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index f780f39e0758..b205e2c782bb 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14123,7 +14123,7 @@ static void intel_atomic_state_free(struct 
> drm_atomic_state *state)
>  static const struct drm_mode_config_funcs intel_mode_funcs = {
>   .fb_create = intel_user_framebuffer_create,
>   .get_format_info = intel_get_format_info,
> - .output_poll_changed = intel_fbdev_output_poll_changed,
> + .output_poll_changed = drm_fb_helper_output_poll_changed,
>   .atomic_check = intel_atomic_check,
>   .atomic_commit = intel_atomic_commit,
>   .atomic_state_alloc = intel_atomic_state_alloc,
> diff --git a/drivers/gpu/drm/i915/intel_drv.h 
> b/drivers/gpu/drm/i915/intel_drv.h
> index 463ed152e6b1..dfcf5ba220e8 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1607,7 +1607,6 @@ extern void intel_fbdev_initial_config_async(struct 
> drm_device *dev);
>  extern void intel_fbdev_unregister(struct drm_i915_private *dev_priv);
>  extern void intel_fbdev_fini(struct drm_i915_private *dev_priv);
>  extern void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool 
> synchronous);
> -extern void intel_fbdev_output_poll_changed(struct drm_device *dev);
>  extern void intel_fbdev_restore_mode(struct drm_device *dev);
>  #else
>  static inline int intel_fbdev_init(struct drm_device *dev)
> @@ -1631,10 +1630,6 @@ static inline void intel_fbdev_set_suspend(struct 
> drm_device *dev, int state, bo
>  {
>  }
>  
> -static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)
> -{
> -}
> -
>  static inline void intel_fbdev_restore_mode(struct drm_device *dev)
>  {
>  }
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c 
> b/drivers/gpu/drm/i915/intel_fbdev.c
> index f2bb8116227c..35babbadfc5a 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -796,14 +796,6 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int 
> state, bool synchronous
>   console_unlock();
>  }
>  
> -void intel_fbdev_output_poll_changed(struct drm_device *dev)
> -{
> - struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
> -
> - if (ifbdev)

This removes the NULL check here, and I think we still need that one for
some slightly unclear but probably hilarious reasons.

I guess simplest if you just drop the i915 patch as too tricky.
-Daniel

> - drm_fb_helper_hotplug_event(&ifbdev->helper);
> -}
> -
>  void intel_fbdev_restore_mode(struct drm_device *dev)
>  {
>   struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
> -- 
> 2.14.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v2 07/15] drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()

2017-10-31 Thread Daniel Vetter
On Mon, Oct 30, 2017 at 04:39:43PM +0100, Noralf Trønnes wrote:
> This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
> It can also use drm_fb_helper_output_poll_changed() as its
> .output_poll_changed callback.
> 
> Cc: Patrik Jakobsson 
> Signed-off-by: Noralf Trønnes 

Acked-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/gma500/framebuffer.c |  9 +
>  drivers/gpu/drm/gma500/psb_drv.c | 15 +--
>  2 files changed, 2 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/gma500/framebuffer.c 
> b/drivers/gpu/drm/gma500/framebuffer.c
> index 2570c7f647a6..cb0a2ae916e0 100644
> --- a/drivers/gpu/drm/gma500/framebuffer.c
> +++ b/drivers/gpu/drm/gma500/framebuffer.c
> @@ -576,13 +576,6 @@ static void psb_fbdev_fini(struct drm_device *dev)
>   dev_priv->fbdev = NULL;
>  }
>  
> -static void psbfb_output_poll_changed(struct drm_device *dev)
> -{
> - struct drm_psb_private *dev_priv = dev->dev_private;
> - struct psb_fbdev *fbdev = (struct psb_fbdev *)dev_priv->fbdev;
> - drm_fb_helper_hotplug_event(&fbdev->psb_fb_helper);
> -}
> -
>  /**
>   *   psb_user_framebuffer_create_handle - add hamdle to a framebuffer
>   *   @fb: framebuffer
> @@ -623,7 +616,7 @@ static void psb_user_framebuffer_destroy(struct 
> drm_framebuffer *fb)
>  
>  static const struct drm_mode_config_funcs psb_mode_funcs = {
>   .fb_create = psb_user_framebuffer_create,
> - .output_poll_changed = psbfb_output_poll_changed,
> + .output_poll_changed = drm_fb_helper_output_poll_changed,
>  };
>  
>  static void psb_setup_outputs(struct drm_device *dev)
> diff --git a/drivers/gpu/drm/gma500/psb_drv.c 
> b/drivers/gpu/drm/gma500/psb_drv.c
> index 37a3be71acd9..7ab4c532f1d4 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.c
> +++ b/drivers/gpu/drm/gma500/psb_drv.c
> @@ -107,19 +107,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
>  static const struct drm_ioctl_desc psb_ioctls[] = {
>  };
>  
> -static void psb_driver_lastclose(struct drm_device *dev)
> -{
> - int ret;
> - struct drm_psb_private *dev_priv = dev->dev_private;
> - struct psb_fbdev *fbdev = dev_priv->fbdev;
> -
> - ret = drm_fb_helper_restore_fbdev_mode_unlocked(&fbdev->psb_fb_helper);
> - if (ret)
> - DRM_DEBUG("failed to restore crtc mode\n");
> -
> - return;
> -}
> -
>  static int psb_do_init(struct drm_device *dev)
>  {
>   struct drm_psb_private *dev_priv = dev->dev_private;
> @@ -479,7 +466,7 @@ static struct drm_driver driver = {
>  DRIVER_MODESET | DRIVER_GEM,
>   .load = psb_driver_load,
>   .unload = psb_driver_unload,
> - .lastclose = psb_driver_lastclose,
> + .lastclose = drm_fb_helper_lastclose,
>  
>   .num_ioctls = ARRAY_SIZE(psb_ioctls),
>   .irq_preinstall = psb_irq_preinstall,
> -- 
> 2.14.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v2 06/15] drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()

2017-10-31 Thread Daniel Vetter
On Mon, Oct 30, 2017 at 04:39:42PM +0100, Noralf Trønnes wrote:
> This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
> It can also use drm_fb_helper_output_poll_changed() as its
> .output_poll_changed callback.
> 
> Cc: Inki Dae 
> Cc: Joonyoung Shim 
> Cc: Seung-Woo Kim 
> Cc: Kyungmin Park 
> Signed-off-by: Noralf Trønnes 
> ---
>  drivers/gpu/drm/exynos/exynos_drm_drv.c   |  8 ++--
>  drivers/gpu/drm/exynos/exynos_drm_fb.c|  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 18 --
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.h |  2 --
>  4 files changed, 3 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
> b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index e651a58c18cf..70f4895ac49c 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -16,6 +16,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  
> @@ -89,11 +90,6 @@ static void exynos_drm_postclose(struct drm_device *dev, 
> struct drm_file *file)
>   file->driver_priv = NULL;
>  }
>  
> -static void exynos_drm_lastclose(struct drm_device *dev)
> -{
> - exynos_drm_fbdev_restore_mode(dev);
> -}
> -
>  static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
>   .fault = exynos_drm_gem_fault,
>   .open = drm_gem_vm_open,
> @@ -140,7 +136,7 @@ static struct drm_driver exynos_drm_driver = {
>   .driver_features= DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
> | DRIVER_ATOMIC | DRIVER_RENDER,
>   .open   = exynos_drm_open,
> - .lastclose  = exynos_drm_lastclose,
> + .lastclose  = drm_fb_helper_lastclose,
>   .postclose  = exynos_drm_postclose,
>   .gem_free_object_unlocked = exynos_drm_gem_free_object,
>   .gem_vm_ops = &exynos_drm_gem_vm_ops,
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c 
> b/drivers/gpu/drm/exynos/exynos_drm_fb.c
> index 8208df56a88f..0faaf829f5bf 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
> @@ -205,7 +205,7 @@ static struct drm_mode_config_helper_funcs 
> exynos_drm_mode_config_helpers = {
>  
>  static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
>   .fb_create = exynos_user_fb_create,
> - .output_poll_changed = exynos_drm_output_poll_changed,
> + .output_poll_changed = drm_fb_helper_output_poll_changed,
>   .atomic_check = exynos_atomic_check,
>   .atomic_commit = drm_atomic_helper_commit,
>  };
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
> b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> index dfb66ecf417b..132dd52d0ac7 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> @@ -270,24 +270,6 @@ void exynos_drm_fbdev_fini(struct drm_device *dev)
>   private->fb_helper = NULL;
>  }
>  
> -void exynos_drm_fbdev_restore_mode(struct drm_device *dev)
> -{
> - struct exynos_drm_private *private = dev->dev_private;
> -
> - if (!private || !private->fb_helper)

Not sure this isn't risky, exynos has a strange load sequence ... Probably
best if we get an ack from Inki.
-Daniel
> - return;
> -
> - drm_fb_helper_restore_fbdev_mode_unlocked(private->fb_helper);
> -}
> -
> -void exynos_drm_output_poll_changed(struct drm_device *dev)
> -{
> - struct exynos_drm_private *private = dev->dev_private;
> - struct drm_fb_helper *fb_helper = private->fb_helper;
> -
> - drm_fb_helper_hotplug_event(fb_helper);
> -}
> -
>  void exynos_drm_fbdev_suspend(struct drm_device *dev)
>  {
>   struct exynos_drm_private *private = dev->dev_private;
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h 
> b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
> index 645d1bb7f665..b33847223a85 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
> @@ -19,8 +19,6 @@
>  
>  int exynos_drm_fbdev_init(struct drm_device *dev);
>  void exynos_drm_fbdev_fini(struct drm_device *dev);
> -void exynos_drm_fbdev_restore_mode(struct drm_device *dev);
> -void exynos_drm_output_poll_changed(struct drm_device *dev);
>  void exynos_drm_fbdev_suspend(struct drm_device *drm);
>  void exynos_drm_fbdev_resume(struct drm_device *drm);
>  
> -- 
> 2.14.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v2 15/15] staging: vboxvideo: Use drm_fb_helper_lastclose()

2017-10-31 Thread Daniel Vetter
On Mon, Oct 30, 2017 at 04:39:51PM +0100, Noralf Trønnes wrote:
> This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
> 
> Cc: Hans de Goede 
> Signed-off-by: Noralf Trønnes 
> Reviewed-by: Hans de Goede 
> ---
>  drivers/staging/vboxvideo/vbox_drv.c  |  2 +-
>  drivers/staging/vboxvideo/vbox_drv.h  |  1 -
>  drivers/staging/vboxvideo/vbox_main.c | 12 
>  3 files changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/staging/vboxvideo/vbox_drv.c 
> b/drivers/staging/vboxvideo/vbox_drv.c
> index e18642e5027e..a4d8d7898e3d 100644
> --- a/drivers/staging/vboxvideo/vbox_drv.c
> +++ b/drivers/staging/vboxvideo/vbox_drv.c
> @@ -229,7 +229,7 @@ static struct drm_driver driver = {
>  
>   .load = vbox_driver_load,
>   .unload = vbox_driver_unload,
> - .lastclose = vbox_driver_lastclose,
> + .lastclose = drm_fb_helper_lastclose,
>   .master_set = vbox_master_set,
>   .master_drop = vbox_master_drop,
>  
> diff --git a/drivers/staging/vboxvideo/vbox_drv.h 
> b/drivers/staging/vboxvideo/vbox_drv.h
> index 4b9302703b36..7273d7e9bc9b 100644
> --- a/drivers/staging/vboxvideo/vbox_drv.h
> +++ b/drivers/staging/vboxvideo/vbox_drv.h
> @@ -128,7 +128,6 @@ struct vbox_private {
>  
>  int vbox_driver_load(struct drm_device *dev, unsigned long flags);
>  void vbox_driver_unload(struct drm_device *dev);
> -void vbox_driver_lastclose(struct drm_device *dev);
>  
>  struct vbox_gem_object;
>  
> diff --git a/drivers/staging/vboxvideo/vbox_main.c 
> b/drivers/staging/vboxvideo/vbox_main.c
> index 80bd039fa08e..c3d756620fd5 100644
> --- a/drivers/staging/vboxvideo/vbox_main.c
> +++ b/drivers/staging/vboxvideo/vbox_main.c
> @@ -421,18 +421,6 @@ void vbox_driver_unload(struct drm_device *dev)
>   vbox_hw_fini(vbox);
>  }
>  
> -/**
> - * @note this is described in the DRM framework documentation.  AST does not
> - * have it, but we get an oops on driver unload if it is not present.
> - */
> -void vbox_driver_lastclose(struct drm_device *dev)
> -{
> - struct vbox_private *vbox = dev->dev_private;
> -
> - if (vbox->fbdev)

Hm, except gma500 all the drivers have this NULL check here. I'm not sure
whether that's just cargo-culted or whether that's needed, but I'm wary
from slapping an Ack on the entire series as-is.

I'm pretty sure we still need it for i915, but everyone else might just
have copied too much. Or it predates the helper support for disabling the
fbdev emulation.

There's also the question that a bunch of drivers who set up fbdev forgot
to add the lastclose call it seems, but that's a different story.
-Daniel

> - drm_fb_helper_restore_fbdev_mode_unlocked(&vbox->fbdev->helper);
> -}
> -
>  int vbox_gem_create(struct drm_device *dev,
>   u32 size, bool iskernel, struct drm_gem_object **obj)
>  {
> -- 
> 2.14.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.BAT: warning for tests/kms_frontbuffer_tracking: Idleness DRRS coverage

2017-10-31 Thread Patchwork
== Series Details ==

Series: tests/kms_frontbuffer_tracking: Idleness DRRS coverage
URL   : https://patchwork.freedesktop.org/series/32888/
State : warning

== Summary ==

IGT patchset tested on top of latest successful build
7aac0e88606ce453b111ce80419dc58519db05ad assembler: Fix bashism in run-test.sh

with latest DRM-Tip kernel build CI_DRM_3300
dfe1410689e6 drm-tip: 2017y-10m-31d-09h-42m-59s UTC integration manifest

Testlist changes:
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-indfb-draw-blt
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-indfb-draw-mmap-cpu
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-indfb-draw-mmap-gtt
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-indfb-draw-mmap-wc
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-indfb-draw-pwrite
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-indfb-draw-render
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-shrfb-draw-blt
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-shrfb-draw-mmap-cpu
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-shrfb-draw-mmap-gtt
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-shrfb-draw-mmap-wc
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-shrfb-draw-pwrite
+igt@kms_frontbuffer_tracking@drrs-1p-offscren-pri-shrfb-draw-render
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-cur-indfb-draw-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-cur-indfb-draw-mmap-cpu
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-cur-indfb-draw-mmap-gtt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-cur-indfb-draw-mmap-wc
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-cur-indfb-draw-pwrite
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-cur-indfb-draw-render
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-cur-indfb-move
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-cur-indfb-onoff
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-indfb-msflip-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-indfb-pgflip-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-indfb-plflip-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-indfb-draw-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-indfb-draw-mmap-cpu
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-indfb-draw-mmap-gtt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-indfb-draw-mmap-wc
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-indfb-draw-pwrite
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-indfb-draw-render
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-shrfb-draw-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-shrfb-draw-mmap-cpu
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-shrfb-draw-mmap-gtt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-shrfb-draw-mmap-wc
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-shrfb-draw-pwrite
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-pri-shrfb-draw-render
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-shrfb-msflip-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-shrfb-pgflip-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-shrfb-plflip-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-draw-blt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-draw-mmap-cpu
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-draw-mmap-gtt
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-draw-mmap-wc
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-draw-pwrite
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-draw-render
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-fullscreen
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-move
+igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-onoff
+igt@kms_frontbuffer_tracking@drrs-1p-pri-indfb-multidraw
+igt@kms_frontbuffer_tracking@drrs-1p-rte
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-cur-indfb-draw-blt
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-cur-indfb-draw-mmap-cpu
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-cur-indfb-draw-mmap-gtt
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-cur-indfb-draw-mmap-wc
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-cur-indfb-draw-pwrite
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-cur-indfb-draw-render
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-cur-indfb-move
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-cur-indfb-onoff
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-indfb-msflip-blt
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-indfb-pgflip-blt
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-indfb-plflip-blt
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-indfb-draw-blt
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-indfb-draw-mmap-cpu
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-indfb-draw-mmap-gtt
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-indfb-draw-mmap-wc
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-indfb-draw-pwrite
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-indfb-draw-render
+igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-shrfb-draw-blt
+igt@kms_frontbuffer_tracking@drrs-2p-prim

[Intel-gfx] [resend] drm/i915: Check incoming alignment for unfenced buffers (on i915gm)

2017-10-31 Thread Chris Wilson
In case the object has changed tiling between calls to execbuf, we need
to check if the existing offset inside the GTT matches the new tiling
constraint. We even need to do this for "unfenced" tiled objects, where
the 3D commands use an implied fence and so the object still needs to
match the physical fence restrictions on alignment (only required for
gen2 and early gen3).

In commit 2889caa92321 ("drm/i915: Eliminate lots of iterations over
the execobjects array"), the idea was to remove the second guessing and
only set the NEEDS_MAP flag when required. However, the entire check
for an unusable offset for fencing was removed and not just the
secondary check. I.e.

/* avoid costly ping-pong once a batch bo ended up non-mappable */
if (entry->flags & __EXEC_OBJECT_NEEDS_MAP &&
!i915_vma_is_map_and_fenceable(vma))
return !only_mappable_for_reloc(entry->flags);

was entirely removed as the ping-pong between execbuf passes was fixed,
but its primary purpose in forcing unaligned unfenced access to be
rebound was forgotten.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103502
Fixes: 2889caa92321 ("drm/i915: Eliminate lots of iterations over the 
execobjects array")
Signed-off-by: Chris Wilson 
Cc: Joonas Lahtinen 
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 3d7190764f10..5b8213b1a8c7 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -343,6 +343,10 @@ eb_vma_misplaced(const struct drm_i915_gem_exec_object2 
*entry,
(vma->node.start + vma->node.size - 1) >> 32)
return true;
 
+   if (flags & __EXEC_OBJECT_NEEDS_MAP &&
+   !i915_vma_is_map_and_fenceable(vma))
+   return true;
+
return false;
 }
 
-- 
2.15.0.rc2

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


Re: [Intel-gfx] [PATCH v3 4/7] drm/fb-helper: Apply panel orientation connector prop to the primary plane

2017-10-31 Thread Daniel Vetter
On Tue, Oct 31, 2017 at 11:24:14AM +0100, Hans de Goede wrote:
> Hi,
> 
> On 31-10-17 11:14, Daniel Vetter wrote:
> > On Mon, Oct 30, 2017 at 12:09:27PM +0100, Hans de Goede wrote:
> > > Hi,
> > > 
> > > On 30-10-17 10:52, Daniel Vetter wrote:
> > > > On Mon, Oct 23, 2017 at 09:14:22AM +0200, Hans de Goede wrote:
> > > > > Apply the "panel orientation" drm connector prop to the primary plane 
> > > > > so
> > > > > that fbcon and fbdev using userspace programs display the right way 
> > > > > up.
> > > > > 
> > > > > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=94894
> > > > > Signed-off-by: Hans de Goede 
> > > > > ---
> > > > > Changes in v2:
> > > > > -New patch in v2 of this patch-set
> > > > > 
> > > > > Changes in v3:
> > > > > -Use a rotation member in struct drm_fb_helper_crtc and set that from
> > > > >drm_setup_crtcs instead of looping over all crtc's to find the 
> > > > > right one
> > > > >later
> > > > > -Since we now no longer look at rotation quirks directly in the fbcon 
> > > > > code,
> > > > >set fb_info.fbcon_rotate_hint when the panel is not mounted 
> > > > > upright and
> > > > >we cannot use hardware rotation
> > > > > ---
> > > > >drivers/gpu/drm/drm_fb_helper.c | 76 
> > > > > +++--
> > > > >include/drm/drm_fb_helper.h |  8 +
> > > > >2 files changed, 82 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/gpu/drm/drm_fb_helper.c 
> > > > > b/drivers/gpu/drm/drm_fb_helper.c
> > > > > index 116d1f1337c7..e0f95f2cc52f 100644
> > > > > --- a/drivers/gpu/drm/drm_fb_helper.c
> > > > > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > > > > @@ -41,6 +41,7 @@
> > > > >#include 
> > > > >#include 
> > > > > +#include "drm_crtc_internal.h"
> > > > >#include "drm_crtc_helper_internal.h"
> > > > >static bool drm_fbdev_emulation = true;
> > > > > @@ -350,6 +351,7 @@ EXPORT_SYMBOL(drm_fb_helper_debug_leave);
> > > > >static int restore_fbdev_mode_atomic(struct drm_fb_helper 
> > > > > *fb_helper, bool active)
> > > > >{
> > > > >   struct drm_device *dev = fb_helper->dev;
> > > > > + struct drm_plane_state *plane_state;
> > > > >   struct drm_plane *plane;
> > > > >   struct drm_atomic_state *state;
> > > > >   int i, ret;
> > > > > @@ -368,8 +370,6 @@ static int restore_fbdev_mode_atomic(struct 
> > > > > drm_fb_helper *fb_helper, bool activ
> > > > >retry:
> > > > >   plane_mask = 0;
> > > > >   drm_for_each_plane(plane, dev) {
> > > > > - struct drm_plane_state *plane_state;
> > > > > -
> > > > >   plane_state = drm_atomic_get_plane_state(state, plane);
> > > > >   if (IS_ERR(plane_state)) {
> > > > >   ret = PTR_ERR(plane_state);
> > > > > @@ -392,6 +392,11 @@ static int restore_fbdev_mode_atomic(struct 
> > > > > drm_fb_helper *fb_helper, bool activ
> > > > >   for (i = 0; i < fb_helper->crtc_count; i++) {
> > > > >   struct drm_mode_set *mode_set = 
> > > > > &fb_helper->crtc_info[i].mode_set;
> > > > > + struct drm_plane *primary = mode_set->crtc->primary;
> > > > > +
> > > > > + /* Cannot fail as we've already gotten the plane state 
> > > > > above */
> > > > > + plane_state = drm_atomic_get_new_plane_state(state, 
> > > > > primary);
> > > > > + plane_state->rotation = 
> > > > > fb_helper->crtc_info[i].rotation;
> > > > >   ret = __drm_atomic_helper_set_config(mode_set, state);
> > > > >   if (ret != 0)
> > > > > @@ -2334,6 +2339,57 @@ static int drm_pick_crtcs(struct drm_fb_helper 
> > > > > *fb_helper,
> > > > >   return best_score;
> > > > >}
> > > > > +/*
> > > > > + * This function checks if rotation is necessary because of panel 
> > > > > orientation
> > > > > + * and if it is, if it is supported.
> > > > > + * If rotation is necessary and supported, its gets set in 
> > > > > fb_crtc.rotation.
> > > > > + * If rotation is necessary but not supported, a DRM_MODE_ROTATE_* 
> > > > > flag gets
> > > > > + * or-ed into fb_helper->rotations. In drm_setup_crtcs_fb() we check 
> > > > > if only
> > > > > + * one bit is set and then we set fb_info.fbcon_rotate_hint to make 
> > > > > fbcon do
> > > > > + * the unsupported rotation.
> > > > > + */
> > > > > +static void drm_setup_crtc_rotation(struct drm_fb_helper *fb_helper,
> > > > > + struct drm_fb_helper_crtc *fb_crtc,
> > > > > + struct drm_connector *connector)
> > > > > +{
> > > > > + struct drm_plane *plane = fb_crtc->mode_set.crtc->primary;
> > > > > + uint64_t valid_mask = 0;
> > > > > + int i, rotation;
> > > > > +
> > > > > + fb_crtc->rotation = DRM_MODE_ROTATE_0;
> > > > > +
> > > > > + switch (connector->display_info.panel_orientation) {
> > > > > + case DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP:
> > > > > + rotation = DRM_MODE_ROTAT

[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Reject unknown syncobj flags

2017-10-31 Thread Patchwork
== Series Details ==

Series: series starting with [1/2] drm/i915: Reject unknown syncobj flags
URL   : https://patchwork.freedesktop.org/series/32893/
State : success

== Summary ==

Series 32893v1 series starting with [1/2] drm/i915: Reject unknown syncobj flags
https://patchwork.freedesktop.org/api/1.0/series/32893/revisions/1/mbox/

Test pm_rpm:
Subgroup basic-rte:
skip   -> PASS   (fi-hsw-4770r) fdo#103522
Test drv_module_reload:
Subgroup basic-reload-inject:
incomplete -> DMESG-WARN (fi-cfl-s) fdo#103206

fdo#103522 https://bugs.freedesktop.org/show_bug.cgi?id=103522
fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:448s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:456s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:373s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:530s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:266s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:501s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:504s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:511s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:563s
fi-cnl-y total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:604s
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:422s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:582s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:491s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:433s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:430s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:425s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:493s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:464s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:491s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:576s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:476s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:583s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:545s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:456s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:597s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:649s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:516s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:500s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:455s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:560s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:420s
fi-gdg-551 failed to connect after reboot

dfe1410689e638c987b39e07288bc1951cb252f3 drm-tip: 2017y-10m-31d-09h-42m-59s UTC 
integration manifest
cd86432c60b2 drm/i915: Warn in debug builds of incorrect usages of ptr_pack_bits
7e8a1307758b drm/i915: Reject unknown syncobj flags

== Logs ==

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


Re: [Intel-gfx] ✓ Fi.CI.IGT: success for tests: add device information tests

2017-10-31 Thread Lionel Landwerlin

On 31/10/17 09:21, Petri Latvala wrote:

On Mon, Oct 30, 2017 at 02:11:10PM +, Patchwork wrote:

== Series Details ==

Series: tests: add device information tests
URL   : https://patchwork.freedesktop.org/series/32764/
State : success

== Summary ==

Test kms_flip:
 Subgroup basic-flip-vs-wf_vblank:
 fail   -> PASS   (shard-hsw) fdo#100368
 Subgroup wf_vblank-vs-dpms-interruptible:
 pass   -> DMESG-WARN (shard-hsw) fdo#102614
Test kms_busy:
 Subgroup extended-modeset-hang-newfb-with-reset-render-A:
 pass   -> DMESG-WARN (shard-hsw) fdo#102249 +2



Status of new tests are not shown here.

Only SNB, HSW and APL execute shards for patchwork, and their results are:

All new tests skipped, except for topology-pre-gen8 which failed on SNB and HSW.

https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_442/shard-hsw4/igt@intel_device_i...@topology-pre-gen8.html




Thanks, will check this.

___
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: Check incoming alignment for unfenced buffers (on i915gm) (rev2)

2017-10-31 Thread Patchwork
== Series Details ==

Series: drm/i915: Check incoming alignment for unfenced buffers (on i915gm) 
(rev2)
URL   : https://patchwork.freedesktop.org/series/32828/
State : success

== Summary ==

Series 32828v2 drm/i915: Check incoming alignment for unfenced buffers (on 
i915gm)
https://patchwork.freedesktop.org/api/1.0/series/32828/revisions/2/mbox/

Test pm_rpm:
Subgroup basic-rte:
skip   -> PASS   (fi-hsw-4770r) fdo#103522
Test drv_module_reload:
Subgroup basic-reload-inject:
incomplete -> DMESG-WARN (fi-cfl-s) fdo#103206

fdo#103522 https://bugs.freedesktop.org/show_bug.cgi?id=103522
fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:436s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:450s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:374s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:526s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:265s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:501s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:500s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:492s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:481s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:552s
fi-cnl-y total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:610s
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:423s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:247s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:585s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:489s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:432s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:426s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:419s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:506s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:460s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:488s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:567s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:476s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:581s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:558s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:455s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:591s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:651s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:529s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:498s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:458s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:554s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:415s

dfe1410689e638c987b39e07288bc1951cb252f3 drm-tip: 2017y-10m-31d-09h-42m-59s UTC 
integration manifest
58f8a5b2b374 drm/i915: Check incoming alignment for unfenced buffers (on i915gm)

== Logs ==

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


[Intel-gfx] [CI 2/2] drm/i915: Print the condition causing GEM_BUG_ON

2017-10-31 Thread Mika Kuoppala
It is easier to categorize and debug bugs if the failed condition
is in plain sight in the actual dmesg output. Make it so.

Cc: Chris Wilson 
Cc: Joonas Lahtinen 
Signed-off-by: Mika Kuoppala 
Reviewed-by: Joonas Lahtinen 
---
 drivers/gpu/drm/i915/i915_gem.h | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
index ee54597465b6..84ba68e83df5 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -28,7 +28,11 @@
 #include 
 
 #ifdef CONFIG_DRM_I915_DEBUG_GEM
-#define GEM_BUG_ON(expr) BUG_ON(expr)
+#define GEM_BUG_ON(condition) do { if (unlikely((condition))) {\
+   printk(KERN_ERR "GEM_BUG_ON(%s)\n", __stringify(condition)); \
+   BUG(); \
+   } \
+   } while(0)
 #define GEM_WARN_ON(expr) WARN_ON(expr)
 
 #define GEM_DEBUG_DECL(var) var
-- 
2.11.0

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


[Intel-gfx] [CI 1/2] drm/i915: Fallback to reserve forcewake if primary ack missing

2017-10-31 Thread Mika Kuoppala
There is a possibility on gen9 hardware to miss the forcewake ack
message. The recommended workaround is to use another free
bit and toggle it until original bit is successfully acknowledged.

Some future gen9 revs might or might not fix the underlying issue but
the fallback to reserve bit dance can be considered as harmless:
without the ack timeout we never reach the reserve bit forcewake.
Thus as of now we adopt a blanket approach for all gen9 and leave
the bypassing the reserve bit approach for future patches if
corresponding hw revisions do appear.

Commit 83e3337204b2 ("drm/i915: Increase maximum polling time to 50ms
for forcewake request/clear ack") did increase the forcewake timeout.
If the issue was a delayed ack, future work could include finding
a suitable timeout value both for primary ack and reserve toggle
to reduce the worst case latency.

v2: use bit 15, naming, comment (Chris), only wait fallback ack
v3: fix return on fallback, backoff after fallback write (Chris)
v4: udelay on first pass, grammar (Chris)

References: HSDES #1604254524
References: https://bugs.freedesktop.org/show_bug.cgi?id=102051
Cc: Chris Wilson 
Cc: Rodrigo Vivi 
Cc: Tvrtko Ursulin 
Cc: Joonas Lahtinen 
Cc: Sagar Arun Kamble 
Signed-off-by: Mika Kuoppala 
Reviewed-by: Chris Wilson 
---
 drivers/gpu/drm/i915/i915_reg.h |   5 +-
 drivers/gpu/drm/i915/intel_uncore.c | 137 +---
 2 files changed, 130 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 8c775e96b4e4..f0f8f6059652 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -7774,8 +7774,9 @@ enum {
 #define  FORCEWAKE_ACK_MEDIA_GEN9  _MMIO(0x0D88)
 #define  FORCEWAKE_ACK_RENDER_GEN9 _MMIO(0x0D84)
 #define  FORCEWAKE_ACK_BLITTER_GEN9_MMIO(0x130044)
-#define   FORCEWAKE_KERNEL 0x1
-#define   FORCEWAKE_USER   0x2
+#define   FORCEWAKE_KERNEL BIT(0)
+#define   FORCEWAKE_USER   BIT(1)
+#define   FORCEWAKE_KERNEL_FALLBACKBIT(15)
 #define  FORCEWAKE_MT_ACK  _MMIO(0x130040)
 #define  ECOBUS_MMIO(0xa180)
 #defineFORCEWAKE_MT_ENABLE (1<<5)
diff --git a/drivers/gpu/drm/i915/intel_uncore.c 
b/drivers/gpu/drm/i915/intel_uncore.c
index 96ee6b2754be..1fe6ce4f1138 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -69,17 +69,104 @@ fw_domain_arm_timer(struct intel_uncore_forcewake_domain 
*d)
   HRTIMER_MODE_REL);
 }
 
+static inline int
+__wait_for_ack(const struct drm_i915_private *i915,
+  const struct intel_uncore_forcewake_domain *d,
+  const u32 ack,
+  const u32 value)
+{
+   return wait_for_atomic((__raw_i915_read32(i915, d->reg_ack) & ack) == 
value,
+  FORCEWAKE_ACK_TIMEOUT_MS);
+}
+
+static inline int
+wait_ack_clear(const struct drm_i915_private *i915,
+  const struct intel_uncore_forcewake_domain *d,
+  const u32 ack)
+{
+   return __wait_for_ack(i915, d, ack, 0);
+}
+
+static inline int
+wait_ack_set(const struct drm_i915_private *i915,
+const struct intel_uncore_forcewake_domain *d,
+const u32 ack)
+{
+   return __wait_for_ack(i915, d, ack, ack);
+}
+
 static inline void
 fw_domain_wait_ack_clear(const struct drm_i915_private *i915,
 const struct intel_uncore_forcewake_domain *d)
 {
-   if (wait_for_atomic((__raw_i915_read32(i915, d->reg_ack) &
-FORCEWAKE_KERNEL) == 0,
-   FORCEWAKE_ACK_TIMEOUT_MS))
+   if (wait_ack_clear(i915, d, FORCEWAKE_KERNEL))
DRM_ERROR("%s: timed out waiting for forcewake ack to clear.\n",
  intel_uncore_forcewake_domain_to_str(d->id));
 }
 
+enum ack_type {
+   ACK_CLEAR = 0,
+   ACK_SET
+};
+
+static int
+fw_domain_wait_ack_with_fallback(const struct drm_i915_private *i915,
+const struct intel_uncore_forcewake_domain *d,
+const enum ack_type type)
+{
+   const u32 ack_bit = FORCEWAKE_KERNEL;
+   const u32 value = type == ACK_SET ? ack_bit : 0;
+   unsigned int pass;
+   bool ack_detected;
+
+   /*
+* There is a possibility of driver's wake request colliding
+* with hardware's own wake requests and that can cause
+* hardware to not deliver the driver's ack message.
+*
+* Use a fallback bit toggle to kick the gpu state machine
+* in the hope that the original ack will be delivered along with
+* the fallback ack.
+*
+* This workaround is described in HSDES #1604254524
+*/
+
+   pass = 1;
+   do {
+   wait_ack_c

[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [CI,1/2] drm/i915: Fallback to reserve forcewake if primary ack missing

2017-10-31 Thread Patchwork
== Series Details ==

Series: series starting with [CI,1/2] drm/i915: Fallback to reserve forcewake 
if primary ack missing
URL   : https://patchwork.freedesktop.org/series/32896/
State : failure

== Summary ==

Series 32896v1 series starting with [CI,1/2] drm/i915: Fallback to reserve 
forcewake if primary ack missing
https://patchwork.freedesktop.org/api/1.0/series/32896/revisions/1/mbox/

Test chamelium:
Subgroup dp-crc-fast:
pass   -> FAIL   (fi-kbl-7500u) fdo#102514
Test gem_exec_flush:
Subgroup basic-uc-set-default:
pass   -> INCOMPLETE (fi-cnl-y)
Test kms_pipe_crc_basic:
Subgroup read-crc-pipe-a:
pass   -> DMESG-WARN (fi-elk-e7500)
Subgroup read-crc-pipe-a-frame-sequence:
pass   -> INCOMPLETE (fi-elk-e7500)
Test pm_rpm:
Subgroup basic-rte:
skip   -> PASS   (fi-hsw-4770r) fdo#103522
Test drv_module_reload:
Subgroup basic-reload-inject:
incomplete -> DMESG-WARN (fi-cfl-s) fdo#103206

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#103522 https://bugs.freedesktop.org/show_bug.cgi?id=103522
fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:438s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:453s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:374s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:530s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:265s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:497s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:499s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:490s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:479s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:546s
fi-cnl-y total:67   pass:50   dwarn:0   dfail:0   fail:0   skip:16 
fi-elk-e7500 total:240  pass:188  dwarn:1   dfail:0   fail:0   skip:50 
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:250s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:577s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:483s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:424s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:425s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:417s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:496s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:465s
fi-kbl-7500u total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  
time:481s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:573s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:477s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:583s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:551s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:454s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:587s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:653s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:513s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:497s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:456s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:560s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:421s

dfe1410689e638c987b39e07288bc1951cb252f3 drm-tip: 2017y-10m-31d-09h-42m-59s UTC 
integration manifest
55af6238fafc drm/i915: Print the condition causing GEM_BUG_ON
0fe1550f4402 drm/i915: Fallback to reserve forcewake if primary ack missing

== Logs ==

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


[Intel-gfx] [PATCH] drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all

2017-10-31 Thread Chris Wilson
To acquire all modeset locks requires a ww_ctx to be allocated. As this
is the legacy path and the allocation small, to reduce the changes
required (and complex untested error handling) to the legacy drivers, we
simply assume that the allocation succeeds. At present, it relies on the
too-small-to-fail rule, but syzbot found that by injecting a failure
here we would hit the WARN. Document that this allocation must succeed
with __GFP_NOFAIL.

Reported-by: syzbot (syzkaller)
Signed-off-by: Chris Wilson 
Cc: Daniel Vetter 
---
 drivers/gpu/drm/drm_modeset_lock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_modeset_lock.c 
b/drivers/gpu/drm/drm_modeset_lock.c
index e123497da0ca..963e23db0fe7 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -93,7 +93,7 @@ void drm_modeset_lock_all(struct drm_device *dev)
struct drm_modeset_acquire_ctx *ctx;
int ret;
 
-   ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+   ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL);
if (WARN_ON(!ctx))
return;
 
-- 
2.15.0.rc2

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


Re: [Intel-gfx] [PATCH v5 2/2] drm/i915: Acquire PUNIT->PMIC bus for intel_uncore_forcewake_reset()

2017-10-31 Thread Ingo Molnar

* Daniel Vetter  wrote:

> On Tue, Oct 31, 2017 at 10:50:06AM +0100, Ingo Molnar wrote:
> > 
> > * Hans de Goede  wrote:
> > 
> > > intel_uncore_forcewake_reset() does forcewake puts and gets as such
> > > we need to make sure that no-one tries to access the PUNIT->PMIC bus
> > > (on systems where this bus is shared) while it runs, otherwise bad
> > > things happen.
> > > 
> > > Normally this is taken care of by the i915_pmic_bus_access_notifier()
> > > which does an intel_uncore_forcewake_get(FORCEWAKE_ALL) when some other
> > > driver tries to access the PMIC bus, so that later forcewake gets are
> > > no-ops (for the duration of the bus access).
> > > 
> > > But intel_uncore_forcewake_reset gets called in 3 cases:
> > > 1) Before registering the pmic_bus_access_notifier
> > > 2) After unregistering the pmic_bus_access_notifier
> > > 3) To reset forcewake state on a GPU reset
> > > 
> > > In all 3 cases the i915_pmic_bus_access_notifier() protection is
> > > insufficient.
> > > 
> > > This commit fixes this race by calling iosf_mbi_punit_acquire() before
> > > calling intel_uncore_forcewake_reset(). In the case where it is called
> > > directly after unregistering the pmic_bus_access_notifier, we need to
> > > hold the punit-lock over both calls to avoid a race where
> > > intel_uncore_fw_release_timer() may execute between the 2 calls.
> > > 
> > > Signed-off-by: Hans de Goede 
> > > Reviewed-by: Imre Deak 
> > > ---
> > > Changes in v2:
> > > -Rebase on current (July 6th 2017) drm-next
> > > 
> > > Changes in v3:
> > > -Keep punit acquired / locked over the unregister + forcewake_reset
> > >  call combo to avoid a race hitting between the 2 calls
> > > -This requires modifying iosf_mbi_unregister_pmic_bus_access_notifier
> > >  to not take the lock itself, since we are the only users this is done
> > >  in this same commit
> > > 
> > > Changes in v4:
> > > -Fix missing rename in doc-comment
> > > -Add and use iosf_mbi_assert_punit_acquired() helper
> > > -Add missing acquire surrounding intel_uncore_forcewake_reset() inside
> > >  intel_uncore_check_forcewake_domains()
> > > -Add Imre's Reviewed-by
> > > 
> > > Changes in v5:
> > > -Separate out arch/x86 iosf_mbi changes into a separate patch
> > > ---
> > >  drivers/gpu/drm/i915/intel_uncore.c   | 17 +
> > >  drivers/gpu/drm/i915/selftests/intel_uncore.c |  3 +++
> > >  2 files changed, 16 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_uncore.c 
> > > b/drivers/gpu/drm/i915/intel_uncore.c
> > > index 8c2ce81f01c2..0da81faf3981 100644
> > > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > > @@ -229,6 +229,7 @@ intel_uncore_fw_release_timer(struct hrtimer *timer)
> > >   return HRTIMER_NORESTART;
> > >  }
> > >  
> > > +/* Note callers must have acquired the PUNIT->PMIC bus, before calling 
> > > this. */
> > >  static void intel_uncore_forcewake_reset(struct drm_i915_private 
> > > *dev_priv,
> > >bool restore)
> > >  {
> > > @@ -237,6 +238,8 @@ static void intel_uncore_forcewake_reset(struct 
> > > drm_i915_private *dev_priv,
> > >   int retry_count = 100;
> > >   enum forcewake_domains fw, active_domains;
> > >  
> > > + iosf_mbi_assert_punit_acquired();
> > > +
> > >   /* Hold uncore.lock across reset to prevent any register access
> > >* with forcewake not set correctly. Wait until all pending
> > >* timers are run before holding.
> > > @@ -416,14 +419,18 @@ static void __intel_uncore_early_sanitize(struct 
> > > drm_i915_private *dev_priv,
> > >  GT_FIFO_CTL_RC6_POLICY_STALL);
> > >   }
> > >  
> > > + iosf_mbi_punit_acquire();
> > >   intel_uncore_forcewake_reset(dev_priv, restore_forcewake);
> > > + iosf_mbi_punit_release();
> > >  }
> > >  
> > >  void intel_uncore_suspend(struct drm_i915_private *dev_priv)
> > >  {
> > > - iosf_mbi_unregister_pmic_bus_access_notifier(
> > > + iosf_mbi_punit_acquire();
> > > + iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
> > >   &dev_priv->uncore.pmic_bus_access_nb);
> > >   intel_uncore_forcewake_reset(dev_priv, false);
> > > + iosf_mbi_punit_release();
> > >  }
> > >  
> > >  void intel_uncore_resume_early(struct drm_i915_private *dev_priv)
> > > @@ -1315,12 +1322,14 @@ void intel_uncore_init(struct drm_i915_private 
> > > *dev_priv)
> > >  
> > >  void intel_uncore_fini(struct drm_i915_private *dev_priv)
> > >  {
> > > - iosf_mbi_unregister_pmic_bus_access_notifier(
> > > - &dev_priv->uncore.pmic_bus_access_nb);
> > > -
> > >   /* Paranoia: make sure we have disabled everything before we exit. */
> > >   intel_uncore_sanitize(dev_priv);
> > > +
> > > + iosf_mbi_punit_acquire();
> > > + iosf_mbi_unregister_pmic_bus_access_notifier_unlocked(
> > > + &dev_priv->uncore.pmic_bus_access_nb);
> > >   intel_uncore_forcewake_reset(dev_priv, false);
> > > + iosf_mbi_punit_release();
> > >  }
> > >  
> > >  sta

[Intel-gfx] [PATCH] drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all

2017-10-31 Thread Chris Wilson
To acquire all modeset locks requires a ww_ctx to be allocated. As this
is the legacy path and the allocation small, to reduce the changes
required (and complex untested error handling) to the legacy drivers, we
simply assume that the allocation succeeds. At present, it relies on the
too-small-to-fail rule, but syzbot found that by injecting a failure
here we would hit the WARN. Document that this allocation must succeed
with __GFP_NOFAIL.

Reported-by: syzbot (syzkaller)
Signed-off-by: Chris Wilson 
Cc: Daniel Vetter 
---
Resent to the right list!
---
 drivers/gpu/drm/drm_modeset_lock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_modeset_lock.c 
b/drivers/gpu/drm/drm_modeset_lock.c
index e123497da0ca..963e23db0fe7 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -93,7 +93,7 @@ void drm_modeset_lock_all(struct drm_device *dev)
struct drm_modeset_acquire_ctx *ctx;
int ret;
 
-   ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+   ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL);
if (WARN_ON(!ctx))
return;
 
-- 
2.15.0.rc2

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


[Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915: Reject unknown syncobj flags

2017-10-31 Thread Patchwork
== Series Details ==

Series: series starting with [1/2] drm/i915: Reject unknown syncobj flags
URL   : https://patchwork.freedesktop.org/series/32893/
State : success

== Summary ==

Test kms_setmode:
Subgroup basic:
pass   -> FAIL   (shard-hsw) fdo#99912
Test drv_module_reload:
Subgroup basic-reload-inject:
pass   -> DMESG-WARN (shard-hsw) fdo#102707
Test perf:
Subgroup blocking:
pass   -> FAIL   (shard-hsw) fdo#102252
Subgroup oa-exponents:
pass   -> FAIL   (shard-hsw) fdo#102254

fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254

shard-hswtotal:2539 pass:1429 dwarn:2   dfail:0   fail:11  skip:1097 
time:9425s

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6274/shards.html
___
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: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all

2017-10-31 Thread Patchwork
== Series Details ==

Series: drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all
URL   : https://patchwork.freedesktop.org/series/32899/
State : success

== Summary ==

Series 32899v1 drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all
https://patchwork.freedesktop.org/api/1.0/series/32899/revisions/1/mbox/

Test pm_rpm:
Subgroup basic-rte:
skip   -> PASS   (fi-hsw-4770r) fdo#103522
Test drv_module_reload:
Subgroup basic-reload-inject:
incomplete -> DMESG-WARN (fi-cfl-s) fdo#103206

fdo#103522 https://bugs.freedesktop.org/show_bug.cgi?id=103522
fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:440s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:448s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:371s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:529s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:265s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:502s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:498s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:493s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:479s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:556s
fi-cnl-y total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:606s
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:420s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:256s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:583s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:482s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:431s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:434s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:421s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:490s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:464s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:491s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:573s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:474s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:589s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:457s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:591s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:644s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:526s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:502s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:452s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:564s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:417s

dfe1410689e638c987b39e07288bc1951cb252f3 drm-tip: 2017y-10m-31d-09h-42m-59s UTC 
integration manifest
e1be47442043 drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all

== Logs ==

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


[Intel-gfx] [PATCH] drm/i915: Check that the breadcrumb wasn't disarmed automatically before parking

2017-10-31 Thread Chris Wilson
We will disarm the breadcrumb interrupt if we see a user interrupt
whilst no one is waiting. This may race with the call to
intel_engine_disarm_breadcrumbs() triggering an assert that we aren't
trying to do the same job twice. Prevent this by checking that the irq
is still armed after flushing the interrupt (for the irq spinlock).

Fixes: bcbd5c33a342 ("drm/i915/guc: Always enable the breadcrumbs irq")
Signed-off-by: Chris Wilson 
Cc: Joonas Lahtinen 
Cc: Michał Winiarski 
---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c 
b/drivers/gpu/drm/i915/intel_breadcrumbs.c
index 1bd0a461d665..4de054f8c1ba 100644
--- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
@@ -219,7 +219,8 @@ void intel_engine_disarm_breadcrumbs(struct intel_engine_cs 
*engine)
 
spin_lock(&b->irq_lock);
first = fetch_and_zero(&b->irq_wait);
-   __intel_engine_disarm_breadcrumbs(engine);
+   if (b->irq_armed)
+   __intel_engine_disarm_breadcrumbs(engine);
spin_unlock(&b->irq_lock);
 
rbtree_postorder_for_each_entry_safe(wait, n, &b->waiters, node) {
-- 
2.15.0.rc2

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


[Intel-gfx] ✗ Fi.CI.IGT: warning for drm/i915: Check incoming alignment for unfenced buffers (on i915gm) (rev2)

2017-10-31 Thread Patchwork
== Series Details ==

Series: drm/i915: Check incoming alignment for unfenced buffers (on i915gm) 
(rev2)
URL   : https://patchwork.freedesktop.org/series/32828/
State : warning

== Summary ==

Test kms_flip:
Subgroup vblank-vs-dpms-suspend:
pass   -> SKIP   (shard-hsw)
Subgroup flip-vs-expired-vblank-interruptible:
pass   -> FAIL   (shard-hsw) fdo#102887
Test kms_cursor_legacy:
Subgroup flip-vs-cursor-legacy:
pass   -> FAIL   (shard-hsw) fdo#102670
Test perf:
Subgroup polling:
pass   -> FAIL   (shard-hsw) fdo#102252
Test kms_frontbuffer_tracking:
Subgroup fbc-modesetfrombusy:
pass   -> SKIP   (shard-hsw)
Test drv_module_reload:
Subgroup basic-reload:
pass   -> DMESG-WARN (shard-hsw) fdo#102707

fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707

shard-hswtotal:2539 pass:1427 dwarn:2   dfail:0   fail:11  skip:1099 
time:9398s

== Logs ==

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


[Intel-gfx] ✗ Fi.CI.BAT: failure for drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all (rev2)

2017-10-31 Thread Patchwork
== Series Details ==

Series: drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all (rev2)
URL   : https://patchwork.freedesktop.org/series/32899/
State : failure

== Summary ==

Series 32899v2 drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all
https://patchwork.freedesktop.org/api/1.0/series/32899/revisions/2/mbox/

Test kms_setmode:
Subgroup basic-clone-single-crtc:
pass   -> DMESG-WARN (fi-skl-6700k)
Test kms_sink_crc_basic:
skip   -> INCOMPLETE (fi-skl-6700k)
Test pm_rpm:
Subgroup basic-rte:
skip   -> PASS   (fi-hsw-4770r)
Test drv_module_reload:
Subgroup basic-reload-inject:
incomplete -> DMESG-WARN (fi-cfl-s) fdo#103206

fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:437s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:447s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:373s
fi-bsw-n3050 total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  
time:531s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:265s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:497s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:488s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:490s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:480s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:551s
fi-cnl-y total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:615s
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:423s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:248s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:573s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:483s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:432s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:427s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:420s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:493s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:461s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:486s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:568s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:478s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:578s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:543s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:452s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:591s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:642s
fi-skl-6700k total:250  pass:227  dwarn:1   dfail:0   fail:0   skip:21 
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:509s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:460s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:559s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:418s

dfe1410689e638c987b39e07288bc1951cb252f3 drm-tip: 2017y-10m-31d-09h-42m-59s UTC 
integration manifest
d99ca4a2b64d drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all

== Logs ==

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


Re: [Intel-gfx] [CI 2/2] drm/i915: Print the condition causing GEM_BUG_ON

2017-10-31 Thread Chris Wilson
Quoting Mika Kuoppala (2017-10-31 11:22:54)
> It is easier to categorize and debug bugs if the failed condition
> is in plain sight in the actual dmesg output. Make it so.
> 
> Cc: Chris Wilson 
> Cc: Joonas Lahtinen 
> Signed-off-by: Mika Kuoppala 
> Reviewed-by: Joonas Lahtinen 
> ---
>  drivers/gpu/drm/i915/i915_gem.h | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
> index ee54597465b6..84ba68e83df5 100644
> --- a/drivers/gpu/drm/i915/i915_gem.h
> +++ b/drivers/gpu/drm/i915/i915_gem.h
> @@ -28,7 +28,11 @@
>  #include 
>  
>  #ifdef CONFIG_DRM_I915_DEBUG_GEM
> -#define GEM_BUG_ON(expr) BUG_ON(expr)
> +#define GEM_BUG_ON(condition) do { if (unlikely((condition))) {\
> +   printk(KERN_ERR "GEM_BUG_ON(%s)\n", __stringify(condition)); \
> +   BUG(); \
> +   } \
> +   } while(0)

I'm thinking the ones we actually hit, we should spend the time in
writing up better debug output (i.e. GEM_BUG(expr, fmt, ...));

GEM_BUG_ON(expr) would become GEM_BUG(expr, __stringify(expr));
That shall be the next task.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Check that the breadcrumb wasn't disarmed automatically before parking

2017-10-31 Thread Patchwork
== Series Details ==

Series: drm/i915: Check that the breadcrumb wasn't disarmed automatically 
before parking
URL   : https://patchwork.freedesktop.org/series/32903/
State : failure

== Summary ==

Series 32903v1 drm/i915: Check that the breadcrumb wasn't disarmed 
automatically before parking
https://patchwork.freedesktop.org/api/1.0/series/32903/revisions/1/mbox/

Test chamelium:
Subgroup dp-crc-fast:
pass   -> FAIL   (fi-kbl-7500u) fdo#102514
Test drv_hangman:
Subgroup error-state-basic:
pass   -> DMESG-WARN (fi-bsw-n3050)
Test gem_exec_flush:
Subgroup basic-wb-pro-default:
pass   -> INCOMPLETE (fi-cnl-y)
Test pm_rpm:
Subgroup basic-rte:
skip   -> PASS   (fi-hsw-4770r)
Test drv_module_reload:
Subgroup basic-reload-inject:
incomplete -> DMESG-WARN (fi-cfl-s) fdo#103206

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:435s
fi-bdw-gvtdvmtotal:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:452s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:373s
fi-bsw-n3050 total:289  pass:242  dwarn:1   dfail:0   fail:0   skip:46  
time:514s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:267s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:503s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:493s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:497s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:480s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:547s
fi-cnl-y total:68   pass:51   dwarn:0   dfail:0   fail:0   skip:16 
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:422s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:256s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:584s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:488s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:429s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:430s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:421s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:493s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:460s
fi-kbl-7500u total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  
time:478s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:576s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:473s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:585s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:539s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:448s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:591s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:650s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:523s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:499s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:454s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:564s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:422s

dfe1410689e638c987b39e07288bc1951cb252f3 drm-tip: 2017y-10m-31d-09h-42m-59s UTC 
integration manifest
a0b17594f5c6 drm/i915: Check that the breadcrumb wasn't disarmed automatically 
before parking

== Logs ==

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


Re: [Intel-gfx] [PATCH] drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all

2017-10-31 Thread Chris Wilson
Quoting Chris Wilson (2017-10-31 11:55:35)
> To acquire all modeset locks requires a ww_ctx to be allocated. As this
> is the legacy path and the allocation small, to reduce the changes
> required (and complex untested error handling) to the legacy drivers, we
> simply assume that the allocation succeeds. At present, it relies on the
> too-small-to-fail rule, but syzbot found that by injecting a failure
> here we would hit the WARN. Document that this allocation must succeed
> with __GFP_NOFAIL.
> 
> Reported-by: syzbot (syzkaller)

Proper credit is
Reported-by: syzbot 

> Signed-off-by: Chris Wilson 
> Cc: Daniel Vetter 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: Replace "cc-option -Wno-foo" with "cc-disable-warning foo"

2017-10-31 Thread Joonas Lahtinen
On Mon, 2017-10-30 at 17:29 +, Chris Wilson wrote:
> To quote kbuild/makefiles.txt:
> 
> cc-disable-warning checks if gcc supports a given warning and returns
> the commandline switch to disable it. This special function is needed,
> because gcc 4.4 and later accept any unknown -Wno-* option and only
> warn about it if there is another warning in the source file.
> 
> This is exactly what we were trying to achieve with cc-option -Wno-foo and
> failed miserably.
> 
> Reported-by: kbuild-...@01.org
> Fixes: 39bf4de89ff7 ("drm/i915: Add -Wall -Wextra to our build, set warnings 
> to full")
> Signed-off-by: Chris Wilson 
> Cc: Joonas Lahtinen 
> Cc: Jani Nikula 

Poor person who greps for "-Wno-", should we add comment
"# -Wno-whatever" at the end of each line?

Reviewed-by: Joonas Lahtinen 

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all

2017-10-31 Thread Ville Syrjälä
On Tue, Oct 31, 2017 at 11:55:35AM +, Chris Wilson wrote:
> To acquire all modeset locks requires a ww_ctx to be allocated. As this
> is the legacy path and the allocation small, to reduce the changes
> required (and complex untested error handling) to the legacy drivers, we
> simply assume that the allocation succeeds. At present, it relies on the
> too-small-to-fail rule, but syzbot found that by injecting a failure
> here we would hit the WARN. Document that this allocation must succeed
> with __GFP_NOFAIL.
> 
> Reported-by: syzbot (syzkaller)
> Signed-off-by: Chris Wilson 
> Cc: Daniel Vetter 

Reviewed-by: Ville Syrjälä 

> ---
> Resent to the right list!
> ---
>  drivers/gpu/drm/drm_modeset_lock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_modeset_lock.c 
> b/drivers/gpu/drm/drm_modeset_lock.c
> index e123497da0ca..963e23db0fe7 100644
> --- a/drivers/gpu/drm/drm_modeset_lock.c
> +++ b/drivers/gpu/drm/drm_modeset_lock.c
> @@ -93,7 +93,7 @@ void drm_modeset_lock_all(struct drm_device *dev)
>   struct drm_modeset_acquire_ctx *ctx;
>   int ret;
>  
> - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
> + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL);
>   if (WARN_ON(!ctx))
>   return;
>  
> -- 
> 2.15.0.rc2
> 
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t] kms_atomic_transition: Add subtest time limit/randomize plane, pipe combinations

2017-10-31 Thread Imre Deak
Doing modeset on internal panels may have a considerable overhead due to
the panel specific power sequencing delays. To avoid long test runtimes
limit the runtime of each subtest. Randomize the plane/pipe combinations
to preserve the test coverage on such panels at least over multiple test
runs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103334
Cc: Maarten Lankhorst 
Signed-off-by: Imre Deak 
---
 tests/kms_atomic_transition.c | 175 --
 1 file changed, 150 insertions(+), 25 deletions(-)

diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index 4c295125..ac67fc3a 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -39,6 +39,14 @@
 #define DRM_CAP_CURSOR_HEIGHT 0x9
 #endif
 
+#define MAX_SUBTEST_DURATION_NS (20ULL * NSEC_PER_SEC)
+
+struct test_config {
+   igt_display_t *display;
+   bool user_seed;
+   int seed;
+};
+
 struct plane_parms {
struct igt_fb *fb;
uint32_t width, height;
@@ -401,6 +409,28 @@ static void wait_for_transition(igt_display_t *display, 
enum pipe pipe, bool non
}
 }
 
+/* Copied from https://benpfaff.org/writings/clc/shuffle.html */
+static void shuffle_array(uint32_t *array, int size, int seed)
+{
+   int i;
+
+   for (i = 0; i < size; i++) {
+   int j = i + rand() / (RAND_MAX / (size - i) + 1);
+
+   igt_swap(array[i], array[j]);
+   }
+}
+
+static void init_combination_array(uint32_t *array, int size, int seed)
+{
+   int i;
+
+   for (i = 0; i < size; i++)
+   array[i] = i;
+
+   shuffle_array(array, size, seed);
+}
+
 /*
  * 1. Set primary plane to a known fb.
  * 2. Make sure getcrtc returns the correct fb id.
@@ -411,19 +441,27 @@ static void wait_for_transition(igt_display_t *display, 
enum pipe pipe, bool non
  * so test this and make sure it works.
  */
 static void
-run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t 
*output,
-   enum transition_type type, bool nonblocking, bool fencing)
+run_transition_test(struct test_config *test_config, enum pipe pipe,
+   igt_output_t *output, enum transition_type type,
+   bool nonblocking, bool fencing)
 {
struct igt_fb fb, argb_fb, sprite_fb;
drmModeModeInfo *mode, override_mode;
+   igt_display_t *display = test_config->display;
igt_plane_t *plane;
igt_pipe_t *pipe_obj = &display->pipes[pipe];
uint32_t iter_max = 1 << pipe_obj->n_planes, i;
+   uint32_t *plane_combinations;
+   struct timespec start = { };
struct plane_parms parms[pipe_obj->n_planes];
bool skip_test = false;
unsigned flags = 0;
int ret;
 
+   plane_combinations = malloc(sizeof(*plane_combinations) * iter_max);
+   igt_assert(plane_combinations);
+   init_combination_array(plane_combinations, iter_max, test_config->seed);
+
if (fencing)
prepare_fencing(display, pipe);
else
@@ -527,39 +565,59 @@ run_transition_test(igt_display_t *display, enum pipe 
pipe, igt_output_t *output
goto cleanup;
}
 
+   igt_nsec_elapsed(&start);
+
for (i = 0; i < iter_max; i++) {
igt_output_set_pipe(output, pipe);
 
-   wm_setup_plane(display, pipe, i, parms, fencing);
+   wm_setup_plane(display, pipe, plane_combinations[i], parms,
+  fencing);
 
-   atomic_commit(display, pipe, flags, (void *)(unsigned long)i, 
fencing);
+   atomic_commit(display, pipe, flags,
+ (void *)(unsigned long)plane_combinations[i],
+ fencing);
wait_for_transition(display, pipe, nonblocking, fencing);
 
if (type == TRANSITION_MODESET_DISABLE) {
+   if (igt_nsec_elapsed(&start) >= MAX_SUBTEST_DURATION_NS)
+   goto cleanup;
+
igt_output_set_pipe(output, PIPE_NONE);
 
wm_setup_plane(display, pipe, 0, parms, fencing);
 
atomic_commit(display, pipe, flags, (void *) 0UL, 
fencing);
wait_for_transition(display, pipe, nonblocking, 
fencing);
+
} else {
uint32_t j;
 
/* i -> i+1 will be done when i increases, can be 
skipped here */
for (j = iter_max - 1; j > i + 1; j--) {
-   wm_setup_plane(display, pipe, j, parms, 
fencing);
+   if (igt_nsec_elapsed(&start) >= 
MAX_SUBTEST_DURATION_NS)
+   goto cleanup;
+
+   wm_setup_plane(display, pipe,
+  plane_combinations[j], parms,
+  fencing);
 
  

[Intel-gfx] ✓ Fi.CI.BAT: success for kms_atomic_transition: Add subtest time limit/randomize plane, pipe combinations

2017-10-31 Thread Patchwork
== Series Details ==

Series: kms_atomic_transition: Add subtest time limit/randomize plane, pipe 
combinations
URL   : https://patchwork.freedesktop.org/series/32905/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
7aac0e88606ce453b111ce80419dc58519db05ad assembler: Fix bashism in run-test.sh

with latest DRM-Tip kernel build CI_DRM_3300
dfe1410689e6 drm-tip: 2017y-10m-31d-09h-42m-59s UTC integration manifest

No testlist changes.

Test pm_rpm:
Subgroup basic-rte:
skip   -> PASS   (fi-hsw-4770r)
Test drv_module_reload:
Subgroup basic-reload:
pass   -> DMESG-WARN (fi-bsw-n3050) fdo#103479
Subgroup basic-reload-inject:
incomplete -> DMESG-WARN (fi-cfl-s) fdo#103206

fdo#103479 https://bugs.freedesktop.org/show_bug.cgi?id=103479
fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  
time:445s
fi-blb-e6850 total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  
time:376s
fi-bsw-n3050 total:289  pass:242  dwarn:1   dfail:0   fail:0   skip:46  
time:534s
fi-bwr-2160  total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 
time:268s
fi-bxt-dsi   total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  
time:501s
fi-bxt-j4205 total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:502s
fi-byt-j1900 total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  
time:501s
fi-byt-n2820 total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  
time:480s
fi-cfl-s total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  
time:559s
fi-cnl-y total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:603s
fi-elk-e7500 total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  
time:425s
fi-gdg-551   total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 
time:249s
fi-glk-1 total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  
time:576s
fi-glk-dsi   total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  
time:483s
fi-hsw-4770  total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:428s
fi-hsw-4770r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:432s
fi-ilk-650   total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  
time:425s
fi-ivb-3520m total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:486s
fi-ivb-3770  total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  
time:463s
fi-kbl-7500u total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  
time:483s
fi-kbl-7560u total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  
time:571s
fi-kbl-7567u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:476s
fi-kbl-r total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:588s
fi-pnv-d510  total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  
time:548s
fi-skl-6260u total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:457s
fi-skl-6600u total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  
time:592s
fi-skl-6700hqtotal:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  
time:651s
fi-skl-6700k total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  
time:519s
fi-skl-6770hqtotal:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  
time:507s
fi-skl-gvtdvmtotal:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  
time:454s
fi-snb-2520m total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  
time:566s
fi-snb-2600  total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  
time:422s

== Logs ==

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


Re: [Intel-gfx] [PATCH 05/20] drm/i915: Save all GT WAs and apply them at a later time

2017-10-31 Thread Joonas Lahtinen
On Mon, 2017-10-30 at 13:17 -0700, Oscar Mateo wrote:
> By doing this, we can dump these workarounds in debugfs for validation (which,
> at the moment, we are only able to do for the contexts WAs).
> 
> v2:
>   - Wrong macro used for MMIO set bit masked
>   - Improved naming
>   - Rebased
> 
> v3:
>   - GT instead of MMIO (Chris, Mika)
>   - Leave L3_PRIO_CREDITS_MASK for a separate patch
>   - Rebased
> 
> v4: Carry the init_early nomenclature over (Chris)
> 
> Signed-off-by: Oscar Mateo 
> Cc: Mika Kuoppala 
> Cc: Ville Syrjälä 
> Reviewed-by: Chris Wilson 

This and the following patch are still a no-go and won't be merged. The
required changes for the series to be accepted (to make it more
declarative) were clearly described previously. If there are further
questions, we should discuss those instead wasting time looking at
respins that do not address the input given.

Respins that ignore review are a waste of everyone's time. So, please
react to the review instead of trying to brute force a series in as you
see fit.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v2 08/15] drm/i915: Use drm_fb_helper_output_poll_changed()

2017-10-31 Thread Noralf Trønnes


Den 31.10.2017 11.27, skrev Daniel Vetter:

On Mon, Oct 30, 2017 at 04:39:44PM +0100, Noralf Trønnes wrote:

This driver can use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Jani Nikula 
Cc: Joonas Lahtinen 
Cc: Rodrigo Vivi 
Signed-off-by: Noralf Trønnes 
---
  drivers/gpu/drm/i915/intel_display.c | 2 +-
  drivers/gpu/drm/i915/intel_drv.h | 5 -
  drivers/gpu/drm/i915/intel_fbdev.c   | 8 
  3 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index f780f39e0758..b205e2c782bb 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14123,7 +14123,7 @@ static void intel_atomic_state_free(struct 
drm_atomic_state *state)
  static const struct drm_mode_config_funcs intel_mode_funcs = {
.fb_create = intel_user_framebuffer_create,
.get_format_info = intel_get_format_info,
-   .output_poll_changed = intel_fbdev_output_poll_changed,
+   .output_poll_changed = drm_fb_helper_output_poll_changed,
.atomic_check = intel_atomic_check,
.atomic_commit = intel_atomic_commit,
.atomic_state_alloc = intel_atomic_state_alloc,
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 463ed152e6b1..dfcf5ba220e8 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1607,7 +1607,6 @@ extern void intel_fbdev_initial_config_async(struct 
drm_device *dev);
  extern void intel_fbdev_unregister(struct drm_i915_private *dev_priv);
  extern void intel_fbdev_fini(struct drm_i915_private *dev_priv);
  extern void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool 
synchronous);
-extern void intel_fbdev_output_poll_changed(struct drm_device *dev);
  extern void intel_fbdev_restore_mode(struct drm_device *dev);
  #else
  static inline int intel_fbdev_init(struct drm_device *dev)
@@ -1631,10 +1630,6 @@ static inline void intel_fbdev_set_suspend(struct 
drm_device *dev, int state, bo
  {
  }
  
-static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)

-{
-}
-
  static inline void intel_fbdev_restore_mode(struct drm_device *dev)
  {
  }
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c 
b/drivers/gpu/drm/i915/intel_fbdev.c
index f2bb8116227c..35babbadfc5a 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -796,14 +796,6 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int 
state, bool synchronous
console_unlock();
  }
  
-void intel_fbdev_output_poll_changed(struct drm_device *dev)

-{
-   struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
-
-   if (ifbdev)

This removes the NULL check here, and I think we still need that one for
some slightly unclear but probably hilarious reasons.

I guess simplest if you just drop the i915 patch as too tricky.


Ok.

Several drivers had this NULL check and I did a verification in the drivers
fbdev code that conversion was OK. But I left it to the maintainer to know
about any code paths that wasn't obvious to me by looking at the fbdev code.

On the surface i915 looks OK and here's the rationale:

dev->fb_helper is set in drm_fb_helper_init() and cleared in 
drm_fb_helper_fini().

All fbdev init error paths I've seen call drm_fb_helper_fini().
This means that dev->fb_helper is only set when fbdev is initialized.

drm_fb_helper_output_poll_changed() can handle dev->fb_helper == NULL:

void drm_fb_helper_output_poll_changed(struct drm_device *dev)
{
    drm_fb_helper_hotplug_event(dev->fb_helper);
}

int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
{
...
    if (!drm_fbdev_emulation || !fb_helper)
     return 0;
...
}

dev->fb_helper and dev_priv->fbdev are set and cleared in sync:

int intel_fbdev_init(struct drm_device *dev)
{
    struct drm_i915_private *dev_priv = to_i915(dev);
    struct intel_fbdev *ifbdev;
    int ret;

    if (WARN_ON(INTEL_INFO(dev_priv)->num_pipes == 0))
        return -ENODEV;

    ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
    if (ifbdev == NULL)
        return -ENOMEM;

    drm_fb_helper_prepare(dev, &ifbdev->helper, &intel_fb_helper_funcs);

    if (!intel_fbdev_init_bios(dev, ifbdev))
        ifbdev->preferred_bpp = 32;

    ret = drm_fb_helper_init(dev, &ifbdev->helper, 4);
    if (ret) {
        kfree(ifbdev);
        return ret;
    }

dev->fb_helper is now set (by drm_fb_helper_init()).

    dev_priv->fbdev = ifbdev;

dev_priv->fbdev is now set

    INIT_WORK(&dev_priv->fbdev_suspend_work, intel_fbdev_suspend_worker);

    drm_fb_helper_single_add_all_connectors(&ifbdev->helper);

    return 0;
}

void intel_fbdev_fini(struct drm_i915_private *dev_priv)
{
    struct intel_fbdev *ifbdev = fetch_and_zero(&dev_priv->fbdev);

dev_priv->fbdev is now NULL

    if (!ifbdev)
        return;

    intel_fbdev_destroy(ifbdev);
}

static void intel_fbdev_destroy(struct intel_f

Re: [Intel-gfx] [PATCH v2 15/15] staging: vboxvideo: Use drm_fb_helper_lastclose()

2017-10-31 Thread Noralf Trønnes


Den 31.10.2017 11.32, skrev Daniel Vetter:

On Mon, Oct 30, 2017 at 04:39:51PM +0100, Noralf Trønnes wrote:

This driver can use drm_fb_helper_lastclose() as its .lastclose callback.

Cc: Hans de Goede 
Signed-off-by: Noralf Trønnes 
Reviewed-by: Hans de Goede 
---
  drivers/staging/vboxvideo/vbox_drv.c  |  2 +-
  drivers/staging/vboxvideo/vbox_drv.h  |  1 -
  drivers/staging/vboxvideo/vbox_main.c | 12 
  3 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/staging/vboxvideo/vbox_drv.c 
b/drivers/staging/vboxvideo/vbox_drv.c
index e18642e5027e..a4d8d7898e3d 100644
--- a/drivers/staging/vboxvideo/vbox_drv.c
+++ b/drivers/staging/vboxvideo/vbox_drv.c
@@ -229,7 +229,7 @@ static struct drm_driver driver = {
  
  	.load = vbox_driver_load,

.unload = vbox_driver_unload,
-   .lastclose = vbox_driver_lastclose,
+   .lastclose = drm_fb_helper_lastclose,
.master_set = vbox_master_set,
.master_drop = vbox_master_drop,
  
diff --git a/drivers/staging/vboxvideo/vbox_drv.h b/drivers/staging/vboxvideo/vbox_drv.h

index 4b9302703b36..7273d7e9bc9b 100644
--- a/drivers/staging/vboxvideo/vbox_drv.h
+++ b/drivers/staging/vboxvideo/vbox_drv.h
@@ -128,7 +128,6 @@ struct vbox_private {
  
  int vbox_driver_load(struct drm_device *dev, unsigned long flags);

  void vbox_driver_unload(struct drm_device *dev);
-void vbox_driver_lastclose(struct drm_device *dev);
  
  struct vbox_gem_object;
  
diff --git a/drivers/staging/vboxvideo/vbox_main.c b/drivers/staging/vboxvideo/vbox_main.c

index 80bd039fa08e..c3d756620fd5 100644
--- a/drivers/staging/vboxvideo/vbox_main.c
+++ b/drivers/staging/vboxvideo/vbox_main.c
@@ -421,18 +421,6 @@ void vbox_driver_unload(struct drm_device *dev)
vbox_hw_fini(vbox);
  }
  
-/**

- * @note this is described in the DRM framework documentation.  AST does not
- * have it, but we get an oops on driver unload if it is not present.
- */
-void vbox_driver_lastclose(struct drm_device *dev)
-{
-   struct vbox_private *vbox = dev->dev_private;
-
-   if (vbox->fbdev)

Hm, except gma500 all the drivers have this NULL check here. I'm not sure
whether that's just cargo-culted or whether that's needed, but I'm wary
from slapping an Ack on the entire series as-is.


I think it's cargo-culted because IIRC almost every driver bails out if
fbdev init fails. So the only time the pointer is NULL is when fbdev
emulation is compiled out. And in that case the check is not needed.

vboxvideo for instance fails probing if fbdev init fails, and if it
succeeds vbox->fbdev is always set.

But anyhow, yeah, I think it's better that the driver maintainers verify 
this.


Noralf.


I'm pretty sure we still need it for i915, but everyone else might just
have copied too much. Or it predates the helper support for disabling the
fbdev emulation.

There's also the question that a bunch of drivers who set up fbdev forgot
to add the lastclose call it seems, but that's a different story.
-Daniel


-   drm_fb_helper_restore_fbdev_mode_unlocked(&vbox->fbdev->helper);
-}
-
  int vbox_gem_create(struct drm_device *dev,
u32 size, bool iskernel, struct drm_gem_object **obj)
  {
--
2.14.2



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


[Intel-gfx] ✓ Fi.CI.IGT: success for kms_atomic_transition: Add subtest time limit/randomize plane, pipe combinations

2017-10-31 Thread Patchwork
== Series Details ==

Series: kms_atomic_transition: Add subtest time limit/randomize plane, pipe 
combinations
URL   : https://patchwork.freedesktop.org/series/32905/
State : success

== Summary ==

Test kms_busy:
Subgroup extended-modeset-hang-newfb-with-reset-render-A:
dmesg-warn -> PASS   (shard-hsw) fdo#102249 +1
Test kms_flip:
Subgroup plain-flip-fb-recreate-interruptible:
pass   -> FAIL   (shard-hsw) fdo#100368
Test perf:
Subgroup polling:
pass   -> FAIL   (shard-hsw) fdo#102252

fdo#102249 https://bugs.freedesktop.org/show_bug.cgi?id=102249
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hswtotal:2539 pass:1431 dwarn:1   dfail:0   fail:10  skip:1097 
time:9295s

== Logs ==

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


Re: [Intel-gfx] [PATCH v2 2/2] Test case for drm_vblank_cleanup refcount validation patch

2017-10-31 Thread PrasannaKumar Muralidharan
Hi Daniel,

On 31 October 2017 at 15:51, Daniel Vetter  wrote:
>
> On Mon, Oct 30, 2017 at 06:01:12PM +0530, PrasannaKumar Muralidharan wrote:
> > Hi Daniel,
> >
> > On 30 October 2017 at 15:40, Daniel Vetter  wrote:
> > > On Wed, Oct 25, 2017 at 08:44:45PM +0530, PrasannaKumar Muralidharan 
> > > wrote:
> > >> Hi All,
> > >>
> > >> On 24 October 2017 at 22:18, PrasannaKumar Muralidharan
> > >>  wrote:
> > >> > In i915 driver unload drm_vblank_get is added to test whether
> > >> > drm_vblank_cleanup refcount validation patch is working.
> > >> >
> > >> > Signed-off-by: PrasannaKumar Muralidharan 
> > >> > ---
> > >> > Changes in v2:
> > >> > Use drm_crtc_vblank_get instead of _put. In previous patch _put was 
> > >> > wrongly
> > >> > used.
> > >> >
> > >> >  drivers/gpu/drm/i915/i915_drv.c | 7 +++
> > >> >  1 file changed, 7 insertions(+)
> > >> >
> > >> > diff --git a/drivers/gpu/drm/i915/i915_drv.c 
> > >> > b/drivers/gpu/drm/i915/i915_drv.c
> > >> > index 9f45cfe..4aee1c0 100644
> > >> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > >> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > >> > @@ -1373,6 +1373,13 @@ void i915_driver_unload(struct drm_device *dev)
> > >> > struct drm_i915_private *dev_priv = to_i915(dev);
> > >> > struct pci_dev *pdev = dev_priv->drm.pdev;
> > >> >
> > >> > +   enum pipe pipe;
> > >> > +   for_each_pipe(dev_priv, pipe) {
> > >> > +   struct intel_crtc *crtc = 
> > >> > intel_get_crtc_for_pipe(dev_priv,
> > >> > + 
> > >> > pipe);
> > >> > +   drm_crtc_vblank_get(&crtc->base);
> > >> > +   }
> > >> > +
> > >> > i915_driver_unregister(dev_priv);
> > >> >
> > >> > if (i915_gem_suspend(dev_priv))
> > >> > --
> > >> > 2.10.0
> > >> >
> > >>
> > >> From 
> > >> https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6167/fi-ilk-650/igt@drv_module_rel...@basic-reload.html
> > >> it can be seen that this patch triggers warning when vblank->refcount
> > >> > 0 in vblank cleanup. This tests patch 1 successfully.
> > >>
> > >> I think patch 1 is good to go.
> > >
> > > Yeah it works, but we don't know whether it breaks anything yet. Can you
> > > pls resubmit just the first patch? Abusing CI was just an idea to get it
> > > fully tested, before we can merge it still needs to pass full CI. We just
> > > had an issue 2 weeks ago where CI blew up because an untested patch landed
> > > that broke every test :-/
> > > -Daniel
> > > --
> > > Daniel Vetter
> > > Software Engineer, Intel Corporation
> > > http://blog.ffwll.ch
> >
> > I have already sent that patch alone. Please look at
> > https://patchwork.freedesktop.org/patch/184866/.
>
> Seems to fail in CI:
>
> https://patchwork.freedesktop.org/series/32648/
>
> I guess you need to test this on a local box somewhere to figure out
> what's wrong.

My patch is supposed to catch problem with drivers. It warns when
vblank refcount is non-zero in drm_vblank_cleanup call. From CI log it
can be seen that warning being triggered. I feel that my patch is
exposing existing issue.

If I misinterpreted something please let me know.

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


[Intel-gfx] [PATCH 1/2] drm/i915: Introduce execlist_port_* accessors

2017-10-31 Thread Mika Kuoppala
From: Mika Kuoppala 

Instead of trusting that first available port is at index 0,
use accessor to hide this. This is a preparation for a
following patches where head can be at arbitrary location
in the port array.

v2: improved commit message, elsp_ready readability (Chris)
v3: s/execlist_port_index/execlist_port (Chris)
v4: rebase to new naming
v5: fix port_next indexing
v6: adapt to preempt

Cc: Michał Winiarski 
Cc: Joonas Lahtinen 
Cc: Chris Wilson 
Signed-off-by: Mika Kuoppala 
---
 drivers/gpu/drm/i915/i915_gpu_error.c  |  6 ++--
 drivers/gpu/drm/i915/i915_guc_submission.c | 50 ++
 drivers/gpu/drm/i915/intel_engine_cs.c | 18 ++-
 drivers/gpu/drm/i915/intel_lrc.c   | 49 ++---
 drivers/gpu/drm/i915/intel_ringbuffer.h| 44 --
 5 files changed, 119 insertions(+), 48 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
b/drivers/gpu/drm/i915/i915_gpu_error.c
index 653fb69e7ecb..6d0bdb03b3f0 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1333,11 +1333,13 @@ static void engine_record_requests(struct 
intel_engine_cs *engine,
 static void error_record_engine_execlists(struct intel_engine_cs *engine,
  struct drm_i915_error_engine *ee)
 {
-   const struct intel_engine_execlists * const execlists = 
&engine->execlists;
+   struct intel_engine_execlists * const execlists = &engine->execlists;
unsigned int n;
 
for (n = 0; n < execlists_num_ports(execlists); n++) {
-   struct drm_i915_gem_request *rq = 
port_request(&execlists->port[n]);
+   struct drm_i915_gem_request *rq;
+
+   rq = port_request(execlists_port(execlists, n));
 
if (!rq)
break;
diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c 
b/drivers/gpu/drm/i915/i915_guc_submission.c
index 3049a0781b88..4600d0878c96 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -678,16 +678,18 @@ static void i915_guc_submit(struct intel_engine_cs 
*engine)
 {
struct intel_guc *guc = &engine->i915->guc;
struct intel_engine_execlists * const execlists = &engine->execlists;
-   struct execlist_port *port = execlists->port;
unsigned int n;
 
for (n = 0; n < execlists_num_ports(execlists); n++) {
+   struct execlist_port *port;
struct drm_i915_gem_request *rq;
unsigned int count;
 
-   rq = port_unpack(&port[n], &count);
+   port = execlists_port(execlists, n);
+   rq = port_unpack(port, &count);
+
if (rq && count == 0) {
-   port_set(&port[n], port_pack(rq, ++count));
+   port_set(port, port_pack(rq, ++count));
 
flush_ggtt_writes(rq->ring->vma);
 
@@ -710,10 +712,8 @@ static void port_assign(struct execlist_port *port,
 static void i915_guc_dequeue(struct intel_engine_cs *engine)
 {
struct intel_engine_execlists * const execlists = &engine->execlists;
-   struct execlist_port *port = execlists->port;
+   struct execlist_port *port, *last_port;
struct drm_i915_gem_request *last = NULL;
-   const struct execlist_port * const last_port =
-   &execlists->port[execlists->port_mask];
bool submit = false;
struct rb_node *rb;
 
@@ -724,6 +724,9 @@ static void i915_guc_dequeue(struct intel_engine_cs *engine)
if (!rb)
goto unlock;
 
+   port = execlists_port_head(execlists);
+   last_port = execlists_port_tail(execlists);
+
if (HAS_LOGICAL_RING_PREEMPTION(engine->i915) && port_isset(port)) {
struct guc_preempt_work *preempt_work =
&engine->i915->guc.preempt_work[engine->id];
@@ -739,7 +742,7 @@ static void i915_guc_dequeue(struct intel_engine_cs *engine)
goto unlock;
}
 
-   port++;
+   port = execlists_port_next(execlists, port);
}
 
do {
@@ -756,7 +759,8 @@ static void i915_guc_dequeue(struct intel_engine_cs *engine)
 
if (submit)
port_assign(port, last);
-   port++;
+
+   port = execlists_port_next(execlists, port);
}
 
INIT_LIST_HEAD(&rq->priotree.link);
@@ -784,24 +788,32 @@ static void i915_guc_dequeue(struct intel_engine_cs 
*engine)
spin_unlock_irq(&engine->timeline->lock);
 }
 
-static void i915_guc_irq_handler(unsigned long data)
+static void guc_complete_ready_ports(struct intel_engine_execlists * const 
execlists)
 {
-   struct intel_engine_cs * const engine = (struct intel_engine_cs *)data;
-   struct intel_eng

  1   2   >