Skip to content

Commit 42345d6

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "Radeon and amdkfd fixes. Radeon ones mostly for oops in some test/benchmark functions since fencing changes, and one regression fix for old GPUs, There is one cirrus regression fix, the 32bpp broke userspace, so this hides it behind a module option for the few users who care. I'm off for a few days, so this is probably the final pull I have, if I see fixes from Intel I'll forward the pull as I should have email" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: drm/cirrus: Limit modes depending on bpp option drm/radeon: fix the crash in test functions drm/radeon: fix the crash in benchmark functions drm/radeon: properly set vm fragment size for TN/RL drm/radeon: don't init gpuvm if accel is disabled (v3) drm/radeon: fix PLLs on RS880 and older v2 drm/amdkfd: Don't create BUG due to incorrect user parameter drm/amdkfd: max num of queues can't be 0 drm/amdkfd: Fix bug in accounting of queues
2 parents d445d46 + 7f551b1 commit 42345d6

File tree

13 files changed

+54
-27
lines changed

13 files changed

+54
-27
lines changed

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,
822822
* Unconditionally decrement this counter, regardless of the queue's
823823
* type.
824824
*/
825-
dqm->total_queue_count++;
825+
dqm->total_queue_count--;
826826
pr_debug("Total of %d queues are accountable so far\n",
827827
dqm->total_queue_count);
828828
mutex_unlock(&dqm->lock);

drivers/gpu/drm/amd/amdkfd/kfd_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ static int __init kfd_module_init(void)
9595
}
9696

9797
/* Verify module parameters */
98-
if ((max_num_of_queues_per_device < 0) ||
98+
if ((max_num_of_queues_per_device < 1) ||
9999
(max_num_of_queues_per_device >
100100
KFD_MAX_NUM_OF_QUEUES_PER_DEVICE)) {
101-
pr_err("kfd: max_num_of_queues_per_device must be between 0 to KFD_MAX_NUM_OF_QUEUES_PER_DEVICE\n");
101+
pr_err("kfd: max_num_of_queues_per_device must be between 1 to KFD_MAX_NUM_OF_QUEUES_PER_DEVICE\n");
102102
return -1;
103103
}
104104

drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,11 @@ int pqm_update_queue(struct process_queue_manager *pqm, unsigned int qid,
315315
BUG_ON(!pqm);
316316

317317
pqn = get_queue_by_qid(pqm, qid);
318-
BUG_ON(!pqn);
318+
if (!pqn) {
319+
pr_debug("amdkfd: No queue %d exists for update operation\n",
320+
qid);
321+
return -EFAULT;
322+
}
319323

320324
pqn->q->properties.queue_address = p->queue_address;
321325
pqn->q->properties.queue_size = p->queue_size;

drivers/gpu/drm/cirrus/cirrus_drv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
#include "cirrus_drv.h"
1717

1818
int cirrus_modeset = -1;
19+
int cirrus_bpp = 24;
1920

2021
MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
2122
module_param_named(modeset, cirrus_modeset, int, 0400);
23+
MODULE_PARM_DESC(bpp, "Max bits-per-pixel (default:24)");
24+
module_param_named(bpp, cirrus_bpp, int, 0400);
2225

2326
/*
2427
* This is the generic driver code. This binds the driver to the drm core,

drivers/gpu/drm/cirrus/cirrus_drv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,7 @@ static inline void cirrus_bo_unreserve(struct cirrus_bo *bo)
262262

263263
int cirrus_bo_push_sysram(struct cirrus_bo *bo);
264264
int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr);
265+
266+
extern int cirrus_bpp;
267+
265268
#endif /* __CIRRUS_DRV_H__ */

drivers/gpu/drm/cirrus/cirrus_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ bool cirrus_check_framebuffer(struct cirrus_device *cdev, int width, int height,
320320
const int max_pitch = 0x1FF << 3; /* (4096 - 1) & ~111b bytes */
321321
const int max_size = cdev->mc.vram_size;
322322

323+
if (bpp > cirrus_bpp)
324+
return false;
323325
if (bpp > 32)
324326
return false;
325327

drivers/gpu/drm/cirrus/cirrus_mode.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,13 @@ static int cirrus_vga_get_modes(struct drm_connector *connector)
501501
int count;
502502

503503
/* Just add a static list of modes */
504-
count = drm_add_modes_noedid(connector, 1280, 1024);
505-
drm_set_preferred_mode(connector, 1024, 768);
504+
if (cirrus_bpp <= 24) {
505+
count = drm_add_modes_noedid(connector, 1280, 1024);
506+
drm_set_preferred_mode(connector, 1024, 768);
507+
} else {
508+
count = drm_add_modes_noedid(connector, 800, 600);
509+
drm_set_preferred_mode(connector, 800, 600);
510+
}
506511
return count;
507512
}
508513

drivers/gpu/drm/radeon/radeon_benchmark.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434

3535
static int radeon_benchmark_do_move(struct radeon_device *rdev, unsigned size,
3636
uint64_t saddr, uint64_t daddr,
37-
int flag, int n)
37+
int flag, int n,
38+
struct reservation_object *resv)
3839
{
3940
unsigned long start_jiffies;
4041
unsigned long end_jiffies;
@@ -47,12 +48,12 @@ static int radeon_benchmark_do_move(struct radeon_device *rdev, unsigned size,
4748
case RADEON_BENCHMARK_COPY_DMA:
4849
fence = radeon_copy_dma(rdev, saddr, daddr,
4950
size / RADEON_GPU_PAGE_SIZE,
50-
NULL);
51+
resv);
5152
break;
5253
case RADEON_BENCHMARK_COPY_BLIT:
5354
fence = radeon_copy_blit(rdev, saddr, daddr,
5455
size / RADEON_GPU_PAGE_SIZE,
55-
NULL);
56+
resv);
5657
break;
5758
default:
5859
DRM_ERROR("Unknown copy method\n");
@@ -120,7 +121,8 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size,
120121

121122
if (rdev->asic->copy.dma) {
122123
time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
123-
RADEON_BENCHMARK_COPY_DMA, n);
124+
RADEON_BENCHMARK_COPY_DMA, n,
125+
dobj->tbo.resv);
124126
if (time < 0)
125127
goto out_cleanup;
126128
if (time > 0)
@@ -130,7 +132,8 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size,
130132

131133
if (rdev->asic->copy.blit) {
132134
time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
133-
RADEON_BENCHMARK_COPY_BLIT, n);
135+
RADEON_BENCHMARK_COPY_BLIT, n,
136+
dobj->tbo.resv);
134137
if (time < 0)
135138
goto out_cleanup;
136139
if (time > 0)

drivers/gpu/drm/radeon/radeon_display.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,9 @@ void radeon_compute_pll_avivo(struct radeon_pll *pll,
960960
if (pll->flags & RADEON_PLL_USE_FRAC_FB_DIV &&
961961
pll->flags & RADEON_PLL_USE_REF_DIV)
962962
ref_div_max = pll->reference_div;
963+
else if (pll->flags & RADEON_PLL_PREFER_MINM_OVER_MAXP)
964+
/* fix for problems on RS880 */
965+
ref_div_max = min(pll->max_ref_div, 7u);
963966
else
964967
ref_div_max = pll->max_ref_div;
965968

drivers/gpu/drm/radeon/radeon_gem.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ int radeon_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_pri
146146
struct radeon_bo_va *bo_va;
147147
int r;
148148

149-
if (rdev->family < CHIP_CAYMAN) {
149+
if ((rdev->family < CHIP_CAYMAN) ||
150+
(!rdev->accel_working)) {
150151
return 0;
151152
}
152153

@@ -176,7 +177,8 @@ void radeon_gem_object_close(struct drm_gem_object *obj,
176177
struct radeon_bo_va *bo_va;
177178
int r;
178179

179-
if (rdev->family < CHIP_CAYMAN) {
180+
if ((rdev->family < CHIP_CAYMAN) ||
181+
(!rdev->accel_working)) {
180182
return;
181183
}
182184

0 commit comments

Comments
 (0)