]> Git Repo - linux.git/log
linux.git
21 months agoaccel/habanalabs: minimize encapsulation signal mutex lock time
Koby Elbaz [Mon, 17 Apr 2023 12:14:30 +0000 (15:14 +0300)]
accel/habanalabs: minimize encapsulation signal mutex lock time

Sync Stream Encapsulated Signal Handlers can be managed from different
contexts, and as such they are protected via a spin_lock.
However, spin_lock was unnecessarily protecting a larger code section
than really needed, covering a sleepable code section as well.
Since spin_lock disables preemption, it could lead to sleeping in
atomic context.

Signed-off-by: Koby Elbaz <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agodrm/i915: re-enable -Wunused-but-set-variable
Jani Nikula [Fri, 26 May 2023 16:38:08 +0000 (19:38 +0300)]
drm/i915: re-enable -Wunused-but-set-variable

W=1 enables -Wunused-but-set-variable. We disabled it locally in i915
Makefile as we were hitting a bunch of warnings. See commit 6a05d2900464
("drm/i915: Disable unused-but-set compiler warning").

With the issues fixed or annotated with __maybe_unused, re-enable the
warning not only in W=1 but also locally as part of i915 build.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/28ca3f95fe77ceb8aa35b87fca73f7afbc89859a.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/gvt: remove unused variable gma_bottom in command parser
Zhi Wang [Wed, 31 May 2023 02:04:11 +0000 (02:04 +0000)]
drm/i915/gvt: remove unused variable gma_bottom in command parser

Remove unused variable gma_bottom in scan_workload() and scan_wa_ctx().
commit be1da7070aea ("drm/i915/gvt: vGPU command scanner") introduces
gma_bottom in several functions to calculate the size of the command
buffer. However, some of them are set but actually unused.

When compiling the code with ccflags -Wunused-but-set-variable, gcc
throws warnings.

Remove unused variables to avoid the gcc warnings. Tested via compiling
the code with ccflags -Wunused-but-set-variable.

Fixes: be1da7070aea ("drm/i915/gvt: vGPU command scanner")
Suggested-by: Jani Nikula <[email protected]>
Cc: Zhenyu Wang <[email protected]>
Cc: [email protected]
Signed-off-by: Zhi Wang <[email protected]>
Reviewed-by: Zhenyu Wang <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/gsc: Fix error code in intel_gsc_uc_heci_cmd_submit_nonpriv()
Dan Carpenter [Tue, 6 Jun 2023 08:22:07 +0000 (11:22 +0300)]
drm/i915/gsc: Fix error code in intel_gsc_uc_heci_cmd_submit_nonpriv()

This should return negative -EAGAIN instead of positive EAGAIN.

Fixes: e5e1e6d28ebc ("drm/i915/pxp: Add MTL helpers to submit Heci-Cmd-Packet to GSC")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Alan Previn <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Signed-off-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/ZH7sr+Vs4zOQoouU@moroto
21 months agodrm/i915/display: Include of display limits doesn't need 'display/'
Matt Roper [Wed, 7 Jun 2023 15:09:46 +0000 (08:09 -0700)]
drm/i915/display: Include of display limits doesn't need 'display/'

Drop the unnecessary directory prefix.  This also makes
intel_display_device.h easier to use from the Xe driver.

Cc: Lucas De Marchi <[email protected]>
Cc: Jani Nikula <[email protected]>
Signed-off-by: Matt Roper <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agoi915/perf: Do not add ggtt offset to hw_tail
Umesh Nerlige Ramappa [Mon, 5 Jun 2023 19:39:23 +0000 (12:39 -0700)]
i915/perf: Do not add ggtt offset to hw_tail

ggtt offset for hw_tail is not required for the calculations, so drop
it.

Signed-off-by: Umesh Nerlige Ramappa <[email protected]>
Reviewed-by: Ashutosh Dixit <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agoi915/perf: Drop the aging_tail logic in perf OA
Umesh Nerlige Ramappa [Mon, 5 Jun 2023 19:39:22 +0000 (12:39 -0700)]
i915/perf: Drop the aging_tail logic in perf OA

On DG2, capturing OA reports while running heavy render workloads
sometimes results in invalid OA reports where 64-byte chunks inside
reports have stale values. Under memory pressure, high OA sampling rates
(13.3 us) and heavy render workload, occasionally, the OA HW TAIL
pointer does not progress as fast as the sampling rate. When these
glitches occur, the TAIL pointer takes approx. 200us to progress.  While
this is expected behavior from the HW perspective, invalid reports are
not expected.

In oa_buffer_check_unlocked(), when we execute the if condition, we are
updating the oa_buffer.tail to the aging tail and then setting pollin
based on this tail value, however, we do not have a chance to rewind and
validate the reports prior to setting pollin. The validation happens
in a subsequent call to oa_buffer_check_unlocked(). If a read occurs
before this validation, then we end up reading reports up until this
oa_buffer.tail value which includes invalid reports. Though found on
DG2, this affects all platforms.

The aging tail logic is no longer necessary since we are explicitly
checking for landed reports.

Start by dropping the aging tail logic.

v2:
- Drop extra blank line
- Add reason to drop aging logic (Ashutosh)
- Add bug links (Ashutosh)
- rename aged_tail to read_tail
- Squash patches 3 and 1

v3: (Ashutosh)
- Remove extra spaces
- Remove gtt_offset from the pollin calculation
- s/Bug:/Link/ in commit message (checkpatch)

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7484
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7757
Signed-off-by: Umesh Nerlige Ramappa <[email protected]>
Reviewed-by: Ashutosh Dixit <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/mtl: Add support for PM DEMAND
Mika Kahola [Tue, 6 Jun 2023 20:10:32 +0000 (23:10 +0300)]
drm/i915/mtl: Add support for PM DEMAND

MTL introduces a new way to instruct the PUnit with
power and bandwidth requirements of DE. Add the functionality
to program the registers and handle waits using interrupts.
The current wait time for timeouts is programmed for 10 msecs to
factor in the worst case scenarios. Changes made to use REG_BIT
for a register that we touched(GEN8_DE_MISC_IER _MMIO).

Wa_14016740474 is added which applies to Xe_LPD+ display

v2: checkpatch warning fixes, simplify program pmdemand part

v3: update to dbufs and pipes values to pmdemand register(stan)
    Removed the macro usage in update_pmdemand_values()

v4: move the pmdemand_pre_plane_update before cdclk update
    pmdemand_needs_update included cdclk params comparisons
    pmdemand_state NULL check (Gustavo)
    pmdemand.o in sorted order in the makefile (Jani)
    update pmdemand misc irq handler loop (Gustavo)
    active phys bitmask and programming correction (Gustavo)

v5: simplify pmdemand_state structure
    simplify methods to find active phys and max port clock
    Timeout in case of previou pmdemand task pending (Gustavo)

v6: rebasing
    updates to max_ddiclk calculations (Gustavo)
    updates to active_phys count method (Gustavo)

v7: use two separate loop to iterate throug old and new
    crtc states to calculate the active phys (Gustavo)

v8: use uniform function names (Gustavo)

v9: For phys change iterate through connectors (Imre)
    Look for change in phys for pmdemand update (Gustavo, Imre)
    Some more stlying changes (Imre)
    Update pmdemand state during HW readout/sanitize (Imre)

v10: Fix CI checkpatch warnings

v11: use correct pmdemand object pointer during hw readout,
     simplify the check for phys need update (Gustavo)

v12: Handle possible non serialize cases (Imre)
     Initialise also pmdemand params HW readout (Imre)
     Update active phys mask during sanitize calls (Imre)
     Check TC/encoder changes to limit connector update (Imre)

v13: Check display version before accessing pmdemand functions

v14: Move is_serialized to intel_global_state.c
     simplify update params and other stlying issues (Imre)

Bspec: 66451, 64636, 64602, 64603
Cc: Matt Atwood <[email protected]>
Cc: Matt Roper <[email protected]>
Cc: Lucas De Marchi <[email protected]>
Cc: Gustavo Sousa <[email protected]>
Signed-off-by: José Roberto de Souza <[email protected]>
Signed-off-by: Gustavo Sousa <[email protected]>
Signed-off-by: Mika Kahola <[email protected]>
Signed-off-by: Vinod Govindapillai <[email protected]>
Reviewed-by: Stanislav Lisovskiy <[email protected]> #v4
Acked-by: Gustavo Sousa <[email protected]> #v11
Reviewed-by: Imre Deak <[email protected]>
[RK: Fixed minor typo in one of the comments. s/qclck_gc/qclk_gv/]
Signed-off-by: Radhakrishna Sripada <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/mtl: find the best QGV point for the SAGV configuration
Vinod Govindapillai [Tue, 6 Jun 2023 09:35:08 +0000 (12:35 +0300)]
drm/i915/mtl: find the best QGV point for the SAGV configuration

From MTL onwards, we need to find the best QGV point based on
the required data rate and pass the peak BW of that point to
the punit to lock the corresponding QGV point.

v1: Fix for warning from kernel test robot

v2: No need to serialize for the peakbw change as pmdemand code
    will do that (Imre)

Bspec: 64636

Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Vinod Govindapillai <[email protected]>
Reviewed-by: Stanislav Lisovskiy <[email protected]>
Signed-off-by: Radhakrishna Sripada <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: modify max_bw to return index to intel_bw_info
Vinod Govindapillai [Tue, 6 Jun 2023 09:35:07 +0000 (12:35 +0300)]
drm/i915: modify max_bw to return index to intel_bw_info

MTL uses the peak BW of a QGV point to lock the required QGV
point instead of the QGV index. Instead of passing the deratedbw
of the selected bw_info, return the index to the selected
bw_info so that either deratedbw or peakbw can be used based on
the platform.

v2: use idx to store index returned by max_bw_index functions

v3: return UINT_MAX in icl_max_bw_index in case no match found

v3: check idx >= ARRAY_SIZE

Signed-off-by: Vinod Govindapillai <[email protected]>
Reviewed-by: Stanislav Lisovskiy <[email protected]>
Signed-off-by: Radhakrishna Sripada <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: extract intel_bw_check_qgv_points()
Vinod Govindapillai [Tue, 6 Jun 2023 09:35:06 +0000 (12:35 +0300)]
drm/i915: extract intel_bw_check_qgv_points()

Extract intel_bw_check_qgv_points() from intel_bw_atomic_check
to facilitate future platform variations in handling SAGV
configurations.

Signed-off-by: Vinod Govindapillai <[email protected]>
Reviewed-by: Stanislav Lisovskiy <[email protected]>
Signed-off-by: Radhakrishna Sripada <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: store the peak bw per QGV point
Vinod Govindapillai [Tue, 6 Jun 2023 09:35:05 +0000 (12:35 +0300)]
drm/i915: store the peak bw per QGV point

In MTL onwards, pcode locks the GV point based on the peak BW
of a QGV point. So store the peak BW of all the QGV points.

v2: use DIV_ROUND_CLOSEST() for the peakBW calculation

Bspec: 64636

Signed-off-by: Vinod Govindapillai <[email protected]>
Reviewed-by: Stanislav Lisovskiy <[email protected]>
Signed-off-by: Radhakrishna Sripada <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: update the QGV point frequency calculations
Vinod Govindapillai [Tue, 6 Jun 2023 09:35:04 +0000 (12:35 +0300)]
drm/i915: update the QGV point frequency calculations

From MTL onwwards, pcode locks the QGV point based on peak BW of
the intended QGV point passed by the driver. So the peak BW
calculation must match the value expected by the pcode. Update
the calculations as per the Bspec.

v2: use DIV_ROUND_* macro for the calculations (Ville)

v3: Use only DIV_ROUN_CLOSEST and remove divisor / 2 again

Bspec: 64636

Signed-off-by: Vinod Govindapillai <[email protected]>
Reviewed-by: Stanislav Lisovskiy <[email protected]>
Signed-off-by: Radhakrishna Sripada <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: fix the derating percentage for MTL
Vinod Govindapillai [Tue, 6 Jun 2023 09:35:03 +0000 (12:35 +0300)]
drm/i915: fix the derating percentage for MTL

Follow the values from bspec for the percentage overhead for
efficiency in MTL BW calculations.

Bspec: 64631

Signed-off-by: Vinod Govindapillai <[email protected]>
Reviewed-by: Matt Roper <[email protected]>
Signed-off-by: Radhakrishna Sripada <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/dp: Fix log level for "CDS interlane align done"
Khaled Almahallawy [Tue, 6 Jun 2023 22:44:28 +0000 (15:44 -0700)]
drm/i915/dp: Fix log level for "CDS interlane align done"

"CDS interlane align done" is a passing condition not an error.
Before adding new macros for logs it was drm_dbg_kms.

Fixes: f48eab290287 ("drm/i915/dp: Add link training debug and error printing helpers")
Cc: Imre Deak <[email protected]>
CC: Jani Nikula <[email protected]>
Signed-off-by: Khaled Almahallawy <[email protected]>
Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Imre Deak <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: Allow user to set cache at BO creation
Fei Yang [Tue, 6 Jun 2023 10:00:42 +0000 (12:00 +0200)]
drm/i915: Allow user to set cache at BO creation

To comply with the design that buffer objects shall have immutable
cache setting through out their life cycle, {set, get}_caching ioctl's
are no longer supported from MTL onward. With that change caching
policy can only be set at object creation time. The current code
applies a default (platform dependent) cache setting for all objects.
However this is not optimal for performance tuning. The patch extends
the existing gem_create uAPI to let user set PAT index for the object
at creation time.
The new extension is platform independent, so UMD's can switch to using
this extension for older platforms as well, while {set, get}_caching are
still supported on these legacy paltforms for compatibility reason.
However, since PAT index was not clearly defined for platforms prior to
GEN12 (TGL), so we are limiting this externsion to GEN12+ platforms
only. See ext_set_pat() in for the implementation details.

The documentation related to the PAT/MOCS tables is currently available
for Tiger Lake here:
https://www.intel.com/content/www/us/en/docs/graphics-for-linux/developer-reference/1-0/tiger-lake.html

The documentation for other platforms is currently being updated.

BSpec: 45101

Mesa support has been submitted in this merge request:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878

The media driver supprt has bin submitted in this merge request:
https://github.com/intel/media-driver/pull/1680

The IGT test related to this change is
igt@gem_create@create-ext-set-pat

Signed-off-by: Fei Yang <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Matt Roper <[email protected]>
Cc: Andi Shyti <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Acked-by: Jordan Justen <[email protected]>
Tested-by: Jordan Justen <[email protected]>
Acked-by: Carl Zhang <[email protected]>
Tested-by: Lihao Gu <[email protected]>
Signed-off-by: Andi Shyti <[email protected]>
Acked-by: Tvrtko Ursulin <[email protected]>
Acked-by: Slawomir Milczarek <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: annotate maybe unused but set intel_crtc_state variables
Jani Nikula [Fri, 26 May 2023 16:38:06 +0000 (19:38 +0300)]
drm/i915: annotate maybe unused but set intel_crtc_state variables

Prepare for re-enabling -Wunused-but-set-variable.

for_each_new_intel_crtc_in_state() requires passing in a struct
intel_crtc_state pointer, which it uses, but in a few places this leads
to warning about unused but set variables. Annotate them with
__maybe_unused.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/eb041f426bc3d76ef7a0ea906f99367cbf439b1a.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915: annotate maybe unused but set intel_plane_state variables
Jani Nikula [Fri, 26 May 2023 16:38:05 +0000 (19:38 +0300)]
drm/i915: annotate maybe unused but set intel_plane_state variables

Prepare for re-enabling -Wunused-but-set-variable.

for_each_new_intel_plane_in_state() requires passing in a struct
intel_plane_state pointer, which it uses, but in many places this leads
to warning about unused but set variables. Annotate them with
__maybe_unused.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/438ff3b257b7f85ecca5750ae8687336faee0a79.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/selftest: annotate maybe unused but set variable unused
Jani Nikula [Fri, 26 May 2023 16:38:04 +0000 (19:38 +0300)]
drm/i915/selftest: annotate maybe unused but set variable unused

Prepare for re-enabling -Wunused-but-set-variable.

The variable is indeed 'unused' as the name suggests, but we can't just
drop it because i915_vma_unbind_unlocked() is annotated
__must_check. Apparently the selftest does not really need to check the
value.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/e7654682f6bd6a9f6af74f4b6eb5fff7b527e412.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/gem: annotate maybe unused but set variable c
Jani Nikula [Fri, 26 May 2023 16:38:03 +0000 (19:38 +0300)]
drm/i915/gem: annotate maybe unused but set variable c

Prepare for re-enabling -Wunused-but-set-variable.

The variable 'c' appears unused, but I'm not sure what should be done
with it. Annotate it with __maybe_unused.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/9ee9e7d7a0a7ad4ff03c14e64b95d3fbcb7885a4.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/gem: drop unused but set variable unpinned
Jani Nikula [Fri, 26 May 2023 16:38:02 +0000 (19:38 +0300)]
drm/i915/gem: drop unused but set variable unpinned

Prepare for re-enabling -Wunused-but-set-variable.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/6831c21567e8e84da424f32a8b7b48932803ab7b.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/gt/uc: drop unused but set variable sseu
Jani Nikula [Fri, 26 May 2023 16:38:01 +0000 (19:38 +0300)]
drm/i915/gt/uc: drop unused but set variable sseu

Prepare for re-enabling -Wunused-but-set-variable.

Apparently sseu is leftover from commit 9a92732f040a ("drm/i915/gt: Add
general DSS steering iterator to intel_gt_mcr").

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/d542f25bffd5a50ff621bee93415a972c7768a2a.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/irq: drop unused but set variable tmp
Jani Nikula [Fri, 26 May 2023 16:38:00 +0000 (19:38 +0300)]
drm/i915/irq: drop unused but set variable tmp

Prepare for re-enabling -Wunused-but-set-variable.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/6c529e8721d56b0148a3a84fb2d396d4485e09a2.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/fb: drop unused but set variable cpp
Jani Nikula [Fri, 26 May 2023 16:37:59 +0000 (19:37 +0300)]
drm/i915/fb: drop unused but set variable cpp

Prepare for re-enabling -Wunused-but-set-variable.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/ce7a5cb06c562a3399206c521a24f5091a3e7c23.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/dpll: drop unused but set variables bestn and bestm1
Jani Nikula [Fri, 26 May 2023 16:37:58 +0000 (19:37 +0300)]
drm/i915/dpll: drop unused but set variables bestn and bestm1

Prepare for re-enabling -Wunused-but-set-variable.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/a85ccc8c0f451fcb997b4ac138dbeba2a653cebe.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/dsi: drop unused but set variable vbp
Jani Nikula [Fri, 26 May 2023 16:37:57 +0000 (19:37 +0300)]
drm/i915/dsi: drop unused but set variable vbp

Prepare for re-enabling -Wunused-but-set-variable.

The vbp is not used for anything in the readout, as we get
e.g. crtc_vtotal from BXT_MIPI_TRANS_VTOTAL.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/27efd245aa75226adcac01eff7b21781970f2736.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/dsi: drop unused but set variable data
Jani Nikula [Fri, 26 May 2023 16:37:56 +0000 (19:37 +0300)]
drm/i915/dsi: drop unused but set variable data

Prepare for re-enabling -Wunused-but-set-variable.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/a1a167a4ff18b19d10769d83670e414586c16956.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/ddi: drop unused but set variable intel_dp
Jani Nikula [Fri, 26 May 2023 16:37:55 +0000 (19:37 +0300)]
drm/i915/ddi: drop unused but set variable intel_dp

Prepare for re-enabling -Wunused-but-set-variable.

The intel_dp variable has been unused since commit ef79fafe9dae
("drm/i915: Eliminate intel_dp.regs.dp_tp_{ctl,status}").

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/66ca543b400a2048a6a84bb57a7bac8943014a96.1685119007.git.jani.nikula@intel.com
21 months agodrm/i915/plane: warn on non-zero plane offset
Jani Nikula [Fri, 26 May 2023 17:22:18 +0000 (20:22 +0300)]
drm/i915/plane: warn on non-zero plane offset

We assume the plane offset is 0. Warn if it's not. This also fixes a
warn on unused but set variable offset.

v2: initialize offset on the gen2/3 path (Ville)

Suggested-by: Ville Syrjälä <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/debugfs: stop using edid_blob_ptr
Jani Nikula [Fri, 2 Jun 2023 13:23:21 +0000 (16:23 +0300)]
drm/i915/debugfs: stop using edid_blob_ptr

Only the EDID code and sysfs should look at the EDID property. Stop
using it.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/panel: simple: add support for Rocktech RK043FN48H panel
Dario Binacchi [Wed, 7 Jun 2023 06:31:38 +0000 (08:31 +0200)]
drm/panel: simple: add support for Rocktech RK043FN48H panel

Add support for Rocktech RK043FN48H 4.3" (480x272) LCD-TFT panel.

Signed-off-by: Dario Binacchi <[email protected]>
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Reviewed-by: Jagan Teki <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodt-bindings: display: simple: add Rocktech RK043FN48H
Dario Binacchi [Wed, 7 Jun 2023 06:31:37 +0000 (08:31 +0200)]
dt-bindings: display: simple: add Rocktech RK043FN48H

Add compatible to panel-simple for Rocktech Displays Limited
RK043FN48H 4.3" 480x272 LCD-TFT panel.

Signed-off-by: Dario Binacchi <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Reviewed-by: Jagan Teki <[email protected]>
Reviewed-by: Raphael Gallais-Pou <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/guc: Remove some obsolete definitions
John Harrison [Wed, 31 May 2023 15:59:42 +0000 (08:59 -0700)]
drm/i915/guc: Remove some obsolete definitions

There were a bunch of defines and structures left over from an API
update a very long time ago. Remove them.

Signed-off-by: John Harrison <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: rename I915_PMU_MAX_GTS to I915_PMU_MAX_GT
Matt Atwood [Fri, 2 Jun 2023 23:17:54 +0000 (16:17 -0700)]
drm/i915: rename I915_PMU_MAX_GTS to I915_PMU_MAX_GT

_GTS as an abbreviation here leads to some confusion, match other
definitions and drop the s.

Cc: Matt Roper <[email protected]>
Cc: Ashutosh Dixit <[email protected]>
Cc: Andi Shyti <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: Umesh Nerlige Ramappa <[email protected]>
Signed-off-by: Matt Atwood <[email protected]>
Reviewed-by: Matt Roper <[email protected]>
Signed-off-by: Matt Roper <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: Reduce I915_MAX_GT to 2
Matt Atwood [Fri, 2 Jun 2023 23:17:53 +0000 (16:17 -0700)]
drm/i915: Reduce I915_MAX_GT to 2

According to Ashutosh there is no current or planned product in i915 for
I915_MAX_GT to be 4 anymore.

Cc: Matt Roper <[email protected]>
Cc: Ashutosh Dixit <[email protected]>
Cc: Andi Shyti <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: Umesh Nerlige Ramappa <[email protected]>
Signed-off-by: Matt Atwood <[email protected]>
Reviewed-by: Matt Roper <[email protected]>
Reviewed-by: Ashutosh Dixit <[email protected]>
Signed-off-by: Matt Roper <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/selftests: Add some missing error propagation
Tvrtko Ursulin [Mon, 5 Jun 2023 13:11:35 +0000 (14:11 +0100)]
drm/i915/selftests: Add some missing error propagation

Add some missing error propagation in live_parallel_switch.

To avoid needlessly burdening the various backport processes, note I am
not marking it as a fix against any patches and not copying stable since
it is debug/selftests only code.

Signed-off-by: Tvrtko Ursulin <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Cc: Andi Shyti <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Fixes: 50d16d44cce4 ("drm/i915/selftests: Exercise context switching in parallel")
Fixes: 6407cf533217 ("drm/i915/selftests: Stop using kthread_stop()")
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: Use the fdinfo helper
Tvrtko Ursulin [Mon, 5 Jun 2023 12:32:24 +0000 (13:32 +0100)]
drm/i915: Use the fdinfo helper

Use the common fdinfo helper for printing the basics. Remove now unused
client id allocation code.

Signed-off-by: Tvrtko Ursulin <[email protected]>
Cc: Rob Clark <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: Fix error handling if driver creation fails during probe
Matt Roper [Thu, 1 Jun 2023 17:38:04 +0000 (10:38 -0700)]
drm/i915: Fix error handling if driver creation fails during probe

If i915_driver_create() fails to create a valid 'i915' object, we
should just disable the PCI device and return immediately without trying
to call i915_probe_error() that relies on a valid i915 pointer.

Fixes: 12e6f6dc78e4 ("drm/i915/display: Handle GMD_ID identification in display code")
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Matt Roper <[email protected]>
Reviewed-by: Gustavo Sousa <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/display: Extract display init from intel_device_info_runtime_init
Matt Roper [Fri, 2 Jun 2023 18:14:50 +0000 (11:14 -0700)]
drm/i915/display: Extract display init from intel_device_info_runtime_init

Moving display-specific runtime info initialization into display/ makes
the display code more self-contained and also makes it easier to call
from the Xe driver.

v2:
 - Drop unnecessary display/ prefix from #includes.  (Jani)
 - Clear runtime info if fusing leaves no pipes remaining, the same as
   we do when fusing indicates the entire display controller is
   unavailable.  (Jani)
 - Move adjustment of DRIVER_MODESET / DRIVER_ATOMIC after call to
   intel_display_device_info_runtime_init(); HAS_DISPLAY may have
   changed to false during the runtime init.  (Jani)

Cc: Jani Nikula <[email protected]>
Signed-off-by: Matt Roper <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/huc: define HuC FW version for MTL
Daniele Ceraolo Spurio [Wed, 31 May 2023 23:54:15 +0000 (16:54 -0700)]
drm/i915/huc: define HuC FW version for MTL

Follow the same logic as DG2, so just a meu binary with no version number.

Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Cc: Alan Previn <[email protected]>
Reviewed-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/mtl/huc: Use the media gt for the HuC getparam
Daniele Ceraolo Spurio [Wed, 31 May 2023 23:54:14 +0000 (16:54 -0700)]
drm/i915/mtl/huc: Use the media gt for the HuC getparam

On MTL, for obvious reasons, HuC is only available on the media tile.
We already disable SW support for HuC on the root gt due to the
absence of VCS engines, but we also need to update the getparam to point
to the HuC struct in the media GT.

Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Cc: John Harrison <[email protected]>
Reviewed-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/mtl/huc: auth HuC via GSC
Daniele Ceraolo Spurio [Wed, 31 May 2023 23:54:13 +0000 (16:54 -0700)]
drm/i915/mtl/huc: auth HuC via GSC

The full authentication via the GSC requires an heci packet submission
to the GSC FW via the GSC CS. The GSC has new PXP command for this
(literally called NEW_HUC_AUTH).
The intel_huc_auth function is also updated to handle both authentication
types.

v2: check that the GuC auth for clear media has completed before
    proceding with the full auth

v3: use a define for the object size (Alan)

Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Cc: Alan Previn <[email protected]>
Reviewed-by: Alan Previn <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/huc: differentiate the 2 steps of the MTL HuC auth flow
Daniele Ceraolo Spurio [Wed, 31 May 2023 23:54:12 +0000 (16:54 -0700)]
drm/i915/huc: differentiate the 2 steps of the MTL HuC auth flow

Before we add the second step of the MTL HuC auth (via GSC), we need to
have the ability to differentiate between them. To do so, the huc
authentication check is duplicated for GuC and GSC auth, with
GSC-enabled binaries being considered fully authenticated only after
the GSC auth step.

To report the difference between the 2 auth steps, a new case is added
to the HuC getparam. This way, the clear media driver can start
submitting before full auth, as partial auth is enough for those
workloads.

v2: fix authentication status check for DG2

v3: add a better comment at the top of the HuC file to explain the
    different approaches to load and auth (John)

v4: update call to intel_huc_is_authenticated in the pxp code to check
for GSC authentication

v5: drop references to meu and esclamation mark in huc_auth print (John)

Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Cc: Alan Previn <[email protected]>
Cc: John Harrison <[email protected]>
Reviewed-by: Alan Previn <[email protected]> #v2
Reviewed-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/huc: Load GSC-enabled HuC via DMA xfer if the fuse says so
Daniele Ceraolo Spurio [Wed, 31 May 2023 23:54:11 +0000 (16:54 -0700)]
drm/i915/huc: Load GSC-enabled HuC via DMA xfer if the fuse says so

In the previous patch we extracted the offset of the legacy-style HuC
binary located within the GSC-enabled blob, so now we can use that to
load the HuC via DMA if the fuse is set that way.
Note that we now need to differentiate between "GSC-enabled binary" and
"loaded by GSC", so the former case has been renamed to "has GSC headers"
for clarity, while the latter is now based on the fuse instead of the
binary format. This way, all the legacy load paths are automatically
taken (including the auth by GuC) without having to implement further
code changes.

v2: s/is_meu_binary/has_gsc_headers/, clearer logs (John)

v3: split check for GSC access, better comments (John)

Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Cc: Alan Previn <[email protected]>
Cc: John Harrison <[email protected]>
Reviewed-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/huc: Parse the GSC-enabled HuC binary
Daniele Ceraolo Spurio [Wed, 31 May 2023 23:54:10 +0000 (16:54 -0700)]
drm/i915/huc: Parse the GSC-enabled HuC binary

The new binaries that support the 2-step authentication contain the
legacy-style binary, which we can use for loading the HuC via DMA. To
find out where this is located in the image, we need to parse the
manifest of the GSC-enabled HuC binary. The manifest consist of a
partition header followed by entries, one of which contains the offset
we're looking for.
Note that the DG2 GSC binary contains entries with the same names, but
it doesn't contain a full legacy binary, so we need to skip assigning
the dma offset in that case (which we can do by checking the ccs).
Also, since we're now parsing the entries, we can extract the HuC
version that way instead of using hardcoded offsets.

Note that the GSC binary uses the same structures in its binary header,
so they've been added in their own header file.

v2: fix structure names to match meu defines (s/CPT/CPD/), update commit
    message, check ccs validity, drop old version location defines.

v3: drop references to the MEU tool to reduce confusion, fix log (John)

v4: fix log for real (John)

Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Cc: Alan Previn <[email protected]>
Cc: John Harrison <[email protected]>
Reviewed-by: Alan Previn <[email protected]> #v2
Reviewed-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/uc: perma-pin firmwares
Daniele Ceraolo Spurio [Wed, 31 May 2023 23:54:09 +0000 (16:54 -0700)]
drm/i915/uc: perma-pin firmwares

Now that each FW has its own reserved area, we can keep them always
pinned and skip the pin/unpin dance on reset. This will make things
easier for the 2-step HuC authentication, which requires the FW to be
pinned in GGTT after the xfer is completed.
Since the vma is now valid for a long time and not just for the quick
pin-load-unpin dance, the name "dummy" is no longer appropriare and has
been replaced with vma_res. All the functions have also been updated to
operate on vma_res for consistency.
Given that we pin the vma behind the allocator's back (which is ok
because we do the pinning in an area that was previously reserved for
thus purpose), we do need to explicitly re-pin on resume because the
automated helper won't cover us.

v2: better comments and commit message, s/dummy/vma_res/

Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Cc: Alan Previn <[email protected]>
Cc: John Harrison <[email protected]>
Reviewed-by: John Harrison <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: No 10bit gamma on desktop gen3 parts
Ville Syrjälä [Wed, 31 May 2023 13:56:25 +0000 (16:56 +0300)]
drm/i915: No 10bit gamma on desktop gen3 parts

Apparently desktop gen3 parts don't support the
10bit gamma mode at all. Stop claiming otherwise.

As is the case with pipe A on gen3 mobile parts, the
PIPECONF gamma mode bit can be set but it has no
effect on the output.

PNV seems to be the only slight exception, but generally
the desktop PNV variant looks more like a mobile part so
this is not entirely surprising.

Fixes: 67630bacae23 ("drm/i915: Add 10bit gamma mode for gen2/3")
Signed-off-by: Ville Syrjälä <[email protected]>
Reviewed-by: Uma Shankar <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/display: Print useful information on error
Arun R Murthy [Fri, 2 Jun 2023 02:21:57 +0000 (07:51 +0530)]
drm/i915/display: Print useful information on error

For modifier not supporting async flip, print the modifier and display
version. Helps in reading the error message.

v2: Reframe the error message (Jani)

Signed-off-by: Arun R Murthy <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/bridge: imx: turn imx8{qm,qxp}-ldb into single-object modules
Masahiro Yamada [Mon, 5 Jun 2023 12:00:21 +0000 (21:00 +0900)]
drm/bridge: imx: turn imx8{qm,qxp}-ldb into single-object modules

With the previous fix, these modules are built from a single C file.

Rename the source files so they match the module names.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Liu Ying <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/bridge: imx: fix mixed module-builtin object
Masahiro Yamada [Mon, 5 Jun 2023 12:00:20 +0000 (21:00 +0900)]
drm/bridge: imx: fix mixed module-builtin object

With CONFIG_DRM_IMX8QM_LDB=m and CONFIG_DRM_IMX8QXP_LDB=y (or vice
versa), imx-ldb-helper.o is linked to a module and also to vmlinux
even though the expected CFLAGS are different between builtins and
modules.

This is the same situation as fixed by commit 637a642f5ca5 ("zstd:
Fixing mixed module-builtin objects").

Split imx-ldb-helper.c into a separate module.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Liu Ying <[email protected]>
Signed-off-by: Robert Foss <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agoaccel/habanalabs: call to HW/FW err returns 0 when no events exist
Moti Haimovski [Thu, 13 Apr 2023 10:54:40 +0000 (13:54 +0300)]
accel/habanalabs: call to HW/FW err returns 0 when no events exist

This commit modifies the call to retrieve HW or FW error events to
return success when no events are pending, as done in the calls to
other events.

Signed-off-by: Moti Haimovski <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: unsecure TPC bias registers
Ofir Bitton [Thu, 13 Apr 2023 08:22:06 +0000 (11:22 +0300)]
accel/habanalabs: unsecure TPC bias registers

User needs to be able to perform downcast / upcast of fp8_143 dtype.
Hence bias register needs to be accessed by the user.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: do soft-reset using cpucp packet
Dafna Hirschfeld [Wed, 8 Feb 2023 14:16:08 +0000 (16:16 +0200)]
accel/habanalabs: do soft-reset using cpucp packet

This is done depending on the FW version. The cpucp method is
preferable and saves scratchpads resource.

Signed-off-by: Dafna Hirschfeld <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: check fw version using sw version
Dafna Hirschfeld [Tue, 18 Apr 2023 08:39:44 +0000 (11:39 +0300)]
accel/habanalabs: check fw version using sw version

The fw inner version is less trustable, instead use the fw general
sw release version.

Signed-off-by: Dafna Hirschfeld <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: extract and save the FW's SW major/minor/sub-minor
Dafna Hirschfeld [Thu, 16 Mar 2023 08:20:44 +0000 (10:20 +0200)]
accel/habanalabs: extract and save the FW's SW major/minor/sub-minor

It is not always possible to know the FW's SW version from the inner FW
version. Therefore we should extract the general SW version in addition
to the FW version and use it in functions like
'hl_is_fw_ver_below_1_9' etc.

Signed-off-by: Dafna Hirschfeld <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: rename fw_{major/minor}_version to fw_inner_{major/minor}_ver
Dafna Hirschfeld [Sun, 2 Apr 2023 09:05:43 +0000 (12:05 +0300)]
accel/habanalabs: rename fw_{major/minor}_version to fw_inner_{major/minor}_ver

We later want to add fields for Firmware SW version. The current
extracted FW version is the inner FW versioning so the new name
is better and also better differentiate from the FW's SW version.

Signed-off-by: Dafna Hirschfeld <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: add helper to extract the FW major/minor
Dafna Hirschfeld [Wed, 22 Mar 2023 06:38:49 +0000 (08:38 +0200)]
accel/habanalabs: add helper to extract the FW major/minor

the helper is extract_u32_until_given_char and can later be used to
also get the major/minor of the sw version.

Signed-off-by: Dafna Hirschfeld <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: fix bug in free scratchpad memory
Moti Haimovski [Mon, 10 Apr 2023 06:31:16 +0000 (09:31 +0300)]
accel/habanalabs: fix bug in free scratchpad memory

This commit fixes a bug in Gaudi2 when freeing the scratchpad memory
in case software init fails.

Signed-off-by: Moti Haimovski <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: remove commented code that won't be used
Koby Elbaz [Sun, 9 Apr 2023 11:24:05 +0000 (14:24 +0300)]
accel/habanalabs: remove commented code that won't be used

Once it was decided that these security settings are to be done by FW
rather than by the driver, there's no reason to keep them in the code.

Signed-off-by: Koby Elbaz <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: allow user to modify EDMA RL register
Rakesh Ughreja [Wed, 5 Apr 2023 06:12:29 +0000 (09:12 +0300)]
accel/habanalabs: allow user to modify EDMA RL register

EDMA transpose workload requires to signal for every activation.
User FW sends all the dummy signals to RD_LBW_RATE_LIM_CFG, to save
lbw bandwidth. We need the user to be able to access that register to
configure it.

Signed-off-by: Rakesh Ughreja <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: ignore false positive razwi
Tal Cohen [Thu, 30 Mar 2023 10:38:19 +0000 (13:38 +0300)]
accel/habanalabs: ignore false positive razwi

In Gaudi2 asic, PSOC RAZWI may cause in HBW or LBW. The address that
caused the error is read from HW register and printed by the Driver.
There are cases where the Driver receives an indication on PSOC
RAZWI error but the address value is zero. In that case, the indication
is a false positive.
The Driver should not "count" a PSOC RAZWI event error when the
caused the address is zeroed.

Signed-off-by: Tal Cohen <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoaccel/habanalabs: remove variable gaudi_irq_name
Tom Rix [Tue, 11 Apr 2023 14:08:50 +0000 (10:08 -0400)]
accel/habanalabs: remove variable gaudi_irq_name

gcc with W=1 reports
drivers/accel/habanalabs/gaudi/gaudi.c:117:19: error:
  ‘gaudi_irq_name’ defined but not used [-Werror=unused-const-variable=]
  117 | static const char gaudi_irq_name[GAUDI_MSI_ENTRIES][GAUDI_MAX_STRING_LEN] = {
      |                   ^~~~~~~~~~~~~~

This variable is not used so remove it.

Signed-off-by: Tom Rix <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
21 months agoMerge drm/drm-next into drm-intel-gt-next
Tvrtko Ursulin [Mon, 5 Jun 2023 10:10:23 +0000 (11:10 +0100)]
Merge drm/drm-next into drm-intel-gt-next

For conflict avoidance we need the following commit:

  c9a9f18d3ad8 drm/i915/huc: use const struct bus_type pointers

Signed-off-by: Tvrtko Ursulin <[email protected]>
21 months agodrm/i915/mtl: Reset only one lane in case of MFD
Mika Kahola [Thu, 1 Jun 2023 10:13:14 +0000 (13:13 +0300)]
drm/i915/mtl: Reset only one lane in case of MFD

In case when only two or less transmit lanes are owned such as MFD
(DP-alt with x2 lanes) we need to reset only one data lane (lane0).
With only x2 lanes we don't need to poll for the phy current
status on both data lanes since only the owned data lane will respond.

v2: Find better naming for lanes and revise the commit message (Luca)

Reviewed-by: Arun R Murthy <[email protected]> (v1)
Signed-off-by: Mika Kahola <[email protected]>
Reviewed-by: Luca Coelho <[email protected]> (v2)
Signed-off-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/gt: Add workaround 14016712196
Tejas Upadhyay [Thu, 1 Jun 2023 11:09:59 +0000 (16:39 +0530)]
drm/i915/gt: Add workaround 14016712196

For mtl, workaround suggests that, SW insert a
dummy PIPE_CONTROL prior to PIPE_CONTROL which
contains a post sync: Timestamp or Write Immediate.

Bspec: 72197

V5:
  - Remove ret variable - Andi
V4:
  - Update commit message, avoid returing cs - Andi/Matt
V3:
  - Wrap dummy pipe control stuff in API - Andi
V2:
  - Fix  kernel test robot warnings

Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Tejas Upadhyay <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Reviewed-by: Andrzej Hajda <[email protected]>
Signed-off-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: Use 18 fast wake AUX sync len
Jouni Högander [Tue, 30 May 2023 10:16:49 +0000 (13:16 +0300)]
drm/i915: Use 18 fast wake AUX sync len

HW default for wake sync pulses is 18. 10 precharge and 8 preamble. There
is no reason to change this especially as it is causing problems with
certain eDP panels.

v3: Change "Fixes:" commit
v2: Remove "fast wake" repeat from subject

Signed-off-by: Jouni Högander <[email protected]>
Fixes: e1c71f8f9180 ("drm/i915: Fix fast wake AUX sync len")
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8475
Reviewed-by: Luca Coelho <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/virtio: Wait for each dma-fence of in-fence array individually
Dmitry Osipenko [Sun, 16 Apr 2023 11:52:36 +0000 (14:52 +0300)]
drm/virtio: Wait for each dma-fence of in-fence array individually

Use dma-fence-unwrap API for waiting each dma-fence of the in-fence array
individually. Sync file's in-fence array always has a non-matching fence
context ID, which doesn't allow to skip waiting of fences with a matching
context ID in a case of a merged sync file fence.

Suggested-by: Rob Clark <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Tested-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/virtio: Refactor and optimize job submission code path
Dmitry Osipenko [Sun, 16 Apr 2023 11:52:35 +0000 (14:52 +0300)]
drm/virtio: Refactor and optimize job submission code path

Move virtio_gpu_execbuffer_ioctl() into separate virtgpu_submit.c file,
refactoring and optimizing the code along the way to ease addition of new
features to the ioctl.

The optimization is done by using optimal ordering of the job's submission
steps, reducing code path from the start of the ioctl to the point of
pushing job to virtio queue. Job's initialization is now performed before
in-fence is awaited and out-fence setup is made after sending out job to
virtio.

Reviewed-by: Rob Clark <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Tested-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/display: Set correct voltage level for 480MHz CDCLK
Chaitanya Kumar Borah [Mon, 29 May 2023 06:07:47 +0000 (11:37 +0530)]
drm/i915/display: Set correct voltage level for 480MHz CDCLK

According to Bspec, the voltage level for 480MHz is to be set as 1
instead of 2.

BSpec: 49208

Fixes: 06f1b06dc5b7 ("drm/i915/display: Add 480 MHz CDCLK steps for RPL-U")
v2: rebase

Signed-off-by: Chaitanya Kumar Borah <[email protected]>
Reviewed-by: Mika Kahola <[email protected]>
Signed-off-by: Matt Roper <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agoMAINTAINERS: Add Carl/Pranjal as QAIC reviewers
Jeffrey Hugo [Tue, 23 May 2023 16:14:21 +0000 (10:14 -0600)]
MAINTAINERS: Add Carl/Pranjal as QAIC reviewers

Carl and Pranjal have been reviewing the QAIC patches.  List them as
reviewers so that they are copied on all developments which will make
it easier for them to continue reviewing QAIC patches.

Signed-off-by: Jeffrey Hugo <[email protected]>
Acked-by: Carl Vanderlip <[email protected]>
Acked-by: Pranjal Ramajor Asha Kanojiya <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: Flush power delayed put when connector init failed
Maarten Lankhorst [Thu, 22 Dec 2022 20:18:04 +0000 (21:18 +0100)]
drm/i915: Flush power delayed put when connector init failed

When intel_dp_init_connector fails, some power wells used in dp aux
communication may not be completely disabled yet. This may result in a
null pointer dereference when icl_aux_pw_to_phy() is called from
icl_combo_phy_aux_power_well_disable() after the encoder and connector
are already freed.

Signed-off-by: Maarten Lankhorst <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Jani Nikula <[email protected]>
Acked-by: Imre Deak <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915: Remove i915_drm_suspend_mode
Maarten Lankhorst [Mon, 29 May 2023 10:59:00 +0000 (13:59 +0300)]
drm/i915: Remove i915_drm_suspend_mode

enum i915_drm_suspend_mode suspend_mode is only used in
intel_display_power, while we only care about whether we perform a
s2idle. Remove it and use a simple bool.

v2: Rebase

Signed-off-by: Maarten Lankhorst <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]> # v1
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915_drm.h: fix a typo
Sui Jingfeng [Mon, 29 May 2023 11:29:56 +0000 (19:29 +0800)]
drm/i915_drm.h: fix a typo

 'rbiter' -> 'arbiter'

Signed-off-by: Sui Jingfeng <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agomailmap: Add missing email address
Maxime Ripard [Wed, 31 May 2023 13:37:24 +0000 (15:37 +0200)]
mailmap: Add missing email address

I've been using that email address for contributions for a while but it
seems I never added it to mailmap.

Signed-off-by: Maxime Ripard <[email protected]>
Reviewed-by: Sui Jingfeng <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/pxp: Fix size_t format specifier in gsccs_send_message()
Nathan Chancellor [Tue, 30 May 2023 18:37:56 +0000 (11:37 -0700)]
drm/i915/pxp: Fix size_t format specifier in gsccs_send_message()

When building ARCH=i386 allmodconfig, the following warning occurs:

  In file included from include/linux/device.h:15,
                   from include/linux/node.h:18,
                   from include/linux/cpu.h:17,
                   from include/linux/static_call.h:135,
                   from arch/x86/include/asm/perf_event.h:5,
                   from include/linux/perf_event.h:25,
                   from drivers/gpu/drm/i915/i915_pmu.h:11,
                   from drivers/gpu/drm/i915/gt/intel_engine_types.h:21,
                   from drivers/gpu/drm/i915/gt/intel_context_types.h:18,
                   from drivers/gpu/drm/i915/gem/i915_gem_context_types.h:20,
                   from drivers/gpu/drm/i915/i915_request.h:34,
                   from drivers/gpu/drm/i915/i915_active.h:13,
                   from drivers/gpu/drm/i915/gt/intel_context.h:13,
                   from drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:8:
  drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c: In function 'gsccs_send_message':
  include/drm/drm_print.h:456:39: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
    456 |         dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
        |                                       ^~~~~~~~
  include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
    110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
        |                              ^~~
  include/linux/dev_printk.h:146:61: note: in expansion of macro 'dev_fmt'
    146 |         dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
        |                                                             ^~~~~~~
  include/drm/drm_print.h:456:9: note: in expansion of macro 'dev_warn'
    456 |         dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
        |         ^~~~
  include/drm/drm_print.h:466:9: note: in expansion of macro '__drm_printk'
    466 |         __drm_printk((drm), warn,, fmt, ##__VA_ARGS__)
        |         ^~~~~~~~~~~~
  drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:146:17: note: in expansion of macro 'drm_warn'
    146 |                 drm_warn(&i915->drm, "caller with insufficient PXP reply size %u (%ld)\n",
        |                 ^~~~~~~~
  cc1: all warnings being treated as errors

Use the '%zu' format specifier, as the variable is a 'size_t'.

Fixes: dc9ac125d81f ("drm/i915/pxp: Add GSC-CS backend to send GSC fw messages")
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/meson: venc: include linux/bitfield.h
Arnd Bergmann [Fri, 2 Jun 2023 12:45:24 +0000 (14:45 +0200)]
drm/meson: venc: include linux/bitfield.h

Without this header, the use of FIELD_PREP() can cause a build failure:

drivers/gpu/drm/meson/meson_venc.c: In function 'meson_encl_set_gamma_table':
drivers/gpu/drm/meson/meson_venc.c:1595:24: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]

Fixes: 51fc01a03442c ("drm/meson: venc: add ENCL encoder setup for MIPI-DSI output")
Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Neil Armstrong <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/meson: Remove unneeded semicolon
Yang Li [Fri, 2 Jun 2023 09:14:16 +0000 (17:14 +0800)]
drm/meson: Remove unneeded semicolon

./drivers/gpu/drm/meson/meson_dw_mipi_dsi.c:117:2-3: Unneeded semicolon
./drivers/gpu/drm/meson/meson_dw_mipi_dsi.c:231:2-3: Unneeded semicolon

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5392
Signed-off-by: Yang Li <[email protected]>
Acked-by: Neil Armstrong <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/gt: limit lmem allocation size to succeed on SmallBars
Andrzej Hajda [Thu, 1 Jun 2023 14:44:50 +0000 (16:44 +0200)]
drm/i915/gt: limit lmem allocation size to succeed on SmallBars

In case system is short on mappable memory (256MB on SmallBar) allocation
of two 1GB buffers will fail.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8300
Signed-off-by: Andrzej Hajda <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/i915/display: switch the rest of the connectors to struct drm_edid
Jani Nikula [Tue, 30 May 2023 09:08:25 +0000 (12:08 +0300)]
drm/i915/display: switch the rest of the connectors to struct drm_edid

Convert the remaining uses of struct edid based drm_get_edid(),
drm_connector_update_edid_property() and drm_add_edid_modes() calls to
the struct drm_edid based drm_edid_read_ddc(),
drm_edid_connector_update() and drm_edid_connector_add_modes().

Reviewed-by: Ankit Nautiyal <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/b1b53bb9004adaa402e061f7df2caf0eb4723a43.1685437501.git.jani.nikula@intel.com
21 months agodrm/display/dp_mst: convert to struct drm_edid
Jani Nikula [Tue, 30 May 2023 09:08:24 +0000 (12:08 +0300)]
drm/display/dp_mst: convert to struct drm_edid

Convert the topology manager to use struct drm_edid, add
drm_dp_mst_edid_read() that returns drm_edid, and rewrite the old
drm_dp_mst_get_edid() to use it.

Note that the old drm_get_edid() ended up calling
drm_connector_update_edid_property(). This responsibility is now
deferred to drivers, which all do it anyway after calling
drm_dp_mst_edid_read() or drm_dp_mst_get_edid().

Reviewed-by: Ankit Nautiyal <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/9c32e5c241934093fc4144eed4c01155e1f03af1.1685437501.git.jani.nikula@intel.com
21 months agodrm/edid: make drm_edid_duplicate() safe to call with NULL parameter
Jani Nikula [Tue, 30 May 2023 09:08:23 +0000 (12:08 +0300)]
drm/edid: make drm_edid_duplicate() safe to call with NULL parameter

It's a bit tedious to check for NULL before calling
drm_edid_duplicate(). Make it handle NULL parameter graciously.

Reviewed-by: Ankit Nautiyal <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/1ae8923d39a5abd0260fdf7f9cc54c5e046e70d3.1685437501.git.jani.nikula@intel.com
21 months agodrm/i915/lvds: switch to drm_edid_read_switcheroo()
Jani Nikula [Tue, 30 May 2023 09:08:22 +0000 (12:08 +0300)]
drm/i915/lvds: switch to drm_edid_read_switcheroo()

Use drm_edid_read_switcheroo() to switch from struct edid to struct
drm_edid.

Reviewed-by: Lukas Wunner <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/429cd6f23366cb4cace4fa13cf92ad068aca64dd.1685437501.git.jani.nikula@intel.com
21 months agodrm/edid: add drm_edid_read_switcheroo()
Jani Nikula [Tue, 30 May 2023 09:08:21 +0000 (12:08 +0300)]
drm/edid: add drm_edid_read_switcheroo()

Add a switcheroo variant to the struct drm_edid based EDID read
functions.

Reviewed-by: Ankit Nautiyal <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/4ab5ec994670ea50f95c8079c1f1ae915940b00f.1685437501.git.jani.nikula@intel.com
21 months agodrm/i915/sdvo: stop caching has_hdmi_audio in struct intel_sdvo
Jani Nikula [Tue, 30 May 2023 09:08:20 +0000 (12:08 +0300)]
drm/i915/sdvo: stop caching has_hdmi_audio in struct intel_sdvo

Use the information stored in display info.

Reviewed-by: Ankit Nautiyal <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/1e02f2f7381dfcee6e4160a5fc17aea6ff04baf9.1685437500.git.jani.nikula@intel.com
21 months agodrm/i915/sdvo: stop caching has_hdmi_monitor in struct intel_sdvo
Jani Nikula [Tue, 30 May 2023 09:08:19 +0000 (12:08 +0300)]
drm/i915/sdvo: stop caching has_hdmi_monitor in struct intel_sdvo

Use the information stored in display info.

Reviewed-by: Ankit Nautiyal <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/3e9e1dcd554d470bdf474891a431b15e1880f9a0.1685437500.git.jani.nikula@intel.com
21 months agodrm/i915/hdmi: stop caching has_hdmi_sink in struct intel_hdmi
Jani Nikula [Tue, 30 May 2023 09:08:18 +0000 (12:08 +0300)]
drm/i915/hdmi: stop caching has_hdmi_sink in struct intel_hdmi

Use the information stored in display info.

Reviewed-by: Ankit Nautiyal <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/5cdb4731260b062c0f0ad2f8b64195c9a57bcb76.1685437500.git.jani.nikula@intel.com
21 months agodrm/i915/hdmi: stop caching has_audio in struct intel_hdmi
Jani Nikula [Tue, 30 May 2023 09:08:17 +0000 (12:08 +0300)]
drm/i915/hdmi: stop caching has_audio in struct intel_hdmi

Use the information stored in display info.

Reviewed-by: Ankit Nautiyal <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/710286536d6b07ba8aa068b65b2b2c0c7743220e.1685437500.git.jani.nikula@intel.com
21 months agodrm/i915/dp: stop caching has_hdmi_sink in struct intel_dp
Jani Nikula [Tue, 30 May 2023 09:08:16 +0000 (12:08 +0300)]
drm/i915/dp: stop caching has_hdmi_sink in struct intel_dp

Use the information stored in display info. Add intel_dp_has_hdmi_sink()
helper to access it.

v2: Rebased

Reviewed-by: Ankit Nautiyal <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/748103fda572b3552e5bbdafb300d8508d4eeaf4.1685437500.git.jani.nikula@intel.com
21 months agodrm/i915/dp: stop caching has_audio in struct intel_dp
Jani Nikula [Tue, 30 May 2023 09:08:15 +0000 (12:08 +0300)]
drm/i915/dp: stop caching has_audio in struct intel_dp

Use the information stored in display info.

Reviewed-by: Ankit Nautiyal <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/695bbe8b5ebee6e492f95a1c818da15691752dc8.1685437500.git.jani.nikula@intel.com
21 months agodrm/display/dp_mst: drop has_audio from struct drm_dp_mst_port
Jani Nikula [Tue, 30 May 2023 09:08:14 +0000 (12:08 +0300)]
drm/display/dp_mst: drop has_audio from struct drm_dp_mst_port

Caching the has_audio in struct drm_dp_mst_port seems odd, and oddly
placed. Defer audio handling to drivers, and use the info from the
connector display info. i915 was the only one using it anyway.

Reviewed-by: Ankit Nautiyal <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/7d9eefdf150870479c5797f027d4c2b0a19ff583.1685437500.git.jani.nikula@intel.com
21 months agodrm/edid: parse display info has_audio similar to is_hdmi
Jani Nikula [Tue, 30 May 2023 09:08:13 +0000 (12:08 +0300)]
drm/edid: parse display info has_audio similar to is_hdmi

Since we already iterate everything that's needed for determining audio,
reduce the need to call drm_detect_monitor_audio() by storing has_audio
to connector info.

Reviewed-by: Ankit Nautiyal <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/391a93b25c6bcbb39854aaa2813570cfb1580ed9.1685437500.git.jani.nikula@intel.com
21 months agoMerge tag 'drm-misc-next-2023-06-01' of git://anongit.freedesktop.org/drm/drm-misc...
Dave Airlie [Fri, 2 Jun 2023 03:38:48 +0000 (13:38 +1000)]
Merge tag 'drm-misc-next-2023-06-01' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for v6.5:

UAPI Changes:

Cross-subsystem Changes:

 * fbdev:
   * Add Kconfig options and initializer macros for file I/O, convert
     DRM fbdev emulation

Core Changes:

 * Unify handling of struct file_operations.show_fdinfo

 * Use .probe in all i2c code (interface cleanup)

 * TTM:
   * Remove unused code

Driver Changes:

 * amdgpu:
   * Use shared show_fdinfo code
   * Fix building without procfs

 * bridge:
   * display-conenctor: Add support for external power supply
   * samsung-dsim: Fix enabling; Support variable clocking
   * tc358767: Fixes
   * ti-sn65dsi83: Fix enabling

 * msm:
   * Use shared show_fdinfo code

 * msxfb:
   * Add support for i.MX93 LCDIF

 * panel:
   * Add support for Ampire AM-800480L1TMQW-T00H plus DT bindings
   * panel-edp: Convert .remove to return void

 * stm:
   * dsi: Use devm_ helper
   * ltdc: Fix potential invalid pointer deref

Signed-off-by: Dave Airlie <[email protected]>
From: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230601112246.GA10882@linux-uq9g
21 months agodrm/i915/gt: Fix parameter in gmch_ggtt_insert_{entries, page}()
Nathan Chancellor [Tue, 30 May 2023 18:24:39 +0000 (11:24 -0700)]
drm/i915/gt: Fix parameter in gmch_ggtt_insert_{entries, page}()

When building with clang's -Wincompatible-function-pointer-types-strict,
the following warnings occur:

  drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c:102:23: error: incompatible function pointer types assigning to 'void (*)(struct i915_address_space *, dma_addr_t, u64, unsigned int, u32)' (aka 'void (*)(struct i915_address_space *, unsigned int, unsigned long long, unsigned int, unsigned int)') from 'void (struct i915_address_space *, dma_addr_t, u64, enum i915_cache_level, u32)' (aka 'void (struct i915_address_space *, unsigned int, unsigned long long, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
          ggtt->vm.insert_page = gmch_ggtt_insert_page;
                               ^ ~~~~~~~~~~~~~~~~~~~~~
  drivers/gpu/drm/i915/gt/intel_ggtt_gmch.c:103:26: error: incompatible function pointer types assigning to 'void (*)(struct i915_address_space *, struct i915_vma_resource *, unsigned int, u32)' (aka 'void (*)(struct i915_address_space *, struct i915_vma_resource *, unsigned int, unsigned int)') from 'void (struct i915_address_space *, struct i915_vma_resource *, enum i915_cache_level, u32)' (aka 'void (struct i915_address_space *, struct i915_vma_resource *, enum i915_cache_level, unsigned int)') [-Werror, -Wincompatible-function-pointer-types-strict]
          ggtt->vm.insert_entries = gmch_ggtt_insert_entries;
                                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~
  2 errors generated.

The warning is pointing out that while 'enum i915_cache_level' and
'unsigned int' are ABI compatible, these indirect calls will fail
clang's kernel Control Flow Integrity (kCFI) checks, as the callback's
signature does not exactly match the prototype's signature.

To fix this, replace the cache_level parameter with pat_index, as was
done in other places within i915 where there is no difference between
cache_level and pat_index on certain generations.

Fixes: 9275277d5324 ("drm/i915: use pat_index instead of cache_level")
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Reviewed-by: Fei Yang <[email protected]>
Signed-off-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230530-i915-gt-cache_level-wincompatible-function-pointer-types-strict-v1-2-54501d598229@kernel.org
21 months agodrm/i915/gt: Fix second parameter type of pre-gen8 pte_encode callbacks
Nathan Chancellor [Tue, 30 May 2023 18:24:38 +0000 (11:24 -0700)]
drm/i915/gt: Fix second parameter type of pre-gen8 pte_encode callbacks

When booting a kernel compiled with CONFIG_CFI_CLANG (kCFI), there is a
CFI failure in ggtt_probe_common() when trying to call hsw_pte_encode()
via an indirect call:

  [    5.030027] CFI failure at ggtt_probe_common+0xd1/0x130 [i915] (target: hsw_pte_encode+0x0/0x30 [i915]; expected type: 0xf5c1d0fc)

With kCFI, indirect calls are validated against their expected type
versus actual type and failures occur when the two types do not match.

clang's -Wincompatible-function-pointer-types-strict can catch this at
compile time but it is not enabled for the kernel yet:

  drivers/gpu/drm/i915/gt/intel_ggtt.c:1155:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
  enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                  ggtt->vm.pte_encode = iris_pte_encode;
                                      ^ ~~~~~~~~~~~~~~~
  drivers/gpu/drm/i915/gt/intel_ggtt.c:1157:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
  enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                  ggtt->vm.pte_encode = hsw_pte_encode;
                                      ^ ~~~~~~~~~~~~~~
  drivers/gpu/drm/i915/gt/intel_ggtt.c:1159:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
  enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                  ggtt->vm.pte_encode = byt_pte_encode;
                                      ^ ~~~~~~~~~~~~~~
  drivers/gpu/drm/i915/gt/intel_ggtt.c:1161:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
  enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                  ggtt->vm.pte_encode = ivb_pte_encode;
                                      ^ ~~~~~~~~~~~~~~
  drivers/gpu/drm/i915/gt/intel_ggtt.c:1163:23: error: incompatible function pointer types assigning to 'u64 (*)(dma_addr_t, unsigned int, u32)' (aka 'unsigned long long (*)(unsigned int, unsigned int, unsigned int)') from 'u64 (dma_addr_t,
  enum i915_cache_level, u32)' (aka 'unsigned long long (unsigned int, enum i915_cache_level, unsigned int)') [-Werror,-Wincompatible-function-pointer-types-strict]
                  ggtt->vm.pte_encode = snb_pte_encode;
                                      ^ ~~~~~~~~~~~~~~
  5 errors generated.

In this case, the pre-gen8 pte_encode functions have a second parameter
type of 'enum i915_cache_level' whereas the function pointer prototype
in 'struct i915_address_space' expects a second parameter type of
'unsigned int'.

Update the second parameter of the callbacks and the comment above them
noting that these statements are still valid, which matches other
functions and files, to clear up the kCFI failures at run time.

Fixes: 9275277d5324 ("drm/i915: use pat_index instead of cache_level")
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Reviewed-by: Fei Yang <[email protected]>
Signed-off-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230530-i915-gt-cache_level-wincompatible-function-pointer-types-strict-v1-1-54501d598229@kernel.org
21 months agodrm/i915/gt: Use the correct error value when kernel_context() fails
Andi Shyti [Fri, 26 May 2023 12:41:38 +0000 (14:41 +0200)]
drm/i915/gt: Use the correct error value when kernel_context() fails

kernel_context() returns an error pointer. Use pointer-error
conversion functions to evaluate its return value, rather than
checking for a '0' return.

Fixes: eb5c10cbbc2f ("drm/i915: Remove I915_USER_PRIORITY_SHIFT")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Andi Shyti <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: <[email protected]> # v5.13+
Reviewed-by: Andrzej Hajda <[email protected]>
Acked-by: Tejas Upadhyay <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
21 months agodrm/panel: Support for Starry-ili9882t TDDI MIPI-DSI panel
Cong Yang [Thu, 25 May 2023 09:31:51 +0000 (17:31 +0800)]
drm/panel: Support for Starry-ili9882t TDDI MIPI-DSI panel

The Starry-ili9882 is a 10.51" WUXGA TFT panel. which fits in nicely with
the existing panel-boe-tv101wum-nl6 driver. From the datasheet,MIPI need
to keep the LP11 state before the lcm_reset pin is pulled high. So add
lp11_before_reset flag.

Signed-off-by: Cong Yang <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525093151.2338370-5-yangcong5@huaqin.corp-partner.google.com
21 months agodt-bindings: display: panel: Add compatible for Starry ili9882t
Cong Yang [Thu, 25 May 2023 09:31:50 +0000 (17:31 +0800)]
dt-bindings: display: panel: Add compatible for Starry ili9882t

The STARRY ili9882t is a 10.51" WUXGA TFT LCD panel,
which fits in nicely with the existing panel-boe-tv101wum-nl6
driver. Hence, we add a new compatible with panel specific config.

Signed-off-by: Cong Yang <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525093151.2338370-4-yangcong5@huaqin.corp-partner.google.com
21 months agodrm/panel: Support for Starry-himax83102-j02 TDDI MIPI-DSI panel
Cong Yang [Thu, 25 May 2023 09:31:49 +0000 (17:31 +0800)]
drm/panel: Support for Starry-himax83102-j02 TDDI MIPI-DSI panel

The Starry-himax83102-j02 is a 10.51" WUXGA TFT panel. which fits in nicely
with the existing panel-boe-tv101wum-nl6 driver. From the datasheet[1], MIPI
needs to keep the LP11 state before the lcm_reset pin is pulled high, so
increase lp11_before_reset flag.

[1]: https://github.com/HimaxSoftware/Doc/tree/main/Himax_Chipset_Power_Sequence

Signed-off-by: Cong Yang <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
[dianders: removed some spacing on one line]
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525093151.2338370-3-yangcong5@huaqin.corp-partner.google.com
21 months agodt-bindings: display: panel: Add compatible for Starry himax83102-j02
Cong Yang [Thu, 25 May 2023 09:31:48 +0000 (17:31 +0800)]
dt-bindings: display: panel: Add compatible for Starry himax83102-j02

The STARRY himax83102-j02 is a 10.51" WUXGA TFT LCD panel,
which fits in nicely with the existing panel-boe-tv101wum-nl6
driver. Hence, we add a new compatible with panel specific config.

Signed-off-by: Cong Yang <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525093151.2338370-2-yangcong5@huaqin.corp-partner.google.com
21 months agodrm/panel: khadas-ts050: update timings to achieve 60Hz refresh rate
Neil Armstrong [Tue, 30 May 2023 07:38:14 +0000 (09:38 +0200)]
drm/panel: khadas-ts050: update timings to achieve 60Hz refresh rate

This updates the panel timings to achieve a clean 60Hz refresh rate.

Reviewed-by: Nicolas Belin <[email protected]>
Tested-by: Nicolas Belin <[email protected]> # on Khadas VIM3 + TS050 Panel
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-13-56eb7a4d5b8e@linaro.org
This page took 0.117407 seconds and 4 git commands to generate.