Skip to content

Commit faf66a7

Browse files
committed
Merge tag 'drm-misc-fixes-2025-11-06' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
Short summary of fixes pull: imagination: - kconfig: Fix dependencies nouveau: - Set DMA mask earlier - Advertize correct modifiers for GB20x pixpaper: - kconfig: Fix dependencies sched: - Fix deadlock Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20251106131244.GA155679@2a02-2454-fd5e-fd00-d540-1fd5-75b4-d5e2.dyn6.pyur.net
2 parents 6146a0f + b750f5a commit faf66a7

File tree

9 files changed

+108
-39
lines changed

9 files changed

+108
-39
lines changed

drivers/gpu/drm/imagination/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config DRM_POWERVR
77
depends on DRM
88
depends on MMU
99
depends on PM
10+
depends on POWER_SEQUENCING || !POWER_SEQUENCING
1011
select DRM_EXEC
1112
select DRM_GEM_SHMEM_HELPER
1213
select DRM_SCHED

drivers/gpu/drm/nouveau/dispnv50/disp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2867,7 +2867,9 @@ nv50_display_create(struct drm_device *dev)
28672867
}
28682868

28692869
/* Assign the correct format modifiers */
2870-
if (disp->disp->object.oclass >= TU102_DISP)
2870+
if (disp->disp->object.oclass >= GB202_DISP)
2871+
nouveau_display(dev)->format_modifiers = wndwca7e_modifiers;
2872+
else if (disp->disp->object.oclass >= TU102_DISP)
28712873
nouveau_display(dev)->format_modifiers = wndwc57e_modifiers;
28722874
else
28732875
if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_FERMI)

drivers/gpu/drm/nouveau/dispnv50/disp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,5 @@ struct nouveau_encoder *nv50_real_outp(struct drm_encoder *encoder);
104104
extern const u64 disp50xx_modifiers[];
105105
extern const u64 disp90xx_modifiers[];
106106
extern const u64 wndwc57e_modifiers[];
107+
extern const u64 wndwca7e_modifiers[];
107108
#endif

drivers/gpu/drm/nouveau/dispnv50/wndw.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,27 +786,47 @@ nv50_wndw_destroy(struct drm_plane *plane)
786786
}
787787

788788
/* This function assumes the format has already been validated against the plane
789-
* and the modifier was validated against the device-wides modifier list at FB
789+
* and the modifier was validated against the device-wide modifier list at FB
790790
* creation time.
791791
*/
792792
static bool nv50_plane_format_mod_supported(struct drm_plane *plane,
793793
u32 format, u64 modifier)
794794
{
795795
struct nouveau_drm *drm = nouveau_drm(plane->dev);
796+
const struct drm_format_info *info = drm_format_info(format);
796797
uint8_t i;
797798

798799
/* All chipsets can display all formats in linear layout */
799800
if (modifier == DRM_FORMAT_MOD_LINEAR)
800801
return true;
801802

802803
if (drm->client.device.info.chipset < 0xc0) {
803-
const struct drm_format_info *info = drm_format_info(format);
804804
const uint8_t kind = (modifier >> 12) & 0xff;
805805

806806
if (!format) return false;
807807

808808
for (i = 0; i < info->num_planes; i++)
809809
if ((info->cpp[i] != 4) && kind != 0x70) return false;
810+
} else if (drm->client.device.info.chipset >= 0x1b2) {
811+
const uint8_t slayout = ((modifier >> 22) & 0x1) |
812+
((modifier >> 25) & 0x6);
813+
814+
if (!format)
815+
return false;
816+
817+
/*
818+
* Note in practice this implies only formats where cpp is equal
819+
* for each plane, or >= 4 for all planes, are supported.
820+
*/
821+
for (i = 0; i < info->num_planes; i++) {
822+
if (((info->cpp[i] == 2) && slayout != 3) ||
823+
((info->cpp[i] == 1) && slayout != 2) ||
824+
((info->cpp[i] >= 4) && slayout != 1))
825+
return false;
826+
827+
/* 24-bit not supported. It has yet another layout */
828+
WARN_ON(info->cpp[i] == 3);
829+
}
810830
}
811831

812832
return true;

drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,39 @@ wndwca7e_ntfy_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
179179
return 0;
180180
}
181181

182+
/****************************************************************
183+
* Log2(block height) ----------------------------+ *
184+
* Page Kind ----------------------------------+ | *
185+
* Gob Height/Page Kind Generation ------+ | | *
186+
* Sector layout -------+ | | | *
187+
* Compression ------+ | | | | */
188+
const u64 wndwca7e_modifiers[] = { /* | | | | | */
189+
/* 4cpp+ modifiers */
190+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 1, 2, 0x06, 0),
191+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 1, 2, 0x06, 1),
192+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 1, 2, 0x06, 2),
193+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 1, 2, 0x06, 3),
194+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 1, 2, 0x06, 4),
195+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 1, 2, 0x06, 5),
196+
/* 1cpp/8bpp modifiers */
197+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 2, 2, 0x06, 0),
198+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 2, 2, 0x06, 1),
199+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 2, 2, 0x06, 2),
200+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 2, 2, 0x06, 3),
201+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 2, 2, 0x06, 4),
202+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 2, 2, 0x06, 5),
203+
/* 2cpp/16bpp modifiers */
204+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 3, 2, 0x06, 0),
205+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 3, 2, 0x06, 1),
206+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 3, 2, 0x06, 2),
207+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 3, 2, 0x06, 3),
208+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 3, 2, 0x06, 4),
209+
DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 3, 2, 0x06, 5),
210+
/* All formats support linear */
211+
DRM_FORMAT_MOD_LINEAR,
212+
DRM_FORMAT_MOD_INVALID
213+
};
214+
182215
static const struct nv50_wndw_func
183216
wndwca7e = {
184217
.acquire = wndwc37e_acquire,

drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,6 +1695,18 @@ nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg,
16951695
*pdevice = &pdev->device;
16961696
pdev->pdev = pci_dev;
16971697

1698+
/* Set DMA mask based on capabilities reported by the MMU subdev. */
1699+
if (pdev->device.mmu && !pdev->device.pci->agp.bridge)
1700+
bits = pdev->device.mmu->dma_bits;
1701+
else
1702+
bits = 32;
1703+
1704+
ret = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(bits));
1705+
if (ret && bits != 32) {
1706+
dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32));
1707+
pdev->device.mmu->dma_bits = 32;
1708+
}
1709+
16981710
ret = nvkm_device_ctor(&nvkm_device_pci_func, quirk, &pci_dev->dev,
16991711
pci_is_pcie(pci_dev) ? NVKM_DEVICE_PCIE :
17001712
pci_find_capability(pci_dev, PCI_CAP_ID_AGP) ?
@@ -1708,17 +1720,5 @@ nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg,
17081720
if (ret)
17091721
return ret;
17101722

1711-
/* Set DMA mask based on capabilities reported by the MMU subdev. */
1712-
if (pdev->device.mmu && !pdev->device.pci->agp.bridge)
1713-
bits = pdev->device.mmu->dma_bits;
1714-
else
1715-
bits = 32;
1716-
1717-
ret = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(bits));
1718-
if (ret && bits != 32) {
1719-
dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32));
1720-
pdev->device.mmu->dma_bits = 32;
1721-
}
1722-
17231723
return 0;
17241724
}

drivers/gpu/drm/scheduler/sched_entity.c

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -173,26 +173,15 @@ int drm_sched_entity_error(struct drm_sched_entity *entity)
173173
}
174174
EXPORT_SYMBOL(drm_sched_entity_error);
175175

176+
static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,
177+
struct dma_fence_cb *cb);
178+
176179
static void drm_sched_entity_kill_jobs_work(struct work_struct *wrk)
177180
{
178181
struct drm_sched_job *job = container_of(wrk, typeof(*job), work);
179-
180-
drm_sched_fence_scheduled(job->s_fence, NULL);
181-
drm_sched_fence_finished(job->s_fence, -ESRCH);
182-
WARN_ON(job->s_fence->parent);
183-
job->sched->ops->free_job(job);
184-
}
185-
186-
/* Signal the scheduler finished fence when the entity in question is killed. */
187-
static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,
188-
struct dma_fence_cb *cb)
189-
{
190-
struct drm_sched_job *job = container_of(cb, struct drm_sched_job,
191-
finish_cb);
182+
struct dma_fence *f;
192183
unsigned long index;
193184

194-
dma_fence_put(f);
195-
196185
/* Wait for all dependencies to avoid data corruptions */
197186
xa_for_each(&job->dependencies, index, f) {
198187
struct drm_sched_fence *s_fence = to_drm_sched_fence(f);
@@ -220,6 +209,21 @@ static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,
220209
dma_fence_put(f);
221210
}
222211

212+
drm_sched_fence_scheduled(job->s_fence, NULL);
213+
drm_sched_fence_finished(job->s_fence, -ESRCH);
214+
WARN_ON(job->s_fence->parent);
215+
job->sched->ops->free_job(job);
216+
}
217+
218+
/* Signal the scheduler finished fence when the entity in question is killed. */
219+
static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,
220+
struct dma_fence_cb *cb)
221+
{
222+
struct drm_sched_job *job = container_of(cb, struct drm_sched_job,
223+
finish_cb);
224+
225+
dma_fence_put(f);
226+
223227
INIT_WORK(&job->work, drm_sched_entity_kill_jobs_work);
224228
schedule_work(&job->work);
225229
}

drivers/gpu/drm/tiny/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ config DRM_PANEL_MIPI_DBI
8585
config DRM_PIXPAPER
8686
tristate "DRM support for PIXPAPER display panels"
8787
depends on DRM && SPI
88+
depends on MMU
8889
select DRM_CLIENT_SELECTION
8990
select DRM_GEM_SHMEM_HELPER
9091
select DRM_KMS_HELPER

include/uapi/drm/drm_fourcc.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -979,14 +979,20 @@ extern "C" {
979979
* 2 = Gob Height 8, Turing+ Page Kind mapping
980980
* 3 = Reserved for future use.
981981
*
982-
* 22:22 s Sector layout. On Tegra GPUs prior to Xavier, there is a further
983-
* bit remapping step that occurs at an even lower level than the
984-
* page kind and block linear swizzles. This causes the layout of
985-
* surfaces mapped in those SOC's GPUs to be incompatible with the
986-
* equivalent mapping on other GPUs in the same system.
987-
*
988-
* 0 = Tegra K1 - Tegra Parker/TX2 Layout.
989-
* 1 = Desktop GPU and Tegra Xavier+ Layout
982+
* 22:22 s Sector layout. There is a further bit remapping step that occurs
983+
* 26:27 at an even lower level than the page kind and block linear
984+
* swizzles. This causes the bit arrangement of surfaces in memory
985+
* to differ subtly, and prevents direct sharing of surfaces between
986+
* GPUs with different layouts.
987+
*
988+
* 0 = Tegra K1 - Tegra Parker/TX2 Layout
989+
* 1 = Pre-GB20x, GB20x 32+ bpp, GB10, Tegra Xavier-Orin Layout
990+
* 2 = GB20x(Blackwell 2)+ 8 bpp surface layout
991+
* 3 = GB20x(Blackwell 2)+ 16 bpp surface layout
992+
* 4 = Reserved for future use.
993+
* 5 = Reserved for future use.
994+
* 6 = Reserved for future use.
995+
* 7 = Reserved for future use.
990996
*
991997
* 25:23 c Lossless Framebuffer Compression type.
992998
*
@@ -1001,14 +1007,15 @@ extern "C" {
10011007
* 6 = Reserved for future use
10021008
* 7 = Reserved for future use
10031009
*
1004-
* 55:25 - Reserved for future use. Must be zero.
1010+
* 55:28 - Reserved for future use. Must be zero.
10051011
*/
10061012
#define DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(c, s, g, k, h) \
10071013
fourcc_mod_code(NVIDIA, (0x10 | \
10081014
((h) & 0xf) | \
10091015
(((k) & 0xff) << 12) | \
10101016
(((g) & 0x3) << 20) | \
10111017
(((s) & 0x1) << 22) | \
1018+
(((s) & 0x6) << 25) | \
10121019
(((c) & 0x7) << 23)))
10131020

10141021
/* To grandfather in prior block linear format modifiers to the above layout,

0 commit comments

Comments
 (0)