[PATCH 1/6] drm/amdgpu: add VCN JPEG support amdgpu_ctx_num_entities

Alex Deucher alexdeucher at gmail.com
Fri Nov 30 01:59:09 UTC 2018


On Wed, Nov 28, 2018 at 3:12 AM Christian König
<ckoenig.leichtzumerken at gmail.com> wrote:
>
> Maybe drop patch #2 when you refactor that code in patch #3 and #4 anyway.
>
> On patch #3 I would put the new helper into amdgpu_ctx.c instead because
> that is rather how rings map to userspace queues.
>
> Apart from that it looks good to me.

Doesn't seem to work just yet:

[    7.477741] BUG: unable to handle kernel NULL pointer dereference
at 0000000000000008
[    7.477744] PGD 0 P4D 0
[    7.477748] Oops: 0000 [#1] SMP NOPTI
[    7.477750] CPU: 8 PID: 1246 Comm: gnome-shell Not tainted 4.20.0-rc3+ #535
[    7.477752] Hardware name: System manufacturer System Product
Name/ROG STRIX B350-F GAMING, BIOS 4011 04/19/2018
[    7.477756] RIP: 0010:drm_sched_entity_flush+0x29/0x1c0 [gpu_sched]
[    7.477758] Code: 00 0f 1f 44 00 00 41 55 41 54 55 53 48 89 f5 48
89 fb 48 83 ec 30 65 48 8b 04 25 28 00 00 00 48 89 44 24 28 31 c0 48
8b 47 10 <4c> 8b 60 08 65 48 8b 04 25 00 5c 01 00 f6 40 24 04 0f 84 0f
01 00
[    7.477759] RSP: 0018:ffffafb0c8a2fc38 EFLAGS: 00010246
[    7.477761] RAX: 0000000000000000 RBX: ffff98432457b5f8 RCX: 0000000000001c43
[    7.477762] RDX: 0000000000001c42 RSI: 00000000000003e8 RDI: ffff98432457b5f8
[    7.477763] RBP: 00000000000003e8 R08: 00000000000242e0 R09: ffffffffc0518043
[    7.477764] R10: ffffe1381fe90f40 R11: ffff98433708c920 R12: ffff98433ade8ef8
[    7.477765] R13: ffff984317740000 R14: 0000000000000001 R15: ffffafb0c8a2fd90
[    7.477766] FS:  00007f8b8a778ac0(0000) GS:ffff98433ec00000(0000)
knlGS:0000000000000000
[    7.477768] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    7.477769] CR2: 0000000000000008 CR3: 00000007e594e000 CR4: 00000000003406e0
[    7.477770] Call Trace:
[    7.477776]  ? __radix_tree_delete+0x7d/0xe0
[    7.477778]  drm_sched_entity_destroy+0x13/0x20 [gpu_sched]
[    7.477812]  amdgpu_ctx_do_release+0x23/0x40 [amdgpu]
[    7.477837]  amdgpu_ctx_ioctl+0x234/0x280 [amdgpu]
[    7.477861]  ? amdgpu_ctx_get_entity+0xa0/0xa0 [amdgpu]
[    7.477870]  drm_ioctl_kernel+0xaa/0xf0 [drm]
[    7.477877]  drm_ioctl+0x2e3/0x380 [drm]
[    7.477900]  ? amdgpu_ctx_get_entity+0xa0/0xa0 [amdgpu]
[    7.477903]  ? __do_fault+0x1e/0x119
[    7.477922]  amdgpu_drm_ioctl+0x49/0x80 [amdgpu]
[    7.477927]  do_vfs_ioctl+0xa4/0x630
[    7.477929]  ? handle_mm_fault+0xdc/0x270
[    7.477931]  ksys_ioctl+0x70/0x80
[    7.477933]  __x64_sys_ioctl+0x16/0x20
[    7.477935]  do_syscall_64+0x5b/0x160
[    7.477938]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[    7.477941] RIP: 0033:0x7f8b7fe34577
[    7.477942] Code: b3 66 90 48 8b 05 11 89 2c 00 64 c7 00 26 00 00
00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00
00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 88 2c 00 f7 d8 64 89
01 48
[    7.477943] RSP: 002b:00007ffc0269e108 EFLAGS: 00000246 ORIG_RAX:
0000000000000010
[    7.477944] RAX: ffffffffffffffda RBX: 0000555fce2701d0 RCX: 00007f8b7fe34577
[    7.477945] RDX: 00007ffc0269e170 RSI: 00000000c0106442 RDI: 000000000000000a
[    7.477946] RBP: 00007ffc0269e170 R08: 0000555fce277c00 R09: 000000000001ef50
[    7.477947] R10: 00007f8b800fdb38 R11: 0000000000000246 R12: 00000000c0106442
[    7.477948] R13: 000000000000000a R14: 0000555fce2775c0 R15: 0000000000000000
[    7.477950] Modules linked in: nf_conntrack_netbios_ns
nf_conntrack_broadcast xt_CT ip6t_rpfilter ip6t_REJECT nf_reject_ipv6
xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c
ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc
ip6table_mangle ip6table_raw ip6table_security iptable_mangle
iptable_raw iptable_security ebtable_filter ebtables ip6table_filter
ip6_tables sunrpc vfat fat edac_mce_amd kvm_amd snd_hda_codec_realtek
kvm snd_hda_codec_generic snd_hda_codec_hdmi snd_hda_intel
snd_hda_codec snd_hda_core irqbypass snd_hwdep snd_seq snd_seq_device
snd_pcm crct10dif_pclmul crc32_pclmul eeepc_wmi ghash_clmulni_intel
asus_wmi sparse_keymap snd_timer rfkill joydev ccp snd video
sp5100_tco wmi_bmof pcspkr soundcore k10temp i2c_piix4 pcc_cpufreq
acpi_cpufreq amdgpu chash gpu_sched amd_iommu_v2 ttm drm_kms_helper
igb ptp drm crc32c_intel pps_core dca nvme i2c_algo_bit nvme_core wmi
[    7.477978] CR2: 0000000000000008
[    7.477980] ---[ end trace 9237d2ce370f5585 ]---
[    7.477982] RIP: 0010:drm_sched_entity_flush+0x29/0x1c0 [gpu_sched]
[    7.477983] Code: 00 0f 1f 44 00 00 41 55 41 54 55 53 48 89 f5 48
89 fb 48 83 ec 30 65 48 8b 04 25 28 00 00 00 48 89 44 24 28 31 c0 48
8b 47 10 <4c> 8b 60 08 65 48 8b 04 25 00 5c 01 00 f6 40 24 04 0f 84 0f
01 00
[    7.477984] RSP: 0018:ffffafb0c8a2fc38 EFLAGS: 00010246
[    7.477986] RAX: 0000000000000000 RBX: ffff98432457b5f8 RCX: 0000000000001c43
[    7.477986] RDX: 0000000000001c42 RSI: 00000000000003e8 RDI: ffff98432457b5f8
[    7.477987] RBP: 00000000000003e8 R08: 00000000000242e0 R09: ffffffffc0518043
[    7.477988] R10: ffffe1381fe90f40 R11: ffff98433708c920 R12: ffff98433ade8ef8
[    7.477989] R13: ffff984317740000 R14: 0000000000000001 R15: ffffafb0c8a2fd90
[    7.477991] FS:  00007f8b8a778ac0(0000) GS:ffff98433ec00000(0000)
knlGS:0000000000000000
[    7.477992] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    7.477993] CR2: 0000000000000008 CR3: 00000007e594e000 CR4: 00000000003406e0

Any ideas?

Alex


>
> Christian.
>
> Am 27.11.18 um 22:10 schrieb Alex Deucher:
> > Looks like it was missed when setting support was added.
> >
> > Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> > index f9b54236102d..95f4c4139fc6 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> > @@ -39,6 +39,7 @@ const unsigned int amdgpu_ctx_num_entities[AMDGPU_HW_IP_NUM] = {
> >       [AMDGPU_HW_IP_UVD_ENC]  =       1,
> >       [AMDGPU_HW_IP_VCN_DEC]  =       1,
> >       [AMDGPU_HW_IP_VCN_ENC]  =       1,
> > +     [AMDGPU_HW_IP_VCN_JPEG] =       1,
> >   };
> >
> >   static int amdgput_ctx_total_num_entities(void)
>


More information about the amd-gfx mailing list