Ville Syrjälä
62d75df7b0
drm/i915: Pass dev_priv to intel_init_pm()
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-27-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
bb7265197a
drm/i915: Pass dev_priv to ilk_setup_wm_latency() & co.
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-26-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
712bf36449
drm/i915: Pass dev_priv to intel_suspend_hw()
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-25-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
46f16e631a
drm/i915: Pass dev_priv to init_clock_gating
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-24-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
ffc7a76b8b
drm/i915: Pass dev_priv to single_enabled_crtc()
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-23-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
a9097be4f9
drm/i915: Pass dev_priv to rest of IS_FOO() macros for the old platforms
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-22-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
03427fcb75
drm/i915: Pass dev_priv to HAS_FW_BLC
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-20-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
ef0f5e93bd
drm/i915: Pass dev_priv to .get_fifo_size()
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-19-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
148ac1f375
drm/i915: Pass dev_priv to i915_pineview_get_mem_freq() and i915_ironlake_get_mem_freq()
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-18-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
9b1e14f4d8
drm/i915: Pass dev_priv to IS_PINEVIEW()
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-17-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
98187836fc
drm/i915: Always use intel_get_crtc_for_pipe()
...
Replace the open coded dev_priv->pipe_to_crtc_mapping[] usage with
intel_get_crtc_for_pipe().
Mostly done with coccinelle, with a few manual tweaks
@@
expression E1, E2;
@@
(
- E1->pipe_to_crtc_mapping[E2]
+ intel_get_crtc_for_pipe(E1, E2)
|
- E1->plane_to_crtc_mapping[E2]
+ intel_get_crtc_for_plane(E1, E2)
)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-12-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
b91eb5cce6
drm/i915: Pass dev_priv to intel_get_crtc_for_pipe()
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-11-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
f0ce231040
drm/i915: Pass dev_priv to g4x wm functions
...
Unify our approach to things by passing around dev_priv instead of dev.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-10-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
e2af48c66b
drm/i915: Store struct intel_crtc * in {pipe,plane}_to_crtc_mapping[]
...
A lot of users of the {pipe,plane}_to_crtc_mapping[] will end up
casting the result to intel_crtc, so let's just store the intel_crtc
pointer in the first place.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-7-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
efc2611e6e
drm/i915: Use struct intel_crtc in legacy platform wm code
...
Unify our approach to things by using intel_crtc instead of drm_crtc.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-6-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
432081bcbf
drm/i915: Pass intel_crtc to update_wm functions
...
Unify our approach to things by passing around intel_crtc instead of
drm_crtc.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-5-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Ville Syrjälä
525b9311be
drm/i915: Pass intel_crtc to intel_crtc_active()
...
Unify our approach to things by passing around intel_crtc instead of
drm_crtc.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-4-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2016-11-01 16:40:38 +02:00
Maarten Lankhorst
03af79e0b8
drm/i915/gen9+: Use the watermarks from crtc_state for everything, v2.
...
There's no need to keep a duplicate skl_pipe_wm around any more,
everything can be discovered from crtc_state, which we pass around
correctly now even in case of plane disable.
The copy in intel_crtc->wm.skl.active is equal to
crtc_state->wm.skl.optimal after the atomic commit completes.
It's useful for two-step watermark programming, but not required for
gen9+ which does it in a single step. We can pull the old allocation
from old_crtc_state.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477489299-25777-9-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
2016-11-01 14:43:58 +01:00
Maarten Lankhorst
49845a7aff
drm/i915/skl+: Clean up minimum allocations, v2.
...
Move calculating minimum allocations to a helper, which cleans up the
code some more. The cursor is still allocated in advance because it
doesn't count towards data rate and should always be reserved.
changes since v1:
- Change comment to have a extra opening line. (Matt)
- Rebase to remove unused plane->pipe == pipe, handled by the iterator
now. (Paulo)
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477489299-25777-7-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
2016-11-01 14:43:58 +01:00
Maarten Lankhorst
fefdd8104d
drm/i915/skl+: Remove minimum block allocation from crtc state.
...
This is not required any more now that we get fresh state from
drm_atomic_crtc_state_for_each_plane_state. Zero all state
in advance.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477489299-25777-6-git-send-email-maarten.lankhorst@linux.intel.com
2016-11-01 14:43:58 +01:00
Maarten Lankhorst
1e6ee54226
drm/i915/skl+: Remove data_rate from watermark struct, v2.
...
It's only used in one function, and can be calculated without caching it
in the global struct by using drm_atomic_crtc_state_for_each_plane_state.
There are loops over all planes, including planes that don't exist.
This is harmless, because data_rate will always be 0 for them and we
never program them when updating watermarks.
Changes since v1:
- Rename rate back to data_rate, and change array name to
plane_data_rate. (Matt)
- Remove whitespace. (Paulo)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477489299-25777-5-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
2016-11-01 14:43:58 +01:00
Maarten Lankhorst
7570498efb
drm/i915/gen9+: Use for_each_intel_plane_on_crtc in skl_print_wm_changes, v2.
...
Using for_each_intel_plane_on_crtc will allow us to find all allocations
that may have changed, not just the one added by the atomic state.
This will print changes to plane allocations for crtc's when some
planes are not added to the atomic state.
Changes since v1:
- Rephrase commit message. (Ville)
- Use plane->base.id and plane->name to kill off cursor special
case. (Ville)
- Add intel_crtc to prevent a line wrap. (Paulo)
- Line wrap debug messages.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/c9f7dc1a-d23a-7c16-b2b7-1c23dd07ed35@linux.intel.com
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
2016-11-01 14:43:58 +01:00
Maarten Lankhorst
220b096521
drm/i915/gen9+: Use cstate plane mask instead of crtc->state.
...
I'm planning on getting rid of all obj->state dereferences,
and replace thhem with accessor functions.
Remove this one early, they're equivalent because removed
planes are already part of the state, else they could not
have been removed.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477489299-25777-3-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
2016-11-01 14:43:58 +01:00
Maarten Lankhorst
c8fe32c135
drm/i915/skl+: Prepare for removing data rate from skl watermark state, v2.
...
Caching is not required, drm_atomic_crtc_state_for_each_plane_state can
be used to inspect the states of all planes assigned to the CRTC even
if they are not part of _state, so we can just recalculate every time.
Changes since v1:
- Remove plane->pipe checks, they're implied by the macros.
- Split unrelated changes to a separate commit.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477489299-25777-2-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
2016-11-01 14:43:58 +01:00
Chris Wilson
f0cd518206
drm/i915: Use lockless object free
...
Having moved the locked phase of freeing an object to a separate worker,
we can now declare to the core that we only need the unlocked variant of
driver->gem_free_object, and can use the simple unreference internally.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20161028125858.23563-20-chris@chris-wilson.co.uk
2016-10-28 20:53:50 +01:00
Matt Roper
2c4b49a0f7
drm/i915: Use macro in place of open-coded for_each_universal_plane loop
...
This was the only use of (misleadingly-named) intel_num_planes()
function, so we can remove it as well.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477522291-10874-3-git-send-email-matthew.d.roper@intel.com
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
2016-10-28 11:27:19 -07:00
Matt Roper
8b364b41ce
drm/i915: Rename for_each_plane -> for_each_universal_plane
...
This macro's name is a bit misleading; it doesn't actually iterate over
all planes since it omits the cursor plane. Its only uses are in gen9
code which is using it to iterate over the universal planes (which we
treat as primary+sprites); in these cases the legacy cursor registers
are programmed independently if necessary. The macro's iterator value
(0 for primary plane, spritenum+1 for each secondary plane) also isn't
meaningful outside the gen9 context where the hardware considers them to
all be "universal" planes that follow this numbering.
This is just a renaming/clarification patch with no functional change.
However it will make the subsequent patches more clear.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1477522291-10874-2-git-send-email-matthew.d.roper@intel.com
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
2016-10-28 11:26:36 -07:00
Daniel Vetter
f9bf1d97e8
Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued
...
Backmerge because Chris Wilson needs the very latest&greates of
Gustavo Padovan's sync_file work, specifically the refcounting changes
from:
commit 30cd85dd6e
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk >
Date: Wed Oct 19 15:48:32 2016 -0200
dma-buf/sync_file: hold reference to fence when creating sync_file
Also good to sync in general since git tends to get confused with the
cherry-picking going on.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
2016-10-25 08:57:53 +02:00
Dave Airlie
5481e27f6f
Merge tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel into drm-next
...
- first slice of the gvt device model (Zhenyu et al)
- compression support for gpu error states (Chris)
- sunset clause on gpu errors resulting in dmesg noise telling users
how to report them
- .rodata diet from Tvrtko
- switch over lots of macros to only take dev_priv (Tvrtko)
- underrun suppression for dp link training (Ville)
- lspcon (hmdi 2.0 on skl/bxt) support from Shashank Sharma, polish
from Jani
- gen9 wm fixes from Paulo&Lyude
- updated ddi programming for kbl (Rodrigo)
- respect alternate aux/ddc pins (from vbt) for all ddi ports (Ville)
* tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel: (227 commits)
drm/i915: Update DRIVER_DATE to 20161024
drm/i915: Stop setting SNB min-freq-table 0 on powersave setup
drm/i915/dp: add lane_count check in intel_dp_check_link_status
drm/i915: Fix whitespace issues
drm/i915: Clean up DDI DDC/AUX CH sanitation
drm/i915: Respect alternate_ddc_pin for all DDI ports
drm/i915: Respect alternate_aux_channel for all DDI ports
drm/i915/gen9: Remove WaEnableYV12BugFixInHalfSliceChicken7
drm/i915: KBL - Recommended buffer translation programming for DisplayPort
drm/i915: Move down skl/kbl ddi iboost and n_edp_entires fixup
drm/i915: Add a sunset clause to GPU hang logging
drm/i915: Stop reporting error details in dmesg as well as the error-state
drm/i915/gvt: do not ignore return value of create_scratch_page
drm/i915/gvt: fix spare warnings on odd constant _Bool cast
drm/i915/gvt: mark symbols static where possible
drm/i915/gvt: fix sparse warnings on different address spaces
drm/i915/gvt: properly access enabled intel_engine_cs
drm/i915/gvt: Remove defunct vmap_batch()
drm/i915/gvt: Use common mapping routines for shadow_bb object
drm/i915/gvt: Use common mapping routines for indirect_ctx object
...
2016-10-25 16:39:43 +10:00
Dave Airlie
61d0a04d6f
Merge tag 'topic/drm-misc-2016-10-24' of git://anongit.freedesktop.org/drm-intel into drm-next
...
First -misc pull for 4.10:
- drm_format rework from Laurent
- reservation patches from Chris that missed 4.9.
- aspect ratio support in infoframe helpers and drm mode/edid code
(Shashank Sharma)
- rotation rework from Ville (first parts at least)
- another attempt at the CRC debugfs interface from Tomeu
- piles and piles of misc patches all over
* tag 'topic/drm-misc-2016-10-24' of git://anongit.freedesktop.org/drm-intel: (55 commits)
drm: Use u64 for intermediate dotclock calculations
drm/i915: Use the per-plane rotation property
drm/omap: Use per-plane rotation property
drm/omap: Set rotation property initial value to BIT(DRM_ROTATE_0) insted of 0
drm/atmel-hlcdc: Use per-plane rotation property
drm/arm: Use per-plane rotation property
drm: Add support for optional per-plane rotation property
drm/atomic: Reject attempts to use multiple rotation angles at once
drm: Add drm_rotation_90_or_270()
dma-buf/sync_file: hold reference to fence when creating sync_file
drm/virtio: kconfig: Fixup white space.
drm/fence: release fence reference when canceling event
drm/i915: Handle early failure during intel_get_load_detect_pipe
drm/fb_cma_helper: do not free fbdev if there is none
drm: fix sparse warnings on undeclared symbols in crc debugfs
gpu: Remove depends on RESET_CONTROLLER when not a provider
i915: don't call drm_atomic_state_put on invalid pointer
drm: Don't export the drm_fb_get_bpp_depth() function
drm/arm: mali-dp: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()
drm: vmwgfx: Replace drm_fb_get_bpp_depth() with drm_format_info()
...
2016-10-25 16:35:20 +10:00
Chris Wilson
2eedfc7d58
drm/i915: Remove RPM sequence checking
...
We only used the RPM sequence checking inside the lowlevel GTT
accessors, when we had to rely on callers taking the wakeref on our
behalf. Now that we take the RPM wakeref inside the GTT management
routines themselves, we can forgo the sanitycheck of the callers.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Imre Deak <imre.deak@intel.com >
Reviewed-by: Imre Deak <imre.deak@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20161024124218.18252-4-chris@chris-wilson.co.uk
2016-10-24 13:45:37 +01:00
Chris Wilson
fbf0296c25
drm/i915: Stop setting SNB min-freq-table 0 on powersave setup
...
The min-freq-table is an array of values that match each CPU frequency to
an equivalent GPU frequency. Setting a single value of 0 on init is both
illegal (generates an error from the PCU) and nonsensical. Let's see if
we survive without that error.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: http://patchwork.freedesktop.org/patch/msgid/20161021205531.8651-1-chris@chris-wilson.co.uk
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
2016-10-22 09:36:31 +01:00
Ville Syrjälä
bd2ef25d92
drm: Add drm_rotation_90_or_270()
...
We have intel_rotation_90_or_270() in i915 to check if the rotation is
90 or 270 degrees. Similar checks are elsewhere in drm, so let's move
the helper into a central place and use it everwhere.
v2: Drop the BIT()
Convert all new intel_rotation_90_or_270() calls
Deal with superfluous code shuffling
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk > (v1)
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1474907460-10717-2-git-send-email-ville.syrjala@linux.intel.com
2016-10-21 18:21:33 +02:00
cpaul@redhat.com
45ece23016
drm/i915/gen9: Add skl_wm_level_equals()
...
Helper we're going to be using for implementing verification of the wm
levels in skl_verify_wm_level().
Signed-off-by: Lyude <cpaul@redhat.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1476480722-13015-9-git-send-email-cpaul@redhat.com
2016-10-19 18:26:14 -02:00
cpaul@redhat.com
bf9d99ad17
drm/i915/gen9: Make skl_pipe_wm_get_hw_state() reusable
...
There's not much of a reason this should have the locations to read out
the hardware state hardcoded, so allow the caller to specify the
location and add this function to intel_drv.h. As well, we're going to
need this function to be reusable for the next patch.
Changes since v1:
- Fix accidental behavior change in the code that Paulo pointed out
Signed-off-by: Lyude <cpaul@redhat.com >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1476480722-13015-8-git-send-email-cpaul@redhat.com
2016-10-19 18:25:33 -02:00
cpaul@redhat.com
413fc530c5
drm/i915/gen9: Add ddb changes to atomic debug output
...
Finally, add some debugging output for ddb changes in the atomic debug
output. This makes it a lot easier to spot bugs from incorrect ddb
allocations.
Signed-off-by: Lyude <cpaul@redhat.com >
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1476480722-13015-7-git-send-email-cpaul@redhat.com
2016-10-19 18:25:12 -02:00
cpaul@redhat.com
d8c0fafcbd
drm/i915/gen9: Get rid of redundant watermark values
...
Now that we've make skl_wm_levels make a little more sense, we can
remove all of the redundant wm information. Up until now we'd been
storing two copies of all of the skl watermarks: one being the
skl_pipe_wm structs, the other being the global wm struct in
drm_i915_private containing the raw register values. This is confusing
and problematic, since it means we're prone to accidentally letting the
two copies go out of sync. So, get rid of all of the functions
responsible for computing the register values and just use a single
helper, skl_write_wm_level(), to convert and write the new watermarks on
the fly.
Changes since v1:
- Fixup skl_write_wm_level()
- Fixup skl_wm_level_from_reg_val()
- Don't forget to copy *active to intel_crtc->wm.active.skl
Changes since v2:
- Fix usage of wrong cstate
Changes since v3 (by Paulo):
- Rebase
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com > (v2)
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Lyude <cpaul@redhat.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1476814189-6062-1-git-send-email-paulo.r.zanoni@intel.com
2016-10-19 18:24:18 -02:00
Paulo Zanoni
30d1b5fe8c
drm/i915/gen9: don't call ilk_pipe_pixel_rate() twice on the same function
...
We used to call skl_pipe_pixel_rate(), which used to be a single
one-line return, but now we're calling ilk_pipe_pixel_rate() which is
not as simple, so it's better to just call it once and store the
computed value for reuse.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1475872138-16194-2-git-send-email-paulo.r.zanoni@intel.com
2016-10-18 11:05:48 -02:00
Paulo Zanoni
cfd7e3a202
drm/i915/gen9: fix watermarks when using the pipe scaler
...
Luckily, the necessary adjustments for when we're using the scaler are
exactly the same as the ones needed on ILK+, so just reuse the
function we already have.
v2: Invert the patch order so stable backports get easier.
Cc: stable@vger.kernel.org
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1475872138-16194-1-git-send-email-paulo.r.zanoni@intel.com
2016-10-18 10:47:55 -02:00
Paulo Zanoni
c89cadd50b
drm/i915/gen9: look for adjusted_mode in the SAGV check for interlaced
...
We want to look at the mode that we're actually going to set. All the
other display checks for interlaced flags also look at adjusted_mode.
Cc: Lyude <cpaul@redhat.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Lyude <cpaul@redhat.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1476131459-23763-2-git-send-email-paulo.r.zanoni@intel.com
2016-10-18 10:41:21 -02:00
Paulo Zanoni
ee3d532fcb
drm/i915/gen9: unconditionally apply the memory bandwidth WA
...
Mahesh Kumar is already working on a proper implementation for the
workaround, but while we still don't have it, let's just
unconditionally apply the workaround for everybody and we hope we can
close all those numerous bugzilla tickets. Also, I'm not sure how easy
it will be to backport the final implementation to the stable Kernels,
and this patch here is probably easier to backport.
At the present moment I still don't have confirmation that this patch
fixes any of the bugs listed below, but we should definitely try
testing all of them again.
v2: s/intel_needs_memory_bw_wa/skl_needs_memory_bw_wa/ (Lyude).
v3: Rebase (dev -> dev_priv change on ilk_wm_max_level).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94337
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94605
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94884
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95010
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96226
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96828
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97450
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97830
Cc: stable@vger.kernel.org
Cc: Mahesh Kumar <mahesh1.kumar@intel.com >
Cc: Lyude <cpaul@redhat.com >
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Lyude <cpaul@redhat.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1476210338-9797-1-git-send-email-paulo.r.zanoni@intel.com
2016-10-18 10:40:33 -02:00
Lyude
1bab7502dd
drm/i915/gen9: Cleanup skl_pipe_wm_active_state
...
This function is a wreck, let's help it get its life back together and
cleanup all of the copy pasta here.
Signed-off-by: Lyude <cpaul@redhat.com >
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
2016-10-16 19:09:07 -04:00
Lyude
a62163e97b
drm/i915/gen9: Make skl_wm_level per-plane
...
Having skl_wm_level contain all of the watermarks for each plane is
annoying since it prevents us from having any sort of object to
represent a single watermark level, something we take advantage of in
the next commit to cut down on all of the copy paste code in here.
Changes since v1:
- Style nitpicks
- Fix accidental usage of i vs. PLANE_CURSOR
- Split out skl_pipe_wm_active_state simplification into separate patch
Signed-off-by: Lyude <cpaul@redhat.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
2016-10-16 19:08:43 -04:00
Lyude
b707aa5041
drm/i915/skl: Remove linetime from skl_wm_values
...
Next part of cleaning up the watermark code for skl. This is easy, since
it seems that we never actually needed to keep track of the linetime in
the skl_wm_values struct anyway.
Signed-off-by: Lyude <cpaul@redhat.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
2016-10-16 19:08:10 -04:00
Lyude
ce0ba283f6
drm/i915/skl: Move per-pipe ddb allocations into crtc states
...
First part of cleaning up all of the skl watermark code. This moves the
structures for storing the ddb allocations of each pipe into
intel_crtc_state, along with moving the structures for storing the
current ddb allocations active on hardware into intel_crtc.
Changes since v1:
- Don't replace alloc->start = alloc->end = 0;
Signed-off-by: Lyude <cpaul@redhat.com >
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
2016-10-16 19:07:58 -04:00
Tvrtko Ursulin
5db9401983
drm/i915: Make IS_GEN macros only take dev_priv
...
Saves 1416 bytes of .rodata strings.
v2: Add parantheses around dev_priv. (Ville Syrjala)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: David Weinehall <david.weinehall@linux.intel.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Acked-by: Jani Nikula <jani.nikula@linux.intel.com >
Acked-by: Chris Wilson <chris@chris-wilson.co.uk >
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1476352990-2504-1-git-send-email-tvrtko.ursulin@linux.intel.com
2016-10-14 12:23:22 +01:00
Tvrtko Ursulin
11a914c286
drm/i915: Make IS_VALLEYVIEW only take dev_priv
...
Saves 944 bytes of .rodata strings and 128 bytes of .text.
v2: Add parantheses around dev_priv. (Ville Syrjala)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: David Weinehall <david.weinehall@linux.intel.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Acked-by: Jani Nikula <jani.nikula@linux.intel.com >
Acked-by: Chris Wilson <chris@chris-wilson.co.uk >
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2016-10-14 12:23:19 +01:00
Tvrtko Ursulin
920a14b245
drm/i915: Make IS_CHERRYVIEW only take dev_priv
...
Saves 864 bytes of .rodata strings and ~100 of .text.
v2: Add parantheses around dev_priv. (Ville Syrjala)
v3: Rebase.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: David Weinehall <david.weinehall@linux.intel.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Acked-by: Jani Nikula <jani.nikula@linux.intel.com >
Acked-by: Chris Wilson <chris@chris-wilson.co.uk >
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2016-10-14 12:23:19 +01:00
Tvrtko Ursulin
9beb5fea04
drm/i915: Make IS_G4X only take dev_priv
...
Saves 472 bytes of .rodata strings.
v2: Add parantheses around dev_priv. (Ville Syrjala)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: David Weinehall <david.weinehall@linux.intel.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Acked-by: Jani Nikula <jani.nikula@linux.intel.com >
Acked-by: Chris Wilson <chris@chris-wilson.co.uk >
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2016-10-14 12:23:19 +01:00
Tvrtko Ursulin
8652744b64
drm/i915: Make IS_BROADWELL only take dev_priv
...
Saves 1808 bytes of .rodata strings.
v2: Add parantheses around dev_priv. (Ville Syrjala)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: David Weinehall <david.weinehall@linux.intel.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Acked-by: Jani Nikula <jani.nikula@linux.intel.com >
Acked-by: Chris Wilson <chris@chris-wilson.co.uk >
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2016-10-14 12:23:19 +01:00