drm fixes for 6.6-rc5
i915: - Fix for OpenGL CTS regression on Compute Shaders - Fix for default engines initialization - Fix TLB invalidation for Multi-GT devices amdgpu: - Add missing unique_id for GC 11.0.3 - Fix memory leak in FRU error path - Fix PCIe link reporting on some SMU 11 parts - Fix ACPI _PR3 detection - Fix DISPCLK WDIVIDER handling in OTG code tests: - Fix kunit release panel: - panel-orientation: Add quirk for One Mix 25 nouveau: - Report IB limit via getparams - Replace some magic numbers with constants - small clean up -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEEKbZHaGwW9KfbeusDHTzWXnEhr4FAmUfkx4ACgkQDHTzWXnE hr6+zRAAhV1+R7KYcgSgEX/n+t/8rx11CZIJ1DkwJc1IwkbubuyFUAukXSGtPBQG ceCnt3p/tSzV4+X+LWbJQqjB6hnSVBKQvOvky871/A0vi4sVsjFDHyjK6MWVuW1A dKfMVE/asBgX93GlP94IDbTJ7K2VPSUYiqMlYUPnmjE29g8bdUoPgJbWwLxT84wf oLwtsaUZCMafzqI9eyqLIZlUMs59L+jiwsXqpZiHe3vHc6/rYcVluFUq3SUj1shb Bmtx39H7jTMUSODVNe8tvm+D8B4N8UAV5A64SpoHHQw4lBMHPYgwFihkNowYXi5R uj/1VT0e10PThN4jMqgOgtJku7iEapKyAnOXvEcrtOAPBavCZG/L5zm7v/OqTCAr SsFgntrXKOZ6VnGgfbvikY+EXeeYf3qqQDUnwxsRw2dbnbY9inWMKy4v2f6Hyg5x wfkqlPIwXjV3wS+tg2B978fm1CDXHrVW13mzcniZe76mHp1uAfe3C3dUT+4dw2uF 6QHglQg6yf8t7nIF6dPQGktAjqTzomVtX2iYdYUJ8VkgoyxQvp3dwiicGsZJfT+J GimSwqyMWGiDAprjg45F88jeM0/cF2et9vbS4Qe2pokq1/R2RTKpXdlzvDQKNKKr htpO7G1SkMxTAdHSI75yh2EQc2jlc//qhicj0/kmOCqRdvllcZA= =g4ze -----END PGP SIGNATURE----- Merge tag 'drm-fixes-2023-10-06' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular weekly pull, all seems pretty normal, i915 and amdgpu mostly. There is one small new uAPI addition for nouveau but getting it in now avoids a bunch of userspace dances, and it's for a userspace that hasn't yet released, so should have no side effects. i915: - Fix for OpenGL CTS regression on Compute Shaders - Fix for default engines initialization - Fix TLB invalidation for Multi-GT devices amdgpu: - Add missing unique_id for GC 11.0.3 - Fix memory leak in FRU error path - Fix PCIe link reporting on some SMU 11 parts - Fix ACPI _PR3 detection - Fix DISPCLK WDIVIDER handling in OTG code tests: - Fix kunit release panel: - panel-orientation: Add quirk for One Mix 25 nouveau: - Report IB limit via getparams - Replace some magic numbers with constants - small clean up" * tag 'drm-fixes-2023-10-06' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: apply edge-case DISPCLK WDIVIDER changes to master OTG pipes only drm/amd: Fix detection of _PR3 on the PCIe root port drm/amd: Fix logic error in sienna_cichlid_update_pcie_parameters() drm/amdgpu: Fix a memory leak drm/amd/pm: add unique_id for gc 11.0.3 drm/i915: Invalidate the TLBs on each GT drm/i915: Register engines early to avoid type confusion drm/i915: Don't set PIPE_CONTROL_FLUSH_L3 for aux inval drm/nouveau: exec: report max pushs through getparam drm/nouveau: chan: use channel class definitions drm/nouveau: chan: use struct nvif_mclass drm: panel-orientation-quirks: Add quirk for One Mix 2S drm/tests: Fix kunit_release_action ctx argument
This commit is contained in:
commit
4940c1543b
@ -2093,7 +2093,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
|
||||
adev->flags |= AMD_IS_PX;
|
||||
|
||||
if (!(adev->flags & AMD_IS_APU)) {
|
||||
parent = pci_upstream_bridge(adev->pdev);
|
||||
parent = pcie_find_root_port(adev->pdev);
|
||||
adev->has_pr3 = parent ? pci_pr3_present(parent) : false;
|
||||
}
|
||||
|
||||
|
@ -170,6 +170,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev)
|
||||
csum += pia[size - 1];
|
||||
if (csum) {
|
||||
DRM_ERROR("Bad Product Info Area checksum: 0x%02x", csum);
|
||||
kfree(pia);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ void dcn20_update_clocks_update_dentist(struct clk_mgr_internal *clk_mgr, struct
|
||||
int32_t N;
|
||||
int32_t j;
|
||||
|
||||
if (!pipe_ctx->stream)
|
||||
if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
|
||||
continue;
|
||||
/* Virtual encoders don't have this function */
|
||||
if (!stream_enc->funcs->get_fifo_cal_average_level)
|
||||
@ -188,7 +188,7 @@ void dcn20_update_clocks_update_dentist(struct clk_mgr_internal *clk_mgr, struct
|
||||
int32_t N;
|
||||
int32_t j;
|
||||
|
||||
if (!pipe_ctx->stream)
|
||||
if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
|
||||
continue;
|
||||
/* Virtual encoders don't have this function */
|
||||
if (!stream_enc->funcs->get_fifo_cal_average_level)
|
||||
|
@ -355,7 +355,7 @@ static void dcn32_update_clocks_update_dentist(
|
||||
int32_t N;
|
||||
int32_t j;
|
||||
|
||||
if (!pipe_ctx->stream)
|
||||
if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
|
||||
continue;
|
||||
/* Virtual encoders don't have this function */
|
||||
if (!stream_enc->funcs->get_fifo_cal_average_level)
|
||||
@ -401,7 +401,7 @@ static void dcn32_update_clocks_update_dentist(
|
||||
int32_t N;
|
||||
int32_t j;
|
||||
|
||||
if (!pipe_ctx->stream)
|
||||
if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
|
||||
continue;
|
||||
/* Virtual encoders don't have this function */
|
||||
if (!stream_enc->funcs->get_fifo_cal_average_level)
|
||||
|
@ -2040,6 +2040,7 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
|
||||
case IP_VERSION(11, 0, 0):
|
||||
case IP_VERSION(11, 0, 1):
|
||||
case IP_VERSION(11, 0, 2):
|
||||
case IP_VERSION(11, 0, 3):
|
||||
*states = ATTR_STATE_SUPPORTED;
|
||||
break;
|
||||
default:
|
||||
|
@ -2082,36 +2082,41 @@ static int sienna_cichlid_display_disable_memory_clock_switch(struct smu_context
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
static int sienna_cichlid_update_pcie_parameters(struct smu_context *smu,
|
||||
uint32_t pcie_gen_cap,
|
||||
uint32_t pcie_width_cap)
|
||||
{
|
||||
struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
|
||||
struct smu_11_0_pcie_table *pcie_table = &dpm_context->dpm_tables.pcie_table;
|
||||
u32 smu_pcie_arg;
|
||||
uint8_t *table_member1, *table_member2;
|
||||
uint32_t min_gen_speed, max_gen_speed;
|
||||
uint32_t min_lane_width, max_lane_width;
|
||||
uint32_t smu_pcie_arg;
|
||||
int ret, i;
|
||||
|
||||
/* PCIE gen speed and lane width override */
|
||||
GET_PPTABLE_MEMBER(PcieGenSpeed, &table_member1);
|
||||
GET_PPTABLE_MEMBER(PcieLaneCount, &table_member2);
|
||||
|
||||
min_gen_speed = MAX(0, table_member1[0]);
|
||||
max_gen_speed = MIN(pcie_gen_cap, table_member1[1]);
|
||||
min_gen_speed = min_gen_speed > max_gen_speed ?
|
||||
max_gen_speed : min_gen_speed;
|
||||
min_lane_width = MAX(1, table_member2[0]);
|
||||
max_lane_width = MIN(pcie_width_cap, table_member2[1]);
|
||||
min_lane_width = min_lane_width > max_lane_width ?
|
||||
max_lane_width : min_lane_width;
|
||||
|
||||
if (!amdgpu_device_pcie_dynamic_switching_supported()) {
|
||||
if (pcie_table->pcie_gen[NUM_LINK_LEVELS - 1] < pcie_gen_cap)
|
||||
pcie_gen_cap = pcie_table->pcie_gen[NUM_LINK_LEVELS - 1];
|
||||
|
||||
if (pcie_table->pcie_lane[NUM_LINK_LEVELS - 1] < pcie_width_cap)
|
||||
pcie_width_cap = pcie_table->pcie_lane[NUM_LINK_LEVELS - 1];
|
||||
|
||||
/* Force all levels to use the same settings */
|
||||
for (i = 0; i < NUM_LINK_LEVELS; i++) {
|
||||
pcie_table->pcie_gen[i] = pcie_gen_cap;
|
||||
pcie_table->pcie_lane[i] = pcie_width_cap;
|
||||
}
|
||||
pcie_table->pcie_gen[0] = max_gen_speed;
|
||||
pcie_table->pcie_lane[0] = max_lane_width;
|
||||
} else {
|
||||
for (i = 0; i < NUM_LINK_LEVELS; i++) {
|
||||
if (pcie_table->pcie_gen[i] > pcie_gen_cap)
|
||||
pcie_table->pcie_gen[i] = pcie_gen_cap;
|
||||
if (pcie_table->pcie_lane[i] > pcie_width_cap)
|
||||
pcie_table->pcie_lane[i] = pcie_width_cap;
|
||||
}
|
||||
pcie_table->pcie_gen[0] = min_gen_speed;
|
||||
pcie_table->pcie_lane[0] = min_lane_width;
|
||||
}
|
||||
pcie_table->pcie_gen[1] = max_gen_speed;
|
||||
pcie_table->pcie_lane[1] = max_lane_width;
|
||||
|
||||
for (i = 0; i < NUM_LINK_LEVELS; i++) {
|
||||
smu_pcie_arg = (i << 16 |
|
||||
|
@ -38,6 +38,14 @@ static const struct drm_dmi_panel_orientation_data gpd_micropc = {
|
||||
.orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
|
||||
};
|
||||
|
||||
static const struct drm_dmi_panel_orientation_data gpd_onemix2s = {
|
||||
.width = 1200,
|
||||
.height = 1920,
|
||||
.bios_dates = (const char * const []){ "05/21/2018", "10/26/2018",
|
||||
"03/04/2019", NULL },
|
||||
.orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
|
||||
};
|
||||
|
||||
static const struct drm_dmi_panel_orientation_data gpd_pocket = {
|
||||
.width = 1200,
|
||||
.height = 1920,
|
||||
@ -401,6 +409,14 @@ static const struct dmi_system_id orientation_data[] = {
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LTH17"),
|
||||
},
|
||||
.driver_data = (void *)&lcd800x1280_rightside_up,
|
||||
}, { /* One Mix 2S (generic strings, also match on bios date) */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"),
|
||||
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"),
|
||||
DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"),
|
||||
},
|
||||
.driver_data = (void *)&gpd_onemix2s,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
@ -198,7 +198,7 @@ static void flush_tlb_invalidate(struct drm_i915_gem_object *obj)
|
||||
|
||||
for_each_gt(gt, i915, id) {
|
||||
if (!obj->mm.tlb[id])
|
||||
return;
|
||||
continue;
|
||||
|
||||
intel_gt_invalidate_tlb_full(gt, obj->mm.tlb[id]);
|
||||
obj->mm.tlb[id] = 0;
|
||||
|
@ -271,8 +271,17 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
|
||||
if (GRAPHICS_VER_FULL(rq->i915) >= IP_VER(12, 70))
|
||||
bit_group_0 |= PIPE_CONTROL_CCS_FLUSH;
|
||||
|
||||
/*
|
||||
* L3 fabric flush is needed for AUX CCS invalidation
|
||||
* which happens as part of pipe-control so we can
|
||||
* ignore PIPE_CONTROL_FLUSH_L3. Also PIPE_CONTROL_FLUSH_L3
|
||||
* deals with Protected Memory which is not needed for
|
||||
* AUX CCS invalidation and lead to unwanted side effects.
|
||||
*/
|
||||
if (mode & EMIT_FLUSH)
|
||||
bit_group_1 |= PIPE_CONTROL_FLUSH_L3;
|
||||
|
||||
bit_group_1 |= PIPE_CONTROL_TILE_CACHE_FLUSH;
|
||||
bit_group_1 |= PIPE_CONTROL_FLUSH_L3;
|
||||
bit_group_1 |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
|
||||
bit_group_1 |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
|
||||
/* Wa_1409600907:tgl,adl-p */
|
||||
|
@ -1199,6 +1199,13 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
|
||||
goto err_unlock;
|
||||
}
|
||||
|
||||
/*
|
||||
* Register engines early to ensure the engine list is in its final
|
||||
* rb-tree form, lowering the amount of code that has to deal with
|
||||
* the intermediate llist state.
|
||||
*/
|
||||
intel_engines_driver_register(dev_priv);
|
||||
|
||||
return 0;
|
||||
|
||||
/*
|
||||
@ -1246,8 +1253,6 @@ err_unlock:
|
||||
void i915_gem_driver_register(struct drm_i915_private *i915)
|
||||
{
|
||||
i915_gem_driver_register__shrinker(i915);
|
||||
|
||||
intel_engines_driver_register(i915);
|
||||
}
|
||||
|
||||
void i915_gem_driver_unregister(struct drm_i915_private *i915)
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include "nouveau_drv.h"
|
||||
#include "nouveau_dma.h"
|
||||
#include "nouveau_exec.h"
|
||||
#include "nouveau_gem.h"
|
||||
#include "nouveau_chan.h"
|
||||
#include "nouveau_abi16.h"
|
||||
@ -183,6 +184,20 @@ nouveau_abi16_fini(struct nouveau_abi16 *abi16)
|
||||
cli->abi16 = NULL;
|
||||
}
|
||||
|
||||
static inline int
|
||||
getparam_dma_ib_max(struct nvif_device *device)
|
||||
{
|
||||
const struct nvif_mclass dmas[] = {
|
||||
{ NV03_CHANNEL_DMA, 0 },
|
||||
{ NV10_CHANNEL_DMA, 0 },
|
||||
{ NV17_CHANNEL_DMA, 0 },
|
||||
{ NV40_CHANNEL_DMA, 0 },
|
||||
{}
|
||||
};
|
||||
|
||||
return nvif_mclass(&device->object, dmas) < 0 ? NV50_DMA_IB_MAX : 0;
|
||||
}
|
||||
|
||||
int
|
||||
nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
|
||||
{
|
||||
@ -247,6 +262,12 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
|
||||
case NOUVEAU_GETPARAM_GRAPH_UNITS:
|
||||
getparam->value = nvkm_gr_units(gr);
|
||||
break;
|
||||
case NOUVEAU_GETPARAM_EXEC_PUSH_MAX: {
|
||||
int ib_max = getparam_dma_ib_max(device);
|
||||
|
||||
getparam->value = nouveau_exec_push_max_from_ib_max(ib_max);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
NV_PRINTK(dbg, cli, "unknown parameter %lld\n", getparam->param);
|
||||
return -EINVAL;
|
||||
|
@ -257,10 +257,7 @@ static int
|
||||
nouveau_channel_ctor(struct nouveau_drm *drm, struct nvif_device *device, bool priv, u64 runm,
|
||||
struct nouveau_channel **pchan)
|
||||
{
|
||||
static const struct {
|
||||
s32 oclass;
|
||||
int version;
|
||||
} hosts[] = {
|
||||
const struct nvif_mclass hosts[] = {
|
||||
{ AMPERE_CHANNEL_GPFIFO_B, 0 },
|
||||
{ AMPERE_CHANNEL_GPFIFO_A, 0 },
|
||||
{ TURING_CHANNEL_GPFIFO_A, 0 },
|
||||
@ -443,9 +440,11 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
|
||||
}
|
||||
|
||||
/* initialise dma tracking parameters */
|
||||
switch (chan->user.oclass & 0x00ff) {
|
||||
case 0x006b:
|
||||
case 0x006e:
|
||||
switch (chan->user.oclass) {
|
||||
case NV03_CHANNEL_DMA:
|
||||
case NV10_CHANNEL_DMA:
|
||||
case NV17_CHANNEL_DMA:
|
||||
case NV40_CHANNEL_DMA:
|
||||
chan->user_put = 0x40;
|
||||
chan->user_get = 0x44;
|
||||
chan->dma.max = (0x10000 / 4) - 2;
|
||||
@ -455,7 +454,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
|
||||
chan->user_get = 0x44;
|
||||
chan->user_get_hi = 0x60;
|
||||
chan->dma.ib_base = 0x10000 / 4;
|
||||
chan->dma.ib_max = (0x02000 / 8) - 1;
|
||||
chan->dma.ib_max = NV50_DMA_IB_MAX;
|
||||
chan->dma.ib_put = 0;
|
||||
chan->dma.ib_free = chan->dma.ib_max - chan->dma.ib_put;
|
||||
chan->dma.max = chan->dma.ib_base;
|
||||
|
@ -49,6 +49,9 @@ void nv50_dma_push(struct nouveau_channel *, u64 addr, u32 length,
|
||||
/* Maximum push buffer size. */
|
||||
#define NV50_DMA_PUSH_MAX_LENGTH 0x7fffff
|
||||
|
||||
/* Maximum IBs per ring. */
|
||||
#define NV50_DMA_IB_MAX ((0x02000 / 8) - 1)
|
||||
|
||||
/* Object handles - for stuff that's doesn't use handle == oclass. */
|
||||
enum {
|
||||
NvDmaFB = 0x80000002,
|
||||
|
@ -379,7 +379,7 @@ nouveau_exec_ioctl_exec(struct drm_device *dev,
|
||||
struct nouveau_channel *chan = NULL;
|
||||
struct nouveau_exec_job_args args = {};
|
||||
struct drm_nouveau_exec *req = data;
|
||||
int ret = 0;
|
||||
int push_max, ret = 0;
|
||||
|
||||
if (unlikely(!abi16))
|
||||
return -ENOMEM;
|
||||
@ -404,9 +404,10 @@ nouveau_exec_ioctl_exec(struct drm_device *dev,
|
||||
if (!chan->dma.ib_max)
|
||||
return nouveau_abi16_put(abi16, -ENOSYS);
|
||||
|
||||
if (unlikely(req->push_count > NOUVEAU_GEM_MAX_PUSH)) {
|
||||
push_max = nouveau_exec_push_max_from_ib_max(chan->dma.ib_max);
|
||||
if (unlikely(req->push_count > push_max)) {
|
||||
NV_PRINTK(err, cli, "pushbuf push count exceeds limit: %d max %d\n",
|
||||
req->push_count, NOUVEAU_GEM_MAX_PUSH);
|
||||
req->push_count, push_max);
|
||||
return nouveau_abi16_put(abi16, -EINVAL);
|
||||
}
|
||||
|
||||
|
@ -51,4 +51,14 @@ int nouveau_exec_job_init(struct nouveau_exec_job **job,
|
||||
int nouveau_exec_ioctl_exec(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
|
||||
static inline unsigned int
|
||||
nouveau_exec_push_max_from_ib_max(int ib_max)
|
||||
{
|
||||
/* Limit the number of IBs per job to half the size of the ring in order
|
||||
* to avoid the ring running dry between submissions and preserve one
|
||||
* more slot for the job's HW fence.
|
||||
*/
|
||||
return ib_max > 1 ? ib_max / 2 - 1 : 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -118,7 +118,7 @@ void drm_kunit_helper_free_device(struct kunit *test, struct device *dev)
|
||||
|
||||
kunit_release_action(test,
|
||||
kunit_action_platform_driver_unregister,
|
||||
pdev);
|
||||
&fake_platform_driver);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(drm_kunit_helper_free_device);
|
||||
|
||||
|
@ -44,6 +44,16 @@ extern "C" {
|
||||
#define NOUVEAU_GETPARAM_PTIMER_TIME 14
|
||||
#define NOUVEAU_GETPARAM_HAS_BO_USAGE 15
|
||||
#define NOUVEAU_GETPARAM_HAS_PAGEFLIP 16
|
||||
|
||||
/**
|
||||
* @NOUVEAU_GETPARAM_EXEC_PUSH_MAX
|
||||
*
|
||||
* Query the maximum amount of IBs that can be pushed through a single
|
||||
* &drm_nouveau_exec structure and hence a single &DRM_IOCTL_NOUVEAU_EXEC
|
||||
* ioctl().
|
||||
*/
|
||||
#define NOUVEAU_GETPARAM_EXEC_PUSH_MAX 17
|
||||
|
||||
struct drm_nouveau_getparam {
|
||||
__u64 param;
|
||||
__u64 value;
|
||||
|
Loading…
Reference in New Issue
Block a user