Skip to content

Commit 60ba8c5

Browse files
committed
Merge tag 'drm-intel-gt-next-2022-11-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
Driver Changes: - Fix for #7306: [Arc A380] white flickering when using arc as a secondary gpu (Matt A) - Add Wa_18017747507 for DG2 (Wayne) - Avoid spurious WARN on DG1 due to incorrect cache_dirty flag (Niranjana, Matt A) - Corrections to CS timestamp support for Gen5 and earlier (Ville) - Fix a build error used with clang compiler on hwmon (GG) - Improvements to LMEM handling with RPM (Anshuman, Matt A) - Cleanups in dmabuf code (Mike) - Selftest improvements (Matt A) Signed-off-by: Dave Airlie <[email protected]> From: Joonas Lahtinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 441f0ec + 8f956e9 commit 60ba8c5

File tree

150 files changed

+6697
-2061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+6697
-2061
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
What: /sys/devices/.../hwmon/hwmon<i>/in0_input
2+
Date: February 2023
3+
KernelVersion: 6.2
4+
5+
Description: RO. Current Voltage in millivolt.
6+
7+
Only supported for particular Intel i915 graphics platforms.
8+
9+
What: /sys/devices/.../hwmon/hwmon<i>/power1_max
10+
Date: February 2023
11+
KernelVersion: 6.2
12+
13+
Description: RW. Card reactive sustained (PL1/Tau) power limit in microwatts.
14+
15+
The power controller will throttle the operating frequency
16+
if the power averaged over a window (typically seconds)
17+
exceeds this limit.
18+
19+
Only supported for particular Intel i915 graphics platforms.
20+
21+
What: /sys/devices/.../hwmon/hwmon<i>/power1_rated_max
22+
Date: February 2023
23+
KernelVersion: 6.2
24+
25+
Description: RO. Card default power limit (default TDP setting).
26+
27+
Only supported for particular Intel i915 graphics platforms.
28+
29+
What: /sys/devices/.../hwmon/hwmon<i>/power1_max_interval
30+
Date: February 2023
31+
KernelVersion: 6.2
32+
33+
Description: RW. Sustained power limit interval (Tau in PL1/Tau) in
34+
milliseconds over which sustained power is averaged.
35+
36+
Only supported for particular Intel i915 graphics platforms.
37+
38+
What: /sys/devices/.../hwmon/hwmon<i>/power1_crit
39+
Date: February 2023
40+
KernelVersion: 6.2
41+
42+
Description: RW. Card reactive critical (I1) power limit in microwatts.
43+
44+
Card reactive critical (I1) power limit in microwatts is exposed
45+
for client products. The power controller will throttle the
46+
operating frequency if the power averaged over a window exceeds
47+
this limit.
48+
49+
Only supported for particular Intel i915 graphics platforms.
50+
51+
What: /sys/devices/.../hwmon/hwmon<i>/curr1_crit
52+
Date: February 2023
53+
KernelVersion: 6.2
54+
55+
Description: RW. Card reactive critical (I1) power limit in milliamperes.
56+
57+
Card reactive critical (I1) power limit in milliamperes is
58+
exposed for server products. The power controller will throttle
59+
the operating frequency if the power averaged over a window
60+
exceeds this limit.
61+
62+
Only supported for particular Intel i915 graphics platforms.
63+
64+
What: /sys/devices/.../hwmon/hwmon<i>/energy1_input
65+
Date: February 2023
66+
KernelVersion: 6.2
67+
68+
Description: RO. Energy input of device or gt in microjoules.
69+
70+
For i915 device level hwmon devices (name "i915") this
71+
reflects energy input for the entire device. For gt level
72+
hwmon devices (name "i915_gtN") this reflects energy input
73+
for the gt.
74+
75+
Only supported for particular Intel i915 graphics platforms.

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10224,6 +10224,7 @@ Q: http://patchwork.freedesktop.org/project/intel-gfx/
1022410224
B: https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs
1022510225
C: irc://irc.oftc.net/intel-gfx
1022610226
T: git git://anongit.freedesktop.org/drm-intel
10227+
F: Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
1022710228
F: Documentation/gpu/i915.rst
1022810229
F: drivers/gpu/drm/i915/
1022910230
F: include/drm/i915*

drivers/gpu/drm/i915/Kconfig.profile

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,28 @@ config DRM_I915_PREEMPT_TIMEOUT
5757
default 640 # milliseconds
5858
help
5959
How long to wait (in milliseconds) for a preemption event to occur
60-
when submitting a new context via execlists. If the current context
61-
does not hit an arbitration point and yield to HW before the timer
62-
expires, the HW will be reset to allow the more important context
63-
to execute.
60+
when submitting a new context. If the current context does not hit
61+
an arbitration point and yield to HW before the timer expires, the
62+
HW will be reset to allow the more important context to execute.
63+
64+
This is adjustable via
65+
/sys/class/drm/card?/engine/*/preempt_timeout_ms
66+
67+
May be 0 to disable the timeout.
68+
69+
The compiled in default may get overridden at driver probe time on
70+
certain platforms and certain engines which will be reflected in the
71+
sysfs control.
72+
73+
config DRM_I915_PREEMPT_TIMEOUT_COMPUTE
74+
int "Preempt timeout for compute engines (ms, jiffy granularity)"
75+
default 7500 # milliseconds
76+
help
77+
How long to wait (in milliseconds) for a preemption event to occur
78+
when submitting a new context to a compute capable engine. If the
79+
current context does not hit an arbitration point and yield to HW
80+
before the timer expires, the HW will be reset to allow the more
81+
important context to execute.
6482

6583
This is adjustable via
6684
/sys/class/drm/card?/engine/*/preempt_timeout_ms

drivers/gpu/drm/i915/Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ i915-y += gt/uc/intel_uc.o \
209209
# graphics system controller (GSC) support
210210
i915-y += gt/intel_gsc.o
211211

212+
# graphics hardware monitoring (HWMON) support
213+
i915-$(CONFIG_HWMON) += i915_hwmon.o
214+
212215
# modesetting core code
213216
i915-y += \
214217
display/hsw_ips.o \
@@ -310,15 +313,18 @@ i915-y += \
310313

311314
i915-y += i915_perf.o
312315

313-
# Protected execution platform (PXP) support
314-
i915-$(CONFIG_DRM_I915_PXP) += \
316+
# Protected execution platform (PXP) support. Base support is required for HuC
317+
i915-y += \
315318
pxp/intel_pxp.o \
319+
pxp/intel_pxp_tee.o \
320+
pxp/intel_pxp_huc.o
321+
322+
i915-$(CONFIG_DRM_I915_PXP) += \
316323
pxp/intel_pxp_cmd.o \
317324
pxp/intel_pxp_debugfs.o \
318325
pxp/intel_pxp_irq.o \
319326
pxp/intel_pxp_pm.o \
320-
pxp/intel_pxp_session.o \
321-
pxp/intel_pxp_tee.o
327+
pxp/intel_pxp_session.o
322328

323329
# Post-mortem debug and GPU hang state capture
324330
i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o

drivers/gpu/drm/i915/display/intel_dpt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "gem/i915_gem_domain.h"
77
#include "gem/i915_gem_internal.h"
8+
#include "gem/i915_gem_lmem.h"
89
#include "gt/gen8_ppgtt.h"
910

1011
#include "i915_drv.h"

drivers/gpu/drm/i915/display/intel_fb_pin.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
167167
ret = i915_gem_object_attach_phys(obj, alignment);
168168
else if (!ret && HAS_LMEM(dev_priv))
169169
ret = i915_gem_object_migrate(obj, &ww, INTEL_REGION_LMEM_0);
170-
/* TODO: Do we need to sync when migration becomes async? */
171170
if (!ret)
172171
ret = i915_gem_object_pin_pages(obj);
173172
if (ret)

drivers/gpu/drm/i915/display/intel_lpe_audio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ lpe_audio_platdev_create(struct drm_i915_private *dev_priv)
100100
rsc[0].flags = IORESOURCE_IRQ;
101101
rsc[0].name = "hdmi-lpe-audio-irq";
102102

103-
rsc[1].start = pci_resource_start(pdev, GTTMMADR_BAR) +
103+
rsc[1].start = pci_resource_start(pdev, GEN4_GTTMMADR_BAR) +
104104
I915_HDMI_LPE_AUDIO_BASE;
105-
rsc[1].end = pci_resource_start(pdev, GTTMMADR_BAR) +
105+
rsc[1].end = pci_resource_start(pdev, GEN4_GTTMMADR_BAR) +
106106
I915_HDMI_LPE_AUDIO_BASE + I915_HDMI_LPE_AUDIO_SIZE - 1;
107107
rsc[1].flags = IORESOURCE_MEM;
108108
rsc[1].name = "hdmi-lpe-audio-mmio";

drivers/gpu/drm/i915/gem/i915_gem_context.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ static void engines_idle_release(struct i915_gem_context *ctx,
14521452
int err;
14531453

14541454
/* serialises with execbuf */
1455-
set_bit(CONTEXT_CLOSED_BIT, &ce->flags);
1455+
intel_context_close(ce);
14561456
if (!intel_context_pin_if_active(ce))
14571457
continue;
14581458

@@ -2298,7 +2298,6 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
22982298
}
22992299

23002300
args->ctx_id = id;
2301-
drm_dbg(&i915->drm, "HW context %d created\n", args->ctx_id);
23022301

23032302
return 0;
23042303

drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,44 @@ static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf)
2525
return to_intel_bo(buf->priv);
2626
}
2727

28-
static struct sg_table *i915_gem_map_dma_buf(struct dma_buf_attachment *attachment,
28+
static struct sg_table *i915_gem_map_dma_buf(struct dma_buf_attachment *attach,
2929
enum dma_data_direction dir)
3030
{
31-
struct drm_i915_gem_object *obj = dma_buf_to_obj(attachment->dmabuf);
32-
struct sg_table *st;
31+
struct drm_i915_gem_object *obj = dma_buf_to_obj(attach->dmabuf);
32+
struct sg_table *sgt;
3333
struct scatterlist *src, *dst;
3434
int ret, i;
3535

36-
/* Copy sg so that we make an independent mapping */
37-
st = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
38-
if (st == NULL) {
36+
/*
37+
* Make a copy of the object's sgt, so that we can make an independent
38+
* mapping
39+
*/
40+
sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
41+
if (!sgt) {
3942
ret = -ENOMEM;
4043
goto err;
4144
}
4245

43-
ret = sg_alloc_table(st, obj->mm.pages->nents, GFP_KERNEL);
46+
ret = sg_alloc_table(sgt, obj->mm.pages->orig_nents, GFP_KERNEL);
4447
if (ret)
4548
goto err_free;
4649

47-
src = obj->mm.pages->sgl;
48-
dst = st->sgl;
49-
for (i = 0; i < obj->mm.pages->nents; i++) {
50+
dst = sgt->sgl;
51+
for_each_sg(obj->mm.pages->sgl, src, obj->mm.pages->orig_nents, i) {
5052
sg_set_page(dst, sg_page(src), src->length, 0);
5153
dst = sg_next(dst);
52-
src = sg_next(src);
5354
}
5455

55-
ret = dma_map_sgtable(attachment->dev, st, dir, DMA_ATTR_SKIP_CPU_SYNC);
56+
ret = dma_map_sgtable(attach->dev, sgt, dir, DMA_ATTR_SKIP_CPU_SYNC);
5657
if (ret)
5758
goto err_free_sg;
5859

59-
return st;
60+
return sgt;
6061

6162
err_free_sg:
62-
sg_free_table(st);
63+
sg_free_table(sgt);
6364
err_free:
64-
kfree(st);
65+
kfree(sgt);
6566
err:
6667
return ERR_PTR(ret);
6768
}
@@ -236,15 +237,15 @@ struct dma_buf *i915_gem_prime_export(struct drm_gem_object *gem_obj, int flags)
236237
static int i915_gem_object_get_pages_dmabuf(struct drm_i915_gem_object *obj)
237238
{
238239
struct drm_i915_private *i915 = to_i915(obj->base.dev);
239-
struct sg_table *pages;
240+
struct sg_table *sgt;
240241
unsigned int sg_page_sizes;
241242

242243
assert_object_held(obj);
243244

244-
pages = dma_buf_map_attachment(obj->base.import_attach,
245-
DMA_BIDIRECTIONAL);
246-
if (IS_ERR(pages))
247-
return PTR_ERR(pages);
245+
sgt = dma_buf_map_attachment(obj->base.import_attach,
246+
DMA_BIDIRECTIONAL);
247+
if (IS_ERR(sgt))
248+
return PTR_ERR(sgt);
248249

249250
/*
250251
* DG1 is special here since it still snoops transactions even with
@@ -261,16 +262,16 @@ static int i915_gem_object_get_pages_dmabuf(struct drm_i915_gem_object *obj)
261262
(!HAS_LLC(i915) && !IS_DG1(i915)))
262263
wbinvd_on_all_cpus();
263264

264-
sg_page_sizes = i915_sg_dma_sizes(pages->sgl);
265-
__i915_gem_object_set_pages(obj, pages, sg_page_sizes);
265+
sg_page_sizes = i915_sg_dma_sizes(sgt->sgl);
266+
__i915_gem_object_set_pages(obj, sgt, sg_page_sizes);
266267

267268
return 0;
268269
}
269270

270271
static void i915_gem_object_put_pages_dmabuf(struct drm_i915_gem_object *obj,
271-
struct sg_table *pages)
272+
struct sg_table *sgt)
272273
{
273-
dma_buf_unmap_attachment(obj->base.import_attach, pages,
274+
dma_buf_unmap_attachment(obj->base.import_attach, sgt,
274275
DMA_BIDIRECTIONAL);
275276
}
276277

@@ -313,7 +314,7 @@ struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev,
313314
get_dma_buf(dma_buf);
314315

315316
obj = i915_gem_object_alloc();
316-
if (obj == NULL) {
317+
if (!obj) {
317318
ret = -ENOMEM;
318319
goto fail_detach;
319320
}

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,11 +2954,6 @@ await_fence_array(struct i915_execbuffer *eb,
29542954
int err;
29552955

29562956
for (n = 0; n < eb->num_fences; n++) {
2957-
struct drm_syncobj *syncobj;
2958-
unsigned int flags;
2959-
2960-
syncobj = ptr_unpack_bits(eb->fences[n].syncobj, &flags, 2);
2961-
29622957
if (!eb->fences[n].dma_fence)
29632958
continue;
29642959

0 commit comments

Comments
 (0)