Shashank Sharma
d9facae6af
drm/i915: Introduce CRTC output format
...
This patch adds an enum "intel_output_format" to represent
the output format of a particular CRTC. This enum will be
used to produce a RGB/YCBCR4:4:4/YCBCR4:2:0 output format
during the atomic modeset calculations.
V5:
- Created this separate patch to introduce and init output_format.
- Initialize parameters of output_format_str respectively (Jani N).
- Call it intel_output_format than crtc_output_format(Ville).
- Set output format in pipe_config for every encoder (Ville).
- Get rid of extra DRM_DEBUG_KMS during get_pipe_config (Ville)
V6: Rebase
V7: Fixed alignment warnings (checkpatch)
V8: Another check[atch warning for alignment
V9: Rebase
V10: Rebase on top of DSI restructure
V11: Addressed review comment from Ville
- Set CRTC format for pre-HSW get_pipe_config() function too.
Added Ville's R-B
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1539325394-20788-1-git-send-email-shashank.sharma@intel.com
2018-10-15 16:01:49 +03:00
Chris Wilson
a5e856a534
drm/i915: Large page offsets for pread/pwrite
...
Handle integer overflow when computing the sub-page length for shmem
backed pread/pwrite.
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Cc: stable@vger.kernel.org
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181012140228.29783-1-chris@chris-wilson.co.uk
2018-10-15 12:52:03 +01:00
Jyoti Yadav
27d7aaae0f
drm/i915/csr Added DC5 and DC6 counter register for ICL in debugfs entry.
...
DC5 and DC6 counter register tells about residency of DC5 and DC6.
Added the same in debugfs file.
v2 : Remove csr_version check.
Added generic check regarding DC counters for Gen9 onwards. (Rodrigo)
v3 : Simplified gen checks. (Chris)
v4 : Simplified "if" ladder for multiple gens.
v5 : Removed unnecessary comment.
Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1538762926-4880-1-git-send-email-jyoti.r.yadav@intel.com
2018-10-12 15:44:32 -07:00
Paulo Zanoni
b9117149fe
drm/i915: promote ddb update message to DRM_DEBUG_KMS
...
This message is currently marked as DRM_DEBUG_ATOMIC. I would like it
to be DRM_DEBUG_KMS since it is more KMS than atomic, and this will
also make the message appear in the CI logs, which may or may not help
us with some FIFO underrun bugs.
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181004231600.14101-7-paulo.r.zanoni@intel.com
2018-10-11 14:23:04 -07:00
Paulo Zanoni
9e44b180f8
drm/i915: don't write PLANE_BUF_CFG twice every time
...
We were writing to PLANE_BUF_CFG(pipe, plane_id) twice for every
platform, and we were even using different values on the gen10- planar
case. The first write is useless since it just gets replaced with the
next one, so kill it.
There's a lot to improve in the DDB code, but let's start by avoiding
the double write.
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181004231600.14101-6-paulo.r.zanoni@intel.com
2018-10-11 14:23:04 -07:00
Paulo Zanoni
cbacc79db6
drm/i915: transition WMs ask for Selected Result Blocks
...
The transition watermarks ask for Selected Result Blocks (the real
value), not Result Blocks (the integer value). Given how ceilings are
applied in both the non-transition and the transition watermarks
calculations, we can get away with assuming that Selected Result
Blocks is actually Result Blocks minus 1 without any rounding errors.
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181004231600.14101-5-paulo.r.zanoni@intel.com
2018-10-11 14:23:04 -07:00
Paulo Zanoni
077b5820af
drm/i915: fix the watermark result selection on glk/gen10+
...
On these platforms we're supposed to unconditonally pick the method 2
result instead of the minimum.
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181004231600.14101-4-paulo.r.zanoni@intel.com
2018-10-11 14:23:03 -07:00
Paulo Zanoni
91961a850d
drm/i915: fix the transition minimums for gen9+ watermarks
...
The transition minimum is 14 blocks for gens 9 and 10, and 4 blocks
for gen 11. This minimum value is supposed to be added to the
configurable trans_amount. This matches both BSpec and additional
information provided by our HW engineers.
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181004231600.14101-3-paulo.r.zanoni@intel.com
2018-10-11 14:23:03 -07:00
Paulo Zanoni
ef51e0a3eb
drm/i915: DRM_FORMAT_C8 is not possible with Yf tiling
...
Function intel_framebuffer_init() checks for the possibilities during
framebuffer creation (addfb ioctl time). It is missing the fact that
the indexed format is not supported with Yf tiling.
It is worth noticing that skl_plane_format_mod_supported() correctly
handles for the C8/Yf combination, but this function runs during
modeset time, so we only reject the combination later.
Ville recently proposed a new IGT test that only uses addfb to assert
supported formats, so that IGT was failing. Add the check so we get
green squares right from the start after Ville merges his test.
Also drive-by fix the missing /* fall through */ in the chunk we
modified by just turning it into a "break;" since IMHO breaks are
easier to read than fall-throughs.
BSpec: 18565
Testcase: igt/kms_addfb_basic/expected-formats (not merged yet)
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180925001913.29460-1-paulo.r.zanoni@intel.com
2018-10-11 14:23:02 -07:00
Michal Wajdeczko
645ff9e371
drm/i915: Inject load failure inside intel_engines_init_mmio
...
We need extra load failure point to better test error path in
i915_driver_init_mmio.
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20181011130008.24640-2-michal.wajdeczko@intel.com
2018-10-11 21:06:52 +01:00
Michal Wajdeczko
c5b083a1a1
drm/i915: Fix i915_driver_init_mmio error path
...
In case of the error we missed to call i915_mmio_cleanup
that matches earlier call to i915_mmio_setup.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20181011130008.24640-1-michal.wajdeczko@intel.com
2018-10-11 21:06:42 +01:00
José Roberto de Souza
c0c46ca461
drm/i915/aml: Add new Amber Lake PCI ID
...
This new AML PCI ID uses the same gen graphics as Coffe Lake not a
Kaby Lake one like the other AMLs.
So to make it more explicit renaming INTEL_AML_GT2_IDS to
INTEL_AML_KBL_GT2_IDS and naming this id as INTEL_AML_CFL_GT2_IDS.
v2:
- missed add new AML macro to INTEL_CFL_IDS()
- added derivated platform initials to AML macros
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20180927010650.22731-1-jose.souza@intel.com
2018-10-11 10:59:34 -07:00
Kees Cook
0bb95f80a3
Makefile: Globally enable VLA warning
...
Now that Variable Length Arrays (VLAs) have been entirely removed[1]
from the kernel, enable the VLA warning globally. The only exceptions
to this are the KASan an UBSan tests which are explicitly checking that
VLAs trigger their respective tests.
[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com
Cc: Masahiro Yamada <yamada.masahiro@socionext.com >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: David Airlie <airlied@linux.ie >
Cc: linux-kbuild@vger.kernel.org
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Kees Cook <keescook@chromium.org >
2018-10-11 08:17:50 -07:00
Chris Wilson
0b4bf7ca9b
drm/i915/selftests: Disable shrinker across mmap-exhaustion
...
For mmap-exhaustion, we deliberately put the system under a large amount
of pressure to ensure that we are able to reap mmap-offsets from dead
objects. If background activity does that reaping for us, that defeats
the purpose of the test and in some cases will fail our sanity checks
(because of the fake activity we use to prevent the idle worker).
Fixes: 932cac10c8
("drm/i915/selftests: Prevent background reaping of acti
ve objects")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Cc: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181011103748.18387-1-chris@chris-wilson.co.uk
2018-10-11 16:04:09 +01:00
Chris Wilson
41c43f9e02
drm/i915: Inject a failure point when registering a connector
...
Check we can handle a late display load failure where the final act of
registering the connector fails.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Ville Syrjala <ville.syrjala@linux.intel.com >
Cc: Daniel Vetter <daniel.vetter@intel.com >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181010123833.16797-1-chris@chris-wilson.co.uk
2018-10-10 14:34:08 +01:00
Jani Nikula
1c21348d1f
drm/i915: move intel connector specific functions to intel_connector.c
...
Now that we have intel_connector.c, move the connector specific
functions from intel_display.c there. Fix a few checkpatch complaints
while at it. No functional changes.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181010075205.7713-2-jani.nikula@intel.com
2018-10-10 15:15:31 +03:00
Jani Nikula
360fa66ae8
drm/i915: rename intel_modes.c to intel_connector.c
...
The common denominator here seems to be connector more than
modes. Prepare for moving more connector functions to the same place. No
functional changes.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181010075205.7713-1-jani.nikula@intel.com
2018-10-10 15:15:10 +03:00
Jani Nikula
aee7d9bee2
drm/i915: nuke the intel_lvds_connector
...
For a while we carried lvds connector specific data in the lvds
connector, but since commit 05c72e77cc
("drm/i915: Nuke the LVDS lid
notifier") we haven't needed it. Revert back to plain intel_connector.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181009210916.19578-1-jani.nikula@intel.com
2018-10-10 14:19:48 +03:00
Chris Wilson
65404c89e9
drm/i915: Show the DPCD read error inline
...
When reporting the DPCD dump through debugfs, show the errors inline
where appropriate. If a read at one particular offset fails, report it.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106371
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181010081706.29931-1-chris@chris-wilson.co.uk
2018-10-10 11:01:57 +01:00
Manasi Navare
1e712535c5
drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode
...
This patch fixes the original commit c0cfb10d9e
("drm/i915/edp:
Do not do link training fallback or prune modes on EDP") that causes
a blank screen in case of certain eDP panels (Eg: seen on Dell XPS13 9350)
where first link training fails and a retraining is required by falling
back to lower link rate/lane count.
In case of some panels they advertise higher link rate/lane count
than whats required for supporting the panel's native mode.
But we always link train at highest link rate/lane count for eDP
and if that fails we can still fallback to lower link rate/lane count
as long as the fallback link BW still fits the native mode to avoid
pruning the panel's native mode yet retraining at fallback values
to recover from a blank screen.
v3:
* Add const for fixed_mode (Ville)
v2:
* Send uevent if link failure on eDP unconditionally
Fixes: c0cfb10d9e
("drm/i915/edp: Do not do link training fallback or prune modes on EDP")
Cc: Clinton Taylor <clinton.a.taylor@intel.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Ville Syrjala <ville.syrjala@linux.intel.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: <stable@vger.kernel.org > # v4.17+
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107489
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105338
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com >
Tested-by: Alexander Wilson <alexander.wilson@ncf.edu >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181009212804.702-1-manasi.d.navare@intel.com
2018-10-09 15:46:42 -07:00
Jani Nikula
d4b26e4f43
drm/i915: add a common connector type independent destroy hook
...
Almost all of the connector destroy functions do the same thing. The
differences are in the edid, detect_edid and panel cleanups, but those
are safely NULL when not initialized. Roll out a common connector
destroy hook.
Inspired by commit bc3213c444
("drm/i915: Drop the eDP check from
intel_dp_connector_destroy()").
Cc: Ville Syrjala <ville.syrjala@linux.intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181009141103.20387-1-jani.nikula@intel.com
2018-10-09 23:03:15 +03:00
Lyude Paul
a9f9ca33d1
drm/i915: Fix intel_dp_mst_best_encoder()
...
Currently, i915 appears to rely on blocking modesets on
no-longer-present MSTB ports by simply returning NULL for
->best_encoder(), which in turn causes any new atomic commits that don't
disable the CRTC to fail. This is wrong however, since we still want to
allow userspace to disable CRTCs on no-longer-present MSTB ports by
changing the DPMS state to off and this still requires that we retrieve
an encoder.
So, fix this by always returning a valid encoder regardless of the state
of the MST port.
Changes since v1:
- Remove mst atomic helper, since this got replaced with a much simpler
solution
Signed-off-by: Lyude Paul <lyude@redhat.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20181008232437.5571-6-lyude@redhat.com
2018-10-09 11:12:23 -04:00
Lyude Paul
f67207d78c
drm/i915: Skip vcpi allocation for MSTB ports that are gone
...
Since we need to be able to allow DPMS on->off prop changes after an MST
port has disappeared from the system, we need to be able to make sure we
can compute a config for the resulting atomic commit. Currently this is
impossible when the port has disappeared, since the VCPI slot searching
we try to do in intel_dp_mst_compute_config() will fail with -EINVAL.
Since the only commits we want to allow on no-longer-present MST ports
are ones that shut off display hardware, we already know that no VCPI
allocations are needed. So, hardcode the VCPI slot count to 0 when
intel_dp_mst_compute_config() is called on an MST port that's gone.
Changes since V4:
- Don't use mst_port_gone at all, just check whether or not the drm
connector is registered - Daniel Vetter
Signed-off-by: Lyude Paul <lyude@redhat.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20181008232437.5571-5-lyude@redhat.com
2018-10-09 11:12:23 -04:00
Lyude Paul
6ed5bb1fba
drm/i915: Don't unset intel_connector->mst_port
...
Currently we set intel_connector->mst_port to NULL to signify that the
MST port has been removed from the system so that we can prevent further
action on the port such as connector probes, mode probing, etc.
However, we're going to need access to intel_connector->mst_port in
order to fixup ->best_encoder() so that it can always return the correct
encoder for an MST port to prevent legacy DPMS prop changes from
failing. This should be safe, so instead keep intel_connector->mst_port
always set and instead just check the status of
drm_connector->regustered to signify whether or not the connector has
disappeared from the system.
Changes since v2:
- Add a comment to mst_port_gone (Jani Nikula)
- Change mst_port_gone to a u8 instead of a bool, per the kernel bot.
Apparently bool is discouraged in structs these days
Changes since v4:
- Don't use mst_port_gone at all! Just check if the connector is
registered or not - Daniel Vetter
Signed-off-by: Lyude Paul <lyude@redhat.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20181008232437.5571-4-lyude@redhat.com
2018-10-09 11:12:23 -04:00
Ville Syrjälä
bc3213c444
drm/i915: Drop the eDP check from intel_dp_connector_destroy()
...
As long as the connector was zeroed during allocation calling
intel_panel_fini() is safe even if we haven't initialized
the panel struct explicitly. So let's drop the useless eDP
check from dp connector destruction.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181008134641.24868-2-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
2018-10-09 16:35:22 +03:00
Ville Syrjälä
19dfe5726b
drm/i915: Do intel_panel_destroy_backlight() later
...
Currently we destroy the backlight during connector unregistration.
That means the final modeset performed by drm_atomic_helper_shutdown()
will leave the backlight on. We don't want that so let's just move
intel_panel_destroy_backlight() into intel_panel_fini() which gets
called during connector destuction.
We still unregister the user visible backlight device during connector
unregistration.
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181008134641.24868-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106386
2018-10-09 16:32:55 +03:00
Anuj Phogat
71ffd49cc9
drm/i915/icl:Add Wa_1606682166
...
Incorrect TDL's SSP address shift in SARB for 16:6 & 18:8 modes.
Disable the Sampler state prefetch functionality in the SARB by
programming 0xB000[30] to '1'. This is to be done at boot time
and the feature must remain disabled permanently.
Fixes flaky tex-mip-level-selection* piglit tests with Mesa i965
driver.
Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com >
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com >
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181004182939.7668-6-radhakrishna.sripada@intel.com
2018-10-09 10:02:03 +03:00
Radhakrishna Sripada
0c7d2aedf5
drm/i915/icl: Add Wa_1406609255
...
Shader feature to prefetch binding tables does not support 16:6 18:8 BTP
formats. Enabling fault handling could result in hangs with faults.
Disabling demand prefetch would disable binding table prefetch.
V2: Fix the stepping rivision to B0(Mika)
References: HSDES#1406609255, HSDES#1406573985
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com >
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181004182939.7668-5-radhakrishna.sripada@intel.com
2018-10-09 10:00:29 +03:00
Chris Wilson
f53a70bd93
drm/i915: Fixup kernel doc for param name changes
...
s/crtc/crtc_state/ for the kernel doc as well as the params.
Fixes: 65c307fd08
("drm/i915: Make shared dpll functions take crtc_state, v3.")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181008104808.17457-1-chris@chris-wilson.co.uk
2018-10-08 12:47:51 +01:00
Ville Syrjälä
881440a89a
drm/i915: Rename variables in intel_primary_plane_create()
...
Let's try to stick a common naming pattern in all the plane init funcs.
v2: Rebase due to color_encoding/range props
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-12-ville.syrjala@linux.intel.com
2018-10-08 13:56:20 +03:00
Ville Syrjälä
a86d2590ba
drm/i915: s/intel_plane/plane/ in sprite init
...
Use a more familiar naming pattern for our variables in the sprite plane
init function.
v2: Drop the redundant 'plane' from plane_formats and num_planes_formats
too
v3: Rebase due to ->max_stride() and ->check_plane() changes
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com > #v2
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-11-ville.syrjala@linux.intel.com
2018-10-08 13:55:48 +03:00
Ville Syrjälä
b7c8060075
drm/i915: Extract skl_universal_plane_init()
...
There's not much point in following the primary vs. sprite split
for the SKL+ universal plane init code. The only difference is
of our own doing in the form of the .check_plane(). Let's make
a small exception for that little detail and otherwise share
the same code to initialize all the universal planes.
Eventually we should eliminate the mess around .check_plane()
as well, but for now let's be happy with some code reduction.
v2: Remember to set up plane->has_fbc
Make skl_plane_has_ccs() static
v3: Rebase due to NV12, rename some variables
v4: Don't leave the color_encoding/range props behind
v5: Rebase dur to blend properties, skl_plane_max_stride() and
skl_plane_check()
v6: Make skl_update_plane() static
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com > #v4
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-10-ville.syrjala@linux.intel.com
2018-10-08 13:55:35 +03:00
Ville Syrjälä
c539b579b6
drm/i915: Introduce intel_plane_alloc()
...
Pull the common plane+plane_state allocation into a small helper.
Reduces the amount of boilerplate in the plane initialization
functions.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-9-ville.syrjala@linux.intel.com
2018-10-08 13:52:54 +03:00
Ville Syrjälä
2d72dc8b7c
drm/i915: Move plane_state->scaler_id initialization into intel_create_plane_state()
...
No point in having each caller of intel_create_plane_state() initialize
the scaler_id to -1. Instead just do it in intel_create_plane_state().
Previously we left scaler_id at 0 for pre-SKL platforms, but I can't
see how initializing it to -1 always would cause any harm.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-8-ville.syrjala@linux.intel.com
2018-10-08 13:52:24 +03:00
Ville Syrjälä
97ee97b978
drm/i915: Add missing pixel formats for skl+ "sprites"
...
All SKL+ universal planes support the same set of formats (with the
exception of NV12 which we don't expose yet). Make the format lists
for primary and sprites the same.
And make the format list const while at it.
v2: Deal with the "planar" format list as well
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-7-ville.syrjala@linux.intel.com
2018-10-08 13:51:59 +03:00
Ville Syrjälä
37a411e211
drm/i915: Disallow plane scaling with specific pixel formats
...
Plane scaling is not supported with specific pixel formats. Disallow
plane scaling when such a format is used. Currently the only such
pixel format we expose is C8, but in case we add more in the future
let's make it easy to deal with them.
v2: Redo due to plane_check() refactoring
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com > #v1
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-6-ville.syrjala@linux.intel.com
2018-10-08 13:51:25 +03:00
Ville Syrjälä
934882db29
drm/i915: Allow horizontal mirroring for cnl+ "sprite" planes
...
All CNL universal planes support horizontal mirroring. Currently
we expose the capability only for the primary plane. Expose it
for the overlay planes as well.
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-5-ville.syrjala@linux.intel.com
2018-10-08 13:51:05 +03:00
Ville Syrjälä
ee6e0496de
drm/i915: Don't populate plane->i9xx_plane for sprites
...
enum i9xx_plane_id namespace is not valid for any sprite plane,
so let's not even populate plane->i9xx_plane.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-4-ville.syrjala@linux.intel.com
2018-10-08 13:50:46 +03:00
Ville Syrjälä
deb196895f
drm/i915: Populate possible_crtcs for primary/cursor planes
...
We're currently not providing the possible_crtcs mask to
drm_universal_plane_init() for primary/cursor planes. While that does
work on account of drm_crtc_init_with_planes() filling those up
for us, it's inconsisten with what we're doing for sprite planes.
Let's just always pass the possible_crtcs bitmask to
drm_universal_plane_init(). This does assume that crtc->index
== pipe. But we're already making that assumption elsewhere so
it doesn't seem like a very big sin here.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-3-ville.syrjala@linux.intel.com
2018-10-08 13:50:19 +03:00
Ville Syrjälä
679bfe847b
drm/i915: Constify all plane_funcs structs
...
plane_funcs can be cosnt. Make them so.
v2: Rebase due to per-platforms plane_funcs
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-2-ville.syrjala@linux.intel.com
2018-10-08 13:50:09 +03:00
Hang Yuan
f42259ef81
drm/i915/gvt: invalidate old ggtt page when update ggtt entry
...
Previously only cancelled dma map of a ggtt page when the ggtt entry was
cleared. This patch will cancel dma map of an old ggtt page as well when
the ggtt entry is updated with new page address.
Fixes: 7598e8700e9a(drm/i915/gvt: Missed to cancel dma map for ggtt entries)
Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com >
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com >
2018-10-08 17:41:22 +08:00
José Roberto de Souza
3a465b84ea
drm/i915/psr: Remove alpm from i915_psr
...
ALPM is a requirement and we don't need to keep it's cached, what
were done in commit 97c9de66ca
("drm/i915/psr: Fix ALPM cap check for PSR2") but the alpm was not
removed from i915_psr.
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181003205031.32474-7-jose.souza@intel.com
2018-10-05 16:11:16 -07:00
José Roberto de Souza
66231d14e7
drm/i915/psr: Use WA to force HW tracking to exit PSR2
...
This WA also works fine for PSR2, triggering a selective update when
possible.
Acked-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181003205031.32474-4-jose.souza@intel.com
2018-10-05 16:11:08 -07:00
José Roberto de Souza
4755717b0c
drm/i915/psr: Remove PSR2 TODO error handling
...
We are already handling all PSR2 errors, so we can drop this TODO.
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181003205031.32474-3-jose.souza@intel.com
2018-10-05 16:11:01 -07:00
José Roberto de Souza
fc6ff9dc9e
drm/i915/psr: Make MASK_DISP_REG_WRITE reserved in PSR_MASK for ICL
...
ICL spec states that this bit is now reserved.
Bspec: 7722
v2(Dhinakaran and Jani):
- instead of remove bit in gen11 now only setting if if gen < 11
- changed commit title
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181003205031.32474-2-jose.souza@intel.com
2018-10-05 16:10:52 -07:00
José Roberto de Souza
bf80928fbf
drm/i915/psr: Share PSR and PSR2 exit mask
...
Now both PSR and PSR2 have the same exit mask, so let's share then
instead of have the same code 2 times.
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181003205031.32474-1-jose.souza@intel.com
2018-10-05 16:10:12 -07:00
Anusha Srivatsa
00e5d8b1eb
firmware/dmc/icl: Add missing MODULE_FIRMWARE() for Icelake.
...
Add missing MODULE_FIRMWARE while loading DMC ICL.
v2: Add Fixes tag. (Rodrigo)
v3: Rebase by Rodrigo after commit 7fe78985cd
("drm/i915/csr:
restructure CSR firmware definition macros")
v4: Rodrigo fixing his own mess on commit mentioning on v3
comment above.
Fixes: 4445930f1c
("firmware/dmc/icl: load v1.07 on icelake.")
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com > (v2)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181004223613.19938-1-rodrigo.vivi@intel.com
2018-10-05 14:36:29 -07:00
Rodrigo Vivi
443d5e3973
drm/i915/icl: MBUS B credit change
...
No functional change. But just a minor change to keep
up with Spec, since it has changed since commit c3cc39c539
("drm/i915/icl: program mbus during pipe enable")
The instructions previously said to program pipe's
B credit = 24 / number of pipes, which is 8 for ICL.
Now the spec gives us direct values independent of number
of pipes. Let's keep in sync.
Also just a reorder on fields to make easier to compare
against spec's sequence: A -> BW -> B.
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Mahesh Kumar <mahesh1.kumar@intel.com >
Cc: Arthur J Runyan <arthur.j.runyan@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Reviewed-by: Mahesh Kumar <mahesh1.kumar@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181004151814.6054-1-rodrigo.vivi@intel.com
2018-10-05 13:52:12 -07:00
Lee, Shawn C
dfdaa566b7
drm/i915: Apply correct ddi translation table for AML device
...
Amber Lake used the same gen graphics as Kaby Lake. Kernel driver
should configure KBL's DDI buffer setting for AML ULX as well.
So far, driver would load DDI translation table that used for
KBL H/S platform and apply it on AML devices. But AML is belong to
ULX series. This change will lead driver to apply KBL-Y's DDI table
for AML devices to avoid unexpected eDP/DP signal quality issue.
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Jose Roberto de Souza <jose.souza@intel.com >
Signed-off-by: Lee, Shawn C <shawn.c.lee@intel.com >
Reviewed-by: José Roberto de Souza <jose.souza@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1538034499-31256-2-git-send-email-shawn.c.lee@intel.com
2018-10-05 13:52:12 -07:00
Lee, Shawn C
ab2da3f8cd
drm/i915: Add new AML_ULX support list
...
According to patch "drm/i915/aml: Introducing Amber Lake platform"
(e364672477
). Add a new marco for AML ULX GT2 devices.
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Jose Roberto de Souza <jose.souza@intel.com >
Signed-off-by: Lee, Shawn C <shawn.c.lee@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1538034499-31256-1-git-send-email-shawn.c.lee@intel.com
2018-10-05 13:52:12 -07:00