Imre Deak
380bdff2d0
drm/i915/lvds: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-13-git-send-email-imre.deak@intel.com
(cherry picked from commit ecb2448218
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:40 +02:00
Imre Deak
31feb61a68
drm/i915/hdmi: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-12-git-send-email-imre.deak@intel.com
(cherry picked from commit 5b0921748c
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:39 +02:00
Imre Deak
fe97fd7eb8
drm/i915/dsi: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-11-git-send-email-imre.deak@intel.com
(cherry picked from commit 3f3f42b887
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:39 +02:00
Imre Deak
b81b801f86
drm/i915/dp: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-10-git-send-email-imre.deak@intel.com
(cherry picked from commit 6fa9a5ecf7
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:38 +02:00
Imre Deak
02f9f5e62a
drm/i915: Ensure the HW is powered when accessing the CRC HW block
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
While at it also add the missing reference around the HW access in
i915_interrupt_info().
v2:
- update the commit message mentioning that this also fixes the
HW access in the interrupt info debugfs entry (Daniel)
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-9-git-send-email-imre.deak@intel.com
(cherry picked from commit e129649b7a
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:38 +02:00
Imre Deak
d59410219a
drm/i915/ddi: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
CC: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-8-git-send-email-imre.deak@intel.com
(cherry picked from commit e27daab497
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:37 +02:00
Imre Deak
7a6252c6bc
drm/i915/crt: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93439
CC: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-7-git-send-email-imre.deak@intel.com
(cherry picked from commit 1c8fdda1ea
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:37 +02:00
Imre Deak
5a24fab098
drm/i915: Ensure the HW is powered during HW access in assert_pipe
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-6-git-send-email-imre.deak@intel.com
(cherry picked from commit 4feed0ebfa
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:37 +02:00
Imre Deak
bacd67d6a3
drm/i915: Ensure the HW is powered when disabling VGA
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-5-git-send-email-imre.deak@intel.com
(cherry picked from commit 6392f8478e
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:36 +02:00
Imre Deak
013ef6cfc4
drm/i915/ibx: Ensure the HW is powered during PLL HW readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-4-git-send-email-imre.deak@intel.com
(cherry picked from commit 12fda3876d
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:36 +02:00
Imre Deak
9fb84d5a92
drm/i915: Ensure the HW is powered during display pipe HW readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Revieved-by: Mika Kuoppala <mika.kuoppala@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-3-git-send-email-imre.deak@intel.com
(cherry picked from commit 1729050eb4
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:35 +02:00
Imre Deak
5af9a45476
drm/i915: Add helper to get a display power ref if it was already enabled
...
We have many places in the code where we check if a given display power
domain is enabled and if so access registers backed by this power
domain. We assumed that some modeset lock will prevent the power
reference from vanishing in the middle of the HW access, but this
assumption doesn't always hold. In such cases we get either the wakeref
not held, or an unclaimed register access error message. To fix this in
a future-proof way that's independent of other locks wrap any such
access with a get_ref_if_enabled()/put_ref() pair.
Kudos to Ville and Joonas for the ideas of this new interface.
v2:
- init the power_domains ptr when declaring it everywhere (Joonas)
v3:
- don't report the device to be powered if runtime PM is disabled
CC: Mika Kuoppala <mika.kuoppala@intel.com >
CC: Chris Wilson <chris@chris-wilson.co.uk >
CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
CC: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455711462-7442-1-git-send-email-imre.deak@intel.com
(cherry picked from commit 0973128002
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-22 17:44:35 +02:00
Mika Kuoppala
1e657ad7a4
drm/i915/gen9: Write dc state debugmask bits only once
...
DMC debugmask bits should stick so no need to write them
everytime dc state is changed.
v2: Write after firmware has been successfully loaded (Ville)
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com >
Reviewed-by: Imre Deak <imre.deak@intel.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455808874-22089-5-git-send-email-mika.kuoppala@intel.com
2016-02-22 17:21:04 +02:00
Mika Kuoppala
5b076889f6
drm/i915/gen9: Extend dmc debug mask to include cores
...
Cores need to be included into the debug mask. We don't exactly
know what it does but the spec says it must be enabled. So obey.
v2: Cores should be only set for BXT (Imre, Art)
Cc: Imre Deak <imre.deak@intel.com >
Cc: Runyan, Arthur J <arthur.j.runyan@intel.com >
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com >
Reviewed-by: Imre Deak <imre.deak@intel.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455877564-5128-1-git-send-email-mika.kuoppala@intel.com
2016-02-22 17:20:28 +02:00
Mika Kuoppala
779cb5d3dd
drm/i915/gen9: Verify and enforce dc6 state writes
...
It has been observed that sometimes disabling the dc6 fails
and dc6 state pops back up, brief moment after disabling. This
has to be dmc save/restore timing issue or other bug in the
way dc states are handled.
Try to work around this issue as we don't have firmware fix
yet available. Verify that the value we wrote for the dmc sticks,
and also enforce it by rewriting it, if it didn't.
v2: Zero rereads on rewrite for extra paranoia (Imre)
Testcase: kms_flip/basic-flip-vs-dpms
References: https://bugs.freedesktop.org/show_bug.cgi?id=93768
Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Imre Deak <imre.deak@intel.com >
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com >
Reviewed-by: Imre Deak <imre.deak@intel.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455811089-27884-1-git-send-email-mika.kuoppala@intel.com
2016-02-22 17:18:47 +02:00
Patrik Jakobsson
832dba889e
drm/i915/gen9: Check for DC state mismatch
...
The DMC can incorrectly run off and allow DC states on it's own. We
don't know the root-cause for this yet but this patch makes it more
visible.
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com >
Signed-off-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455808874-22089-2-git-send-email-mika.kuoppala@intel.com
2016-02-22 17:18:21 +02:00
Paulo Zanoni
a98ee79317
drm/i915/fbc: enable FBC by default on HSW and BDW
...
These platforms should be fine now.
FBC can allow very significant power savings for screen-on idle
systems, but it is worth mentioning that a lot of people won't get
significant power savings by enabling this feature because they may
have something else preventing the system from getting into the
deepest sleep states. Examples may include a hungry wifi device or a
max_performance SATA link power management policy. You can check your
PC state residencies on the powertop "Idle stats" tab. I recommend
trying to run "sudo powertop --auto-tune" and then seeing if the
residencies improve.
Oh, and in case you - the person reading this commit message - found
this commit through git bisect, please do the following:
- Check your dmesg and see if there are error messages mentioning
underruns around the time your problem started happening.
- Download intel-gpu-tools, compile it, and run:
$ sudo ./tests/kms_frontbuffer_tracking --run-subtest '*fbc-*' 2>&1 | tee fbc.txt
Then send us the fbc.txt file, especially if you get a failure.
This will really maximize your chances of getting the bug fixed
quickly.
- Try to find a reliable way to reproduce the problem, and tell us.
- Boot with drm.debug=0xe, reproduce the problem, then send us the
dmesg file.
v2: Don't enable by default on SKL.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455655643-2535-1-git-send-email-paulo.r.zanoni@intel.com
2016-02-19 18:06:16 -02:00
Jani Nikula
0f3a93d1b0
drm/i915: drop unused i915.disable_vtd_wa module parameter
...
This is a manual revert of
commit 7a10dfa638
Author: Daniel Vetter <daniel.vetter@ffwll.ch >
Date: Tue Apr 1 09:33:47 2014 +0200
drm/i915: Add debug module option for VTd validation
as no users have appeared.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455621493-6865-2-git-send-email-jani.nikula@intel.com
2016-02-19 17:27:15 +02:00
Jani Nikula
57b63d00df
drm/i915: drop write perm from module params which don't support changing
...
We've given write permissions to dynamically change some module
parameters through /sys/module/i915/parameters although they only
support setting on module load. Fix the permissions.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455621493-6865-1-git-send-email-jani.nikula@intel.com
2016-02-19 17:26:45 +02:00
Deepak M
0aa8bdf25b
drm/i915/dsi: Using the bpp value wrt the pixel format
...
The bpp value which is used while calulating the txbyteclkhs values
should be wrt the pixel format value. Currently bpp is coming
from pipe config to calculate txbyteclkhs. Fix it in this patch.
V2: dsi_pixel_format_bpp is used to retrieve the bpp from pixel_format
[Review: Jani]
Signed-off-by: Deepak M <m.deepak@intel.com >
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohan.marimuthu@intel.com >
Signed-off-by: Ramalingam C <ramalingam.c@intel.com >
Tested-by: Mika Kahola <mika.kahola@intel.com > # BYT
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455203007-10850-1-git-send-email-ramalingam.c@intel.com
2016-02-19 14:56:05 +02:00
Uma Shankar
d6e3af5498
drm/i915/bxt: Remove DSP CLK_GATE programming for BXT
...
DSP CLK_GATE registers are specific to BYT and CHT.
Avoid programming the same for BXT platform.
v2: Rebased on latest drm nightly branch.
v3: Fixed Jani's review comments
Signed-off-by: Uma Shankar <uma.shankar@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455796166-13052-1-git-send-email-jani.nikula@intel.com
2016-02-18 19:06:32 +02:00
Imre Deak
4d80003023
drm/i915/skl: Ensure HW is powered during DDB HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Spotted-by: Mika Kuoppala <mika.kuoppala@intel.com >
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93441
CC: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455719489-3008-1-git-send-email-imre.deak@intel.com
2016-02-18 15:57:04 +02:00
Ville Syrjälä
dd75619853
drm/i915: Extract intel_encoder_has_connectors()
...
We have an open coded loop which tries to see if the encoder has any
connectors linked to it. Let's extract that to a helper similar to
intel_crtc_has_encoders().
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455737325-14777-1-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2016-02-18 15:23:24 +02:00
Maarten Lankhorst
e28661bd1a
drm/i915: Use atomic state in intel_fb_initial_config.
...
This is another step in removing legacy state.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455697119-31416-6-git-send-email-maarten.lankhorst@linux.intel.com
2016-02-18 10:41:54 +01:00
Maarten Lankhorst
7bb4afb458
drm/i915: Use correct dpms for intel_enable_crt.
...
With the conversion to atomic only on/off are still supported.
The rest is mapped to one of those, and when enable is called
DPMS_ON should be true.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455697119-31416-5-git-send-email-maarten.lankhorst@linux.intel.com
2016-02-18 10:41:51 +01:00
Maarten Lankhorst
0eadc62462
drm/i915: Use atomic state in tv load detection.
...
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455697119-31416-4-git-send-email-maarten.lankhorst@linux.intel.com
2016-02-18 10:41:49 +01:00
Maarten Lankhorst
c8ecb2f162
drm/i915: Use atomic state for load detect in crt.
...
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455697119-31416-3-git-send-email-maarten.lankhorst@linux.intel.com
2016-02-18 10:41:46 +01:00
Maarten Lankhorst
edde361711
drm/i915: Use atomic state to obtain load detection crtc, v3.
...
Instead of restoring dpms and a flag for whether a temp fb is allocated duplicate
an atomic state before the new state is committed, and commit it the old state
in intel_release_load_detect_pipe.
Changes since v1:
- Use a real atomic state. (Ville)
Changes since v2:
- Do not preserve shared_dpll any more, no need to do so. (Ville)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455697119-31416-2-git-send-email-maarten.lankhorst@linux.intel.com
2016-02-18 10:41:42 +01:00
Rodrigo Vivi
9b58e352b4
drm/i915: Enable PSR by default on Haswell and Broadwell.
...
With a reliable frontbuffer tracking and all instability corner cases
on Haswell and Broadwell solved let's re-enabled PSR by default on
these platforms.
In case a new issue is found and PSR is the main suspect, please check
if i915.enable_psr=0 really makes your problem go away. If this is the case
PSR is the culprit so after that please check if i915.enable_psr=2
or i915.enable_psr=3 solves your issue and please let us know.
There are many panels out there and not all implementations apparently
work as we would expect.
In case you needed to force it on standby or disabled or in case of any
PSR related bug please report it at bugs.freedesktop.org.
In a bugzilla entry for PSR is desirable:
- dmesg (drm.debug=0xe)
- output of /sys/kernel/debug/dri/0/i915_edp_psr_status
- Platform information. Vendor, model, id, pci id.
- Graphical environment: Gnome, KDE, openbox, etc...
- Details how to reproduce.
- Also good if you could run PSR test cases of Intel-gpu-tools
- Please mention if forcing main link standby or main link off helps you.
There are Intel-gpu-tools test cases that can be helpful to
determine if PSR is working as expected:
kms_psr_sink_crc and kms_psr_frontbuffer_tracking.
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455278893-1307-2-git-send-email-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2016-02-17 13:04:48 -08:00
Rodrigo Vivi
a38c274faa
drm/i915: Enable PSR by default on Valleyview and Cherryview.
...
With a reliable frontbuffer tracking and all instability corner cases
solved for this platform let's re-enabled PSR by default.
In case a new issue is found and PSR is the main suspect, please check
if i915.enable_psr=0 really makes your problem go away,
please report it at bugs.freedesktop.org.
In a bugzilla entry for PSR is desirable:
- dmesg (drm.debug=0xe)
- output of /sys/kernel/debug/dri/0/i915_edp_psr_status
- Platform information. Vendor, model, id, pci id.
- Graphical environment: Gnome, KDE, openbox, etc...
- Details how to reproduce.
- Also good if you could run PSR test cases of Intel-gpu-tools
- Please mention if forcing main link standby or main link off helps you.
There are Intel-gpu-tools test cases that can be helpful to
determine if PSR is working as expected:
kms_psr_sink_crc and kms_psr_frontbuffer_tracking.
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2016-02-17 13:04:40 -08:00
Rodrigo Vivi
d94d6e8713
drm/i915: Change i915.enable_psr parameter to use per platform default.
...
This will give us flexibility to enable PSR by default independently so
issues and corner cases in one platform won't affect others were we have
it working properly.
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2016-02-17 13:04:04 -08:00
Alan
69603dbb31
i915: cast before shifting in i915_pte_count
...
Otherwise a pde_shift big enough to overflow a u32 will be truncated before
assignment
Note: We never asked for ranges spanning a 4G boundary, so this issue
doesn't cause a real problem.
Signed-off-by: Alan Cox <alan@linux.intel.com >
[danvet: Add note why this isn't a real problem.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/20160217142043.4947.60447.stgit@localhost.localdomain
2016-02-17 17:00:38 +01:00
Imre Deak
ecb2448218
drm/i915/lvds: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-13-git-send-email-imre.deak@intel.com
2016-02-17 16:17:35 +02:00
Imre Deak
5b0921748c
drm/i915/hdmi: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-12-git-send-email-imre.deak@intel.com
2016-02-17 16:17:34 +02:00
Imre Deak
3f3f42b887
drm/i915/dsi: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-11-git-send-email-imre.deak@intel.com
2016-02-17 16:17:34 +02:00
Imre Deak
6fa9a5ecf7
drm/i915/dp: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-10-git-send-email-imre.deak@intel.com
2016-02-17 16:17:34 +02:00
Imre Deak
e129649b7a
drm/i915: Ensure the HW is powered when accessing the CRC HW block
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
While at it also add the missing reference around the HW access in
i915_interrupt_info().
v2:
- update the commit message mentioning that this also fixes the
HW access in the interrupt info debugfs entry (Daniel)
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-9-git-send-email-imre.deak@intel.com
2016-02-17 16:17:33 +02:00
Imre Deak
e27daab497
drm/i915/ddi: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
CC: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-8-git-send-email-imre.deak@intel.com
2016-02-17 16:17:14 +02:00
Imre Deak
1c8fdda1ea
drm/i915/crt: Ensure the HW is powered during HW state readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93439
CC: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-7-git-send-email-imre.deak@intel.com
2016-02-17 16:09:56 +02:00
Imre Deak
4feed0ebfa
drm/i915: Ensure the HW is powered during HW access in assert_pipe
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-6-git-send-email-imre.deak@intel.com
2016-02-17 16:09:38 +02:00
Imre Deak
6392f8478e
drm/i915: Ensure the HW is powered when disabling VGA
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-5-git-send-email-imre.deak@intel.com
2016-02-17 16:09:30 +02:00
Imre Deak
12fda3876d
drm/i915/ibx: Ensure the HW is powered during PLL HW readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-4-git-send-email-imre.deak@intel.com
2016-02-17 16:08:27 +02:00
Imre Deak
1729050eb4
drm/i915: Ensure the HW is powered during display pipe HW readout
...
The assumption when adding the intel_display_power_is_enabled() checks
was that if it returns success the power can't be turned off afterwards
during the HW access, which is guaranteed by modeset locks. This isn't
always true, so make sure we hold a dedicated reference for the time of
the access.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Revieved-by: Mika Kuoppala <mika.kuoppala@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455296121-4742-3-git-send-email-imre.deak@intel.com
2016-02-17 16:08:16 +02:00
Imre Deak
0973128002
drm/i915: Add helper to get a display power ref if it was already enabled
...
We have many places in the code where we check if a given display power
domain is enabled and if so access registers backed by this power
domain. We assumed that some modeset lock will prevent the power
reference from vanishing in the middle of the HW access, but this
assumption doesn't always hold. In such cases we get either the wakeref
not held, or an unclaimed register access error message. To fix this in
a future-proof way that's independent of other locks wrap any such
access with a get_ref_if_enabled()/put_ref() pair.
Kudos to Ville and Joonas for the ideas of this new interface.
v2:
- init the power_domains ptr when declaring it everywhere (Joonas)
v3:
- don't report the device to be powered if runtime PM is disabled
CC: Mika Kuoppala <mika.kuoppala@intel.com >
CC: Chris Wilson <chris@chris-wilson.co.uk >
CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
CC: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455711462-7442-1-git-send-email-imre.deak@intel.com
2016-02-17 16:07:17 +02:00
Chris Wilson
755412e29c
drm/i915: Add an optional selection from i915 of CONFIG_MMU_NOTIFIER
...
userptr requires mmu-notifier for full unprivileged support. Most
systems have mmu-notifier support already enabled as a requirement for
virtualisation support, but we should make the option for i915 to take
advantage of mmu-notifiers explicit (and enable by default so that
regular userspace can take advantage of passing client memory to the
GPU.)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1452503961-14837-3-git-send-email-chris@chris-wilson.co.uk
2016-02-17 13:58:46 +01:00
Ville Syrjälä
8d409cb3e8
drm/i915: Fix hpd live status bits for g4x
...
Looks like g4x hpd live status bits actually agree with the spec. At
least they do on the machine I have, and apparently on Nick Bowler's
g4x as well.
So gm45 may be the only platform where they don't agree. At least
that seems to be the case based on the (somewhat incomplete)
logs/dumps in [1], and Daniel has also tested this on his gm45
sometime in the past.
So let's change the bits to match the spec on g4x. That actually makes
the g4x bits identical to vlv/chv so we can just share the code
between those platforms, leaving gm45 as the special case.
[1] https://bugzilla.kernel.org/show_bug.cgi?id=52361
Cc: Shashank Sharma <shashank.sharma@intel.com >
Cc: Sonika Jindal <sonika.jindal@intel.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Nick Bowler <nbowler@draconx.ca >
References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html
Reported-by: Nick Bowler <nbowler@draconx.ca >
Cc: stable@vger.kernel.org
Fixes: 237ed86c69
("drm/i915: Check live status before reading edid")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455127145-20087-1-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
(cherry picked from commit 0780cd36c7
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2016-02-17 11:52:54 +02:00
Maarten Lankhorst
ea49c9acf2
drm/i915: Lock mode_config.mutex in intel_display_resume.
...
Unfortunately i915 is still not fully atomic, and expects mode_config.mutex
to be held during modeset until we finally fix it.
This fixes the following WARN when resuming:
[ 425.208983] ------------[ cut here ]------------
[ 425.208990] WARNING: CPU: 0 PID: 6828 at drivers/gpu/drm/drm_edid.c:3555 drm_select_eld+0xa5/0xd0()
[ 425.209015] Modules linked in: pl2303 usbserial snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic intel_powerclamp coretemp i915 crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_intel snd_hda_codec snd_hwdep lpc_ich snd_hda_core snd_pcm i2c_hid i2c_designware_platform i2c_designware_core r8169 mii sdhci_acpi sdhci mmc_core
[ 425.209018] CPU: 0 PID: 6828 Comm: kworker/u4:5 Tainted: G U W 4.5.0-rc4-gfxbench+ #1
[ 425.209020] Hardware name: \xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff \xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff/DN2820FYK, BIOS FYBYT10H.86A.0038.2014.0717.1455 07/17/2014
[ 425.209027] Workqueue: events_unbound async_run_entry_fn
[ 425.209032] 0000000000000000 ffff880072433958 ffffffff813f6b05 0000000000000000
[ 425.209036] ffffffff81aaef2d ffff880072433990 ffffffff81078291 ffff880036b933d8
[ 425.209039] ffff88006d528000 ffff88006d52b3d8 ffff88006d52b3d8 ffff88007315b6f8
[ 425.209040] Call Trace:
[ 425.209045] [<ffffffff813f6b05>] dump_stack+0x67/0x92
[ 425.209049] [<ffffffff81078291>] warn_slowpath_common+0x81/0xc0
[ 425.209052] [<ffffffff81078385>] warn_slowpath_null+0x15/0x20
[ 425.209054] [<ffffffff8151e195>] drm_select_eld+0xa5/0xd0
[ 425.209101] [<ffffffffa01f34f4>] intel_audio_codec_enable+0x44/0x160 [i915]
[ 425.209135] [<ffffffffa023eac7>] intel_enable_hdmi_audio+0x87/0x90 [i915]
[ 425.209169] [<ffffffffa023eb5a>] g4x_enable_hdmi+0x8a/0xa0 [i915]
[ 425.209202] [<ffffffffa023f41b>] vlv_hdmi_pre_enable+0x1cb/0x240 [i915]
[ 425.209236] [<ffffffffa020edcf>] valleyview_crtc_enable+0x10f/0x290 [i915]
[ 425.209270] [<ffffffffa020ba49>] intel_atomic_commit+0x769/0x17a0 [i915]
[ 425.209274] [<ffffffff81526ad5>] ? drm_atomic_check_only+0x145/0x660
[ 425.209276] [<ffffffff81527022>] drm_atomic_commit+0x32/0x50
[ 425.209310] [<ffffffffa0215fa0>] intel_display_resume+0xa0/0x130 [i915]
[ 425.209338] [<ffffffffa018c1bb>] i915_drm_resume+0xcb/0x160 [i915]
[ 425.209366] [<ffffffffa018c272>] i915_pm_resume+0x22/0x30 [i915]
[ 425.209370] [<ffffffff8143d91e>] pci_pm_resume+0x6e/0xe0
[ 425.209373] [<ffffffff8143d8b0>] ? pci_pm_resume_noirq+0xa0/0xa0
[ 425.209375] [<ffffffff815409ae>] dpm_run_callback+0x6e/0x280
[ 425.209378] [<ffffffff815410b2>] device_resume+0x92/0x250
[ 425.209380] [<ffffffff81541288>] async_resume+0x18/0x40
[ 425.209382] [<ffffffff8109c7a5>] async_run_entry_fn+0x45/0x140
[ 425.209386] [<ffffffff81093293>] process_one_work+0x1e3/0x620
[ 425.209388] [<ffffffff810931f7>] ? process_one_work+0x147/0x620
[ 425.209391] [<ffffffff81093719>] worker_thread+0x49/0x490
[ 425.209393] [<ffffffff810936d0>] ? process_one_work+0x620/0x620
[ 425.209396] [<ffffffff81099e0a>] kthread+0xea/0x100
[ 425.209400] [<ffffffff81099d20>] ? kthread_create_on_node+0x1f0/0x1f0
[ 425.209404] [<ffffffff817ba03f>] ret_from_fork+0x3f/0x70
[ 425.209407] [<ffffffff81099d20>] ? kthread_create_on_node+0x1f0/0x1f0
[ 425.209409] ---[ end trace d1b247107f34a8b2 ]---
Fixes: e2c8b8701e
("drm/i915: Use atomic helpers for suspend, v2.")
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455632862-18557-1-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2016-02-16 18:50:38 +01:00
Maarten Lankhorst
e8788cbc32
drm/i915: Fix some minor issues with atomic cdclk.
...
The check for active_crtcs == 0 was performed by the callers, when changing
the patches I forgot to remove those hunks.
This resulted in skylake scalers still not having the correct cdclk to
calculate scaling when all crtc's were dpms off.
Fixes: 1a617b7765
("drm/i915: Keep track of the cdclk as if all crtc's were active.")
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1455614711-9045-1-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
2016-02-16 11:25:09 +01:00
Maarten Lankhorst
e2c8b8701e
drm/i915: Use atomic helpers for suspend, v2.
...
Instead of duplicating the functionality now that we no longer need
to preserve dpll state we can move to using the upstream suspend helper.
Changes since v1:
- Call hw readout with all mutexes held.
- Rework intel_display_suspend to only assign modeset_restore_state
on success.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/56C2E686.5060803@linux.intel.com
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
2016-02-16 11:23:46 +01:00
Dave Hansen
1e9877902d
mm/gup: Introduce get_user_pages_remote()
...
For protection keys, we need to understand whether protections
should be enforced in software or not. In general, we enforce
protections when working on our own task, but not when on others.
We call these "current" and "remote" operations.
This patch introduces a new get_user_pages() variant:
get_user_pages_remote()
Which is a replacement for when get_user_pages() is called on
non-current tsk/mm.
We also introduce a new gup flag: FOLL_REMOTE which can be used
for the "__" gup variants to get this new behavior.
The uprobes is_trap_at_addr() location holds mmap_sem and
calls get_user_pages(current->mm) on an instruction address. This
makes it a pretty unique gup caller. Being an instruction access
and also really originating from the kernel (vs. the app), I opted
to consider this a 'remote' access where protection keys will not
be enforced.
Without protection keys, this patch should not change any behavior.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com >
Reviewed-by: Thomas Gleixner <tglx@linutronix.de >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@amacapital.net >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Brian Gerst <brgerst@gmail.com >
Cc: Dave Hansen <dave@sr71.net >
Cc: Denys Vlasenko <dvlasenk@redhat.com >
Cc: H. Peter Anvin <hpa@zytor.com >
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Rik van Riel <riel@redhat.com >
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com >
Cc: Vlastimil Babka <vbabka@suse.cz >
Cc: jack@suse.cz
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20160212210154.3F0E51EA@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2016-02-16 10:04:09 +01:00