RE: [PATCH 2/2] drm/ttm: swap consecutive allocated pooled pages v3
Hold on, only Patch 1 is Reviewed-by: Roger He. For Patch 2: + list_for_each_entry(p, , lru) { + /* Swap the pages if we detect consecutive order */ + if (count > first && pages[count - 1] == p - 1) { + swap(p, pages[count - 1]);// swap seems breaking the plist, after that iteration plist will not work. } pages[count++] = temp; + } -Original Message- From: dri-devel [mailto:dri-devel-boun...@lists.freedesktop.org] On Behalf Of He, Roger Sent: Tuesday, December 05, 2017 10:01 AM To: Christian König ; dri-de...@lists.freedesktop.org; amd-gfx@lists.freedesktop.org Subject: RE: [PATCH 2/2] drm/ttm: swap consecutive allocated pooled pages v3 Series is: Reviewed-by: Roger He Thanks Roger(Hongbo.He) -Original Message- From: Christian König [mailto:ckoenig.leichtzumer...@gmail.com] Sent: Monday, December 04, 2017 8:46 PM To: dri-de...@lists.freedesktop.org; amd-gfx@lists.freedesktop.org; He, Roger Subject: [PATCH 2/2] drm/ttm: swap consecutive allocated pooled pages v3 When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. v2: use swap v3: check if it's really the first allocated page Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 7c4d4edce0ba..da8a50f7c8fe 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -954,8 +954,13 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, r = ttm_page_pool_get_pages(pool, , flags, cstate, npages - count, 0); - list_for_each_entry(p, , lru) + first = count; + list_for_each_entry(p, , lru) { + /* Swap the pages if we detect consecutive order */ + if (count > first && pages[count - 1] == p - 1) + swap(p, pages[count - 1]); pages[count++] = p; + } if (r) { /* If there is any pages in the list put them back to -- 2.11.0 ___ dri-devel mailing list dri-de...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 2/2] drm/ttm: swap consecutive allocated pooled pages v3
Series is: Reviewed-by: Roger HeThanks Roger(Hongbo.He) -Original Message- From: Christian König [mailto:ckoenig.leichtzumer...@gmail.com] Sent: Monday, December 04, 2017 8:46 PM To: dri-de...@lists.freedesktop.org; amd-gfx@lists.freedesktop.org; He, Roger Subject: [PATCH 2/2] drm/ttm: swap consecutive allocated pooled pages v3 When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. v2: use swap v3: check if it's really the first allocated page Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 7c4d4edce0ba..da8a50f7c8fe 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -954,8 +954,13 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, r = ttm_page_pool_get_pages(pool, , flags, cstate, npages - count, 0); - list_for_each_entry(p, , lru) + first = count; + list_for_each_entry(p, , lru) { + /* Swap the pages if we detect consecutive order */ + if (count > first && pages[count - 1] == p - 1) + swap(p, pages[count - 1]); pages[count++] = p; + } if (r) { /* If there is any pages in the list put them back to -- 2.11.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 0/2] Move scheduler out of AMDGPU
On Fri, Dec 1, 2017 at 10:55 AM, Christian Königwrote: > Am 01.12.2017 um 16:28 schrieb Lucas Stach: >> >> Hi all, >> >> so this is the first step to make the marvelous AMDGPU scheduler useable >> for other drivers. I have a (mostly) working prototype of Etnaviv using >> the scheduler, but those patches need to keep baking for a while. >> >> I'm sending this out as I want to avoid rebasing this change too much >> and don't want to take people by surprise when the Etnaviv implementation >> surfaces. Also this might need some coordination between AMDGPU and >> Etnaviv, which might be good to get going now. >> >> Please speak up now if you have any objections or comments. > > > Looks good to me, but question is what is this based upon? > > I strongly assume drm-next, so question is now if we have any patches inside > amd branches we should apply before doing this. We have a bunch of changes queued up which will go usptream for 4.16. See amd-staging-drm-next: https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-drm-next which is a mirror of our main development branch or: https://cgit.freedesktop.org/~agd5f/linux/log/?h=drm-next-4.16-wip which is what is currently queued for 4.16. Alex > > CCing Andrey as well cause he has some tasks assigned around the scheduler > as well. > > Regards, > Christian. > > >> >> Regards, >> Lucas >> >> Lucas Stach (2): >>drm: move amd_gpu_scheduler into common location >>drm/sched: move fence slab handling to module init/exit >> >> drivers/gpu/drm/Kconfig| 5 + >> drivers/gpu/drm/Makefile | 1 + >> drivers/gpu/drm/amd/amdgpu/Makefile| 5 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu.h| 16 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 8 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c| 38 +-- >> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 8 - >> drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c| 22 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 14 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 12 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 20 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_sched.h | 2 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 6 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 8 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h| 4 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c| 8 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h| 4 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c| 8 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h| 2 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c| 14 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h| 4 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +- >> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 4 +- >> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 +- >> drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 8 +- >> drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 8 +- >> drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 185 -- >> drivers/gpu/drm/scheduler/Makefile | 4 + >> .../gpu/drm/{amd => }/scheduler/gpu_scheduler.c| 281 >> +++-- >> drivers/gpu/drm/{amd => }/scheduler/sched_fence.c | 122 + >> include/drm/gpu_scheduler.h| 171 + >> .../drm/gpu_scheduler_trace.h | 14 +- >> 34 files changed, 525 insertions(+), 511 deletions(-) >> delete mode 100644 drivers/gpu/drm/amd/scheduler/gpu_scheduler.h >> create mode 100644 drivers/gpu/drm/scheduler/Makefile >> rename drivers/gpu/drm/{amd => }/scheduler/gpu_scheduler.c (64%) >> rename drivers/gpu/drm/{amd => }/scheduler/sched_fence.c (58%) >> create mode 100644 include/drm/gpu_scheduler.h >> rename drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h => >> include/drm/gpu_scheduler_trace.h (83%) >> > > ___ > dri-devel mailing list > dri-de...@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/3] st/va: rename vlVaSubpictureImage to vlVaSetSubpictureImage
Sent to the incorrect lists. Please ignores. Thanks. On 12/04/2017 03:50 PM, Leo Liu wrote: Following VA spec Signed-off-by: Leo Liu--- src/gallium/state_trackers/va/context.c| 2 +- src/gallium/state_trackers/va/subpicture.c | 2 +- src/gallium/state_trackers/va/va_private.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c index 78e1f19ab7..0ad4309568 100644 --- a/src/gallium/state_trackers/va/context.c +++ b/src/gallium/state_trackers/va/context.c @@ -73,7 +73,7 @@ static struct VADriverVTable vtable = , , , - , + , , , , diff --git a/src/gallium/state_trackers/va/subpicture.c b/src/gallium/state_trackers/va/subpicture.c index 981a99cec5..f531b61dec 100644 --- a/src/gallium/state_trackers/va/subpicture.c +++ b/src/gallium/state_trackers/va/subpicture.c @@ -119,7 +119,7 @@ vlVaDestroySubpicture(VADriverContextP ctx, VASubpictureID subpicture) } VAStatus -vlVaSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image) +vlVaSetSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image) { vlVaDriver *drv; vlVaSubpicture *sub; diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h index 46f6ba66f2..be38c0b88a 100644 --- a/src/gallium/state_trackers/va/va_private.h +++ b/src/gallium/state_trackers/va/va_private.h @@ -364,7 +364,7 @@ VAStatus vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_ unsigned int *flags, unsigned int *num_formats); VAStatus vlVaCreateSubpicture(VADriverContextP ctx, VAImageID image, VASubpictureID *subpicture); VAStatus vlVaDestroySubpicture(VADriverContextP ctx, VASubpictureID subpicture); -VAStatus vlVaSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image); +VAStatus vlVaSetSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image); VAStatus vlVaSetSubpictureChromakey(VADriverContextP ctx, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask); ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 2/3] st/va: use designated initialisers for VA driver functions
Signed-off-by: Leo Liu--- src/gallium/state_trackers/va/context.c | 99 - 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c index 0ad4309568..8c624d05c1 100644 --- a/src/gallium/state_trackers/va/context.c +++ b/src/gallium/state_trackers/va/context.c @@ -40,57 +40,56 @@ static struct VADriverVTable vtable = { - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - NULL, /* DEPRECATED VaGetSurfaceAttributes */ - , - , - , - , + .vaTerminate = , + .vaQueryConfigProfiles = , + .vaQueryConfigEntrypoints = , + .vaGetConfigAttributes = , + .vaCreateConfig = , + .vaDestroyConfig = , + .vaQueryConfigAttributes = , + .vaCreateSurfaces = , + .vaDestroySurfaces = , + .vaCreateContext = , + .vaDestroyContext = , + .vaCreateBuffer = , + .vaBufferSetNumElements = , + .vaMapBuffer = , + .vaUnmapBuffer = , + .vaDestroyBuffer = , + .vaBeginPicture = , + .vaRenderPicture = , + .vaEndPicture = , + .vaSyncSurface = , + .vaQuerySurfaceStatus = , + .vaQuerySurfaceError = , + .vaPutSurface = , + .vaQueryImageFormats = , + .vaCreateImage = , + .vaDeriveImage = , + .vaDestroyImage = , + .vaSetImagePalette = , + .vaGetImage = , + .vaPutImage = , + .vaQuerySubpictureFormats = , + .vaCreateSubpicture = , + .vaDestroySubpicture = , + .vaSetSubpictureImage = , + .vaSetSubpictureChromakey = , + .vaSetSubpictureGlobalAlpha = , + .vaAssociateSubpicture = , + .vaDeassociateSubpicture = , + .vaQueryDisplayAttributes = , + .vaGetDisplayAttributes = , + .vaSetDisplayAttributes = , + .vaBufferInfo = , + .vaLockSurface = , + .vaUnlockSurface = , + .vaCreateSurfaces2 = , + .vaQuerySurfaceAttributes = , + .vaAcquireBufferHandle = , + .vaReleaseBufferHandle = , #if 0 - , + .vaExportSurfaceHandle = , #endif }; -- 2.14.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 3/3] st/va: Enable vaExportSurfaceHandle()
From: Mark ThompsonIt will be present from libva 2.1 (VAAPI 1.1.0 or higher). v2: rebase to previous patches(Leo) Signed-off-by: Mark Thompson Signed-off-by: Leo Liu --- src/gallium/state_trackers/va/context.c | 2 +- src/gallium/state_trackers/va/surface.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c index 8c624d05c1..ad59294010 100644 --- a/src/gallium/state_trackers/va/context.c +++ b/src/gallium/state_trackers/va/context.c @@ -88,7 +88,7 @@ static struct VADriverVTable vtable = .vaQuerySurfaceAttributes = , .vaAcquireBufferHandle = , .vaReleaseBufferHandle = , -#if 0 +#if VA_CHECK_VERSION(1, 1, 0) .vaExportSurfaceHandle = , #endif }; diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c index 636505b720..f9412ce52e 100644 --- a/src/gallium/state_trackers/va/surface.c +++ b/src/gallium/state_trackers/va/surface.c @@ -923,7 +923,7 @@ vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context, return VA_STATUS_SUCCESS; } -#if 0 +#if VA_CHECK_VERSION(1, 1, 0) VAStatus vlVaExportSurfaceHandle(VADriverContextP ctx, VASurfaceID surface_id, -- 2.14.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] drm/amd/display: add mod_freesync_user_enable to dm_connector_state
We don't currently expose variable refresh rate, but add the state to the connector state to make it easier to maintain the support for it from a hw support perspective while we figure out the uapi for drm. Signed-off-by: Alex Deucher--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index c324c3b76fac..b2359bc4900d 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1686,6 +1686,7 @@ struct dm_connector_state { uint8_t underscan_vborder; uint8_t underscan_hborder; bool underscan_enable; + struct mod_freesync_user_enable user_enable; }; #define to_dm_connector_state(x)\ -- 2.13.6 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 1/3] st/va: rename vlVaSubpictureImage to vlVaSetSubpictureImage
Following VA spec Signed-off-by: Leo Liu--- src/gallium/state_trackers/va/context.c| 2 +- src/gallium/state_trackers/va/subpicture.c | 2 +- src/gallium/state_trackers/va/va_private.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c index 78e1f19ab7..0ad4309568 100644 --- a/src/gallium/state_trackers/va/context.c +++ b/src/gallium/state_trackers/va/context.c @@ -73,7 +73,7 @@ static struct VADriverVTable vtable = , , , - , + , , , , diff --git a/src/gallium/state_trackers/va/subpicture.c b/src/gallium/state_trackers/va/subpicture.c index 981a99cec5..f531b61dec 100644 --- a/src/gallium/state_trackers/va/subpicture.c +++ b/src/gallium/state_trackers/va/subpicture.c @@ -119,7 +119,7 @@ vlVaDestroySubpicture(VADriverContextP ctx, VASubpictureID subpicture) } VAStatus -vlVaSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image) +vlVaSetSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image) { vlVaDriver *drv; vlVaSubpicture *sub; diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h index 46f6ba66f2..be38c0b88a 100644 --- a/src/gallium/state_trackers/va/va_private.h +++ b/src/gallium/state_trackers/va/va_private.h @@ -364,7 +364,7 @@ VAStatus vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_ unsigned int *flags, unsigned int *num_formats); VAStatus vlVaCreateSubpicture(VADriverContextP ctx, VAImageID image, VASubpictureID *subpicture); VAStatus vlVaDestroySubpicture(VADriverContextP ctx, VASubpictureID subpicture); -VAStatus vlVaSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image); +VAStatus vlVaSetSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image); VAStatus vlVaSetSubpictureChromakey(VADriverContextP ctx, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask); -- 2.14.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm: amd: dc: don't use FP math when Kcov is enabled
On 2017-12-04 08:08 AM, Arnd Bergmann wrote: > Building the DCN 1.0 Raven display driver with CONFIG_KCOV_INSTRUMENT_ALL=y > and CONFIG_KCOV_ENABLE_COMPARISONS=y results in warnings about many functions > that do a comparison of floating-point variables: > > drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function > `dcn_bw_calc_rq_dlg_ttu': > dcn_calcs.c:(.text+0x263): undefined reference to `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function > `hack_force_pipe_split': > dcn_calcs.c:(.text+0x155b): undefined reference to > `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function > `dcn_find_dcfclk_suits_all': > dcn_calcs.c:(.text+0x190e): undefined reference to > `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function > `dcn_validate_bandwidth': > dcn_calcs.c:(.text+0xe121): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function > `dcn_bw_mod': > dcn_calc_math.c:(.text+0x22): undefined reference to > `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function > `dcn_bw_min2': > dcn_calc_math.c:(.text+0xb2): undefined reference to > `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function > `dcn_bw_ceil2': > dcn_calc_math.c:(.text+0x2a0): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function > `dcn_bw_max3': > dcn_calc_math.c:(.text+0x325): undefined reference to > `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function > `dcn_bw_max5': > dcn_calc_math.c:(.text+0x3c3): undefined reference to > `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function > `dcn_bw_log': > dcn_calc_math.c:(.text+0x54e): undefined reference to > `__sanitizer_cov_trace_cmpd' > dcn_calc_math.c:(.text+0x57c): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `scaler_settings_calculation': > dcn_calc_auto.c:(.text+0x5c5): undefined reference to > `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `mode_support_and_system_configuration': > dcn_calc_auto.c:(.text+0x137c): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `mode_support_and_system_configuration': > dcn_calc_auto.c:(.text+0x9233): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `mode_support_and_system_configuration': > dcn_calc_auto.c:(.text+0xb70f): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `mode_support_and_system_configuration': > dcn_calc_auto.c:(.text+0x121fd): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `display_pipe_configuration': > dcn_calc_auto.c:(.text+0x15a2f): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation': > dcn_calc_auto.c:(.text+0x17c2d): undefined reference to > `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation': > dcn_calc_auto.c:(.text+0x19362): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation': > dcn_calc_auto.c:(.text+0x25575): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function > `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation': > dcn_calc_auto.c:(.text+0x27f33): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function > `get_refcyc_per_delivery': > display_rq_dlg_calc.c:(.text+0xb5): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function > `calculate_ttu_cursor.isra.1': > display_rq_dlg_calc.c:(.text+0x9f6): undefined reference to > `__sanitizer_cov_trace_cmpd' > drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function > `dml_rq_dlg_get_dlg_params': > display_rq_dlg_calc.c:(.text+0x82cc): undefined reference to > `__sanitizer_cov_trace_cmpf' > drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function >
Re: [PATCH libdrm 3/3] amdgpu: Only remember the device's marketing name
On Fri, Dec 1, 2017 at 11:56 AM, Michel Dänzerwrote: > From: Michel Dänzer > > There's no point in keeping around the full table of marketing names, > when amdgpu_get_marketing_name only ever returns the device's marketing > name. > > Signed-off-by: Michel Dänzer Series is: Reviewed-by: Alex Deucher > --- > amdgpu/Android.mk| 3 +- > amdgpu/Makefile.am | 5 +-- > amdgpu/amdgpu_asic_id.c | 88 > > amdgpu/amdgpu_device.c | 23 ++--- > amdgpu/amdgpu_internal.h | 11 ++ > 5 files changed, 28 insertions(+), 102 deletions(-) > > diff --git a/amdgpu/Android.mk b/amdgpu/Android.mk > index ce273019..1f028d0b 100644 > --- a/amdgpu/Android.mk > +++ b/amdgpu/Android.mk > @@ -11,8 +11,7 @@ LOCAL_SHARED_LIBRARIES := libdrm > LOCAL_SRC_FILES := $(LIBDRM_AMDGPU_FILES) > > LOCAL_CFLAGS := \ > - -DAMDGPU_ASIC_ID_TABLE=\"/vendor/etc/hwdata/amdgpu.ids\" \ > - -DAMDGPU_ASIC_ID_TABLE_NUM_ENTRIES=$(shell egrep -ci > '^[0-9a-f]{4},.*[0-9a-f]+,' $(LIBDRM_TOP)/data/amdgpu.ids) > + -DAMDGPU_ASIC_ID_TABLE=\"/vendor/etc/hwdata/amdgpu.ids\" > > LOCAL_REQUIRED_MODULES := amdgpu.ids > > diff --git a/amdgpu/Makefile.am b/amdgpu/Makefile.am > index 66f6f676..a1b0d05c 100644 > --- a/amdgpu/Makefile.am > +++ b/amdgpu/Makefile.am > @@ -31,10 +31,7 @@ AM_CFLAGS = \ > -I$(top_srcdir)/include/drm > > libdrmdatadir = @libdrmdatadir@ > -ASIC_ID_TABLE_NUM_ENTRIES := $(shell egrep -ci '^[0-9a-f]{4},.*[0-9a-f]+,' \ > - $(top_srcdir)/data/amdgpu.ids) > -AM_CPPFLAGS = -DAMDGPU_ASIC_ID_TABLE=\"${libdrmdatadir}/amdgpu.ids\" \ > - -DAMDGPU_ASIC_ID_TABLE_NUM_ENTRIES=$(ASIC_ID_TABLE_NUM_ENTRIES) > +AM_CPPFLAGS = -DAMDGPU_ASIC_ID_TABLE=\"${libdrmdatadir}/amdgpu.ids\" > > libdrm_amdgpu_la_LTLIBRARIES = libdrm_amdgpu.la > libdrm_amdgpu_ladir = $(libdir) > diff --git a/amdgpu/amdgpu_asic_id.c b/amdgpu/amdgpu_asic_id.c > index 0b5f2962..0c8925e5 100644 > --- a/amdgpu/amdgpu_asic_id.c > +++ b/amdgpu/amdgpu_asic_id.c > @@ -38,11 +38,13 @@ > #include "amdgpu_drm.h" > #include "amdgpu_internal.h" > > -static int parse_one_line(const char *line, struct amdgpu_asic_id *id) > +static int parse_one_line(struct amdgpu_device *dev, const char *line) > { > char *buf, *saveptr; > char *s_did; > + uint32_t did; > char *s_rid; > + uint32_t rid; > char *s_name; > char *endptr; > int r = -EINVAL; > @@ -60,19 +62,29 @@ static int parse_one_line(const char *line, struct > amdgpu_asic_id *id) > if (!s_did) > goto out; > > - id->did = strtol(s_did, , 16); > + did = strtol(s_did, , 16); > if (*endptr) > goto out; > > + if (did != dev->info.asic_id) { > + r = -EAGAIN; > + goto out; > + } > + > /* revision id */ > s_rid = strtok_r(NULL, ",", ); > if (!s_rid) > goto out; > > - id->rid = strtol(s_rid, , 16); > + rid = strtol(s_rid, , 16); > if (*endptr) > goto out; > > + if (rid != dev->info.pci_rev_id) { > + r = -EAGAIN; > + goto out; > + } > + > /* marketing name */ > s_name = strtok_r(NULL, ",", ); > if (!s_name) > @@ -84,8 +96,8 @@ static int parse_one_line(const char *line, struct > amdgpu_asic_id *id) > if (strlen(s_name) == 0) > goto out; > > - id->marketing_name = strdup(s_name); > - if (id->marketing_name) > + dev->marketing_name = strdup(s_name); > + if (dev->marketing_name) > r = 0; > else > r = -ENOMEM; > @@ -96,17 +108,13 @@ out: > return r; > } > > -void amdgpu_parse_asic_ids(struct amdgpu_asic_id **p_asic_id_table) > +void amdgpu_parse_asic_ids(struct amdgpu_device *dev) > { > - struct amdgpu_asic_id *asic_id_table; > - struct amdgpu_asic_id *id; > FILE *fp; > char *line = NULL; > size_t len = 0; > ssize_t n; > int line_num = 1; > - size_t table_size = 0; > - size_t table_max_size = AMDGPU_ASIC_ID_TABLE_NUM_ENTRIES; > int r = 0; > > fp = fopen(AMDGPU_ASIC_ID_TABLE, "r"); > @@ -116,13 +124,6 @@ void amdgpu_parse_asic_ids(struct amdgpu_asic_id > **p_asic_id_table) > return; > } > > - asic_id_table = calloc(table_max_size + 1, > - sizeof(struct amdgpu_asic_id)); > - if (!asic_id_table) { > - r = -ENOMEM; > - goto close; > - } > - > /* 1st valid line is file version */ > while ((n = getline(, , fp)) != -1) { > /* trim trailing newline */ > @@ -140,52 +141,17 @@ void amdgpu_parse_asic_ids(struct amdgpu_asic_id > **p_asic_id_table) > } > >
Re: [PATCH 0/4] Backported amdgpu ttm deadlock fixes for 4.14
On Thu, Nov 30, 2017 at 07:23:02PM -0500, Lyude Paul wrote: > I haven't gone to see where it started, but as of late a good number of > pretty nasty deadlock issues have appeared with the kernel. Easy > reproduction recipe on a laptop with i915/amdgpu prime with lockdep enabled: > > DRI_PRIME=1 glxinfo > > Additionally, some more race conditions exist that I've managed to > trigger with piglit and lockdep enabled after applying these patches: > > = > WARNING: suspicious RCU usage > 4.14.3Lyude-Test+ #2 Not tainted > - > ./include/linux/reservation.h:216 suspicious rcu_dereference_protected() > usage! > > other info that might help us debug this: > > rcu_scheduler_active = 2, debug_locks = 1 > 1 lock held by ext_image_dma_b/27451: > #0: (reservation_ww_class_mutex){+.+.}, at: [] > ttm_bo_unref+0x9f/0x3c0 [ttm] > > stack backtrace: > CPU: 0 PID: 27451 Comm: ext_image_dma_b Not tainted 4.14.3Lyude-Test+ #2 > Hardware name: HP HP ZBook 15 G4/8275, BIOS P70 Ver. 01.02 06/09/2017 > Call Trace: > dump_stack+0x8e/0xce > lockdep_rcu_suspicious+0xc5/0x100 > reservation_object_copy_fences+0x292/0x2b0 > ? ttm_bo_unref+0x9f/0x3c0 [ttm] > ttm_bo_unref+0xbd/0x3c0 [ttm] > amdgpu_bo_unref+0x2a/0x50 [amdgpu] > amdgpu_gem_object_free+0x4b/0x50 [amdgpu] > drm_gem_object_free+0x1f/0x40 [drm] > drm_gem_object_put_unlocked+0x40/0xb0 [drm] > drm_gem_object_handle_put_unlocked+0x6c/0xb0 [drm] > drm_gem_object_release_handle+0x51/0x90 [drm] > drm_gem_handle_delete+0x5e/0x90 [drm] > ? drm_gem_handle_create+0x40/0x40 [drm] > drm_gem_close_ioctl+0x20/0x30 [drm] > drm_ioctl_kernel+0x5d/0xb0 [drm] > drm_ioctl+0x2f7/0x3b0 [drm] > ? drm_gem_handle_create+0x40/0x40 [drm] > ? trace_hardirqs_on_caller+0xf4/0x190 > ? trace_hardirqs_on+0xd/0x10 > amdgpu_drm_ioctl+0x4f/0x90 [amdgpu] > do_vfs_ioctl+0x93/0x670 > ? __fget+0x108/0x1f0 > SyS_ioctl+0x79/0x90 > entry_SYSCALL_64_fastpath+0x23/0xc2 > > I've also added the relevant fixes for the issue mentioned above. > > Christian König (3): > drm/ttm: fix ttm_bo_cleanup_refs_or_queue once more > dma-buf: make reservation_object_copy_fences rcu save > drm/amdgpu: reserve root PD while releasing it > > Michel Dänzer (1): > drm/ttm: Always and only destroy bo->ttm_resv in ttm_bo_release_list All now queued up, thanks. greg k-h ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] drm: amd: dc: don't use FP math when Kcov is enabled
Building the DCN 1.0 Raven display driver with CONFIG_KCOV_INSTRUMENT_ALL=y and CONFIG_KCOV_ENABLE_COMPARISONS=y results in warnings about many functions that do a comparison of floating-point variables: drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_bw_calc_rq_dlg_ttu': dcn_calcs.c:(.text+0x263): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `hack_force_pipe_split': dcn_calcs.c:(.text+0x155b): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_find_dcfclk_suits_all': dcn_calcs.c:(.text+0x190e): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_validate_bandwidth': dcn_calcs.c:(.text+0xe121): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_mod': dcn_calc_math.c:(.text+0x22): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_min2': dcn_calc_math.c:(.text+0xb2): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_ceil2': dcn_calc_math.c:(.text+0x2a0): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max3': dcn_calc_math.c:(.text+0x325): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max5': dcn_calc_math.c:(.text+0x3c3): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_log': dcn_calc_math.c:(.text+0x54e): undefined reference to `__sanitizer_cov_trace_cmpd' dcn_calc_math.c:(.text+0x57c): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `scaler_settings_calculation': dcn_calc_auto.c:(.text+0x5c5): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration': dcn_calc_auto.c:(.text+0x137c): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration': dcn_calc_auto.c:(.text+0x9233): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration': dcn_calc_auto.c:(.text+0xb70f): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration': dcn_calc_auto.c:(.text+0x121fd): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `display_pipe_configuration': dcn_calc_auto.c:(.text+0x15a2f): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation': dcn_calc_auto.c:(.text+0x17c2d): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation': dcn_calc_auto.c:(.text+0x19362): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation': dcn_calc_auto.c:(.text+0x25575): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation': dcn_calc_auto.c:(.text+0x27f33): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `get_refcyc_per_delivery': display_rq_dlg_calc.c:(.text+0xb5): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `calculate_ttu_cursor.isra.1': display_rq_dlg_calc.c:(.text+0x9f6): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `dml_rq_dlg_get_dlg_params': display_rq_dlg_calc.c:(.text+0x82cc): undefined reference to `__sanitizer_cov_trace_cmpf' drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_refcyc_per_delivery.isra.0': dml1_display_rq_dlg_calc.c:(.text+0x6c4): undefined reference to `__sanitizer_cov_trace_cmpd' drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_vratio_pre.isra.2': dml1_display_rq_dlg_calc.c:(.text+0x957):
Re: [PATCH 1/2] drm/ttm: swap consecutive allocated cached pages v3
On 2017-12-04 01:46 PM, Christian König wrote: > When we detect consecutive allocation of pages swap them to avoid > accidentally freeing them as huge page. > > v2: use swap > v3: check if it's really the first allocated page > > Signed-off-by: Christian König> --- > drivers/gpu/drm/ttm/ttm_page_alloc.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c > b/drivers/gpu/drm/ttm/ttm_page_alloc.c > index c82d94cbbabc..7c4d4edce0ba 100644 > --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c > +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c > @@ -875,7 +875,7 @@ static int ttm_get_pages(struct page **pages, unsigned > npages, int flags, > #endif > struct list_head plist; > struct page *p = NULL; > - unsigned count; > + unsigned count, first; > int r; > > /* No pool for cached pages */ > @@ -914,6 +914,7 @@ static int ttm_get_pages(struct page **pages, unsigned > npages, int flags, > } > #endif > > + first = i; > while (npages) { > p = alloc_page(gfp_flags); > if (!p) { > @@ -921,6 +922,10 @@ static int ttm_get_pages(struct page **pages, unsigned > npages, int flags, > return -ENOMEM; > } > > + /* Swap the pages if we detect consecutive order */ > + if (i > first && pages[i - 1] == p - 1) > + swap(p, pages[i - 1]); > + > pages[i++] = p; > --npages; > } > Both patches are Reviewed-by: Michel Dänzer -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdkfd: Fix printing pointer cast
Thanks. This change is Reviewed-by: Felix KuehlingOn 2017-12-04 06:50 AM, Kent Russell wrote: > Just print a pointer instead of casting > > v2: Remove the 0x prefix, since %p prints that automatically, and remove > it from one other spot as well > > Change-Id: I0564230d2985e703d59201832f50358da3b67afc > Signed-off-by: Kent Russell > --- > drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | 9 - > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c > b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c > index feb76c2..ebb4da14 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c > @@ -116,8 +116,7 @@ int kfd_doorbell_init(struct kfd_dev *kfd) > pr_debug("doorbell aperture size == 0x%08lX\n", > kfd->shared_resources.doorbell_aperture_size); > > - pr_debug("doorbell kernel address == 0x%08lX\n", > - (uintptr_t)kfd->doorbell_kernel_ptr); > + pr_debug("doorbell kernel address == %p\n", kfd->doorbell_kernel_ptr); > > return 0; > } > @@ -194,8 +193,8 @@ u32 __iomem *kfd_get_kernel_doorbell(struct kfd_dev *kfd, > > pr_debug("Get kernel queue doorbell\n" >" doorbell offset == 0x%08X\n" > - " kernel address== 0x%08lX\n", > - *doorbell_off, (uintptr_t)(kfd->doorbell_kernel_ptr + inx)); > + " kernel address== %p\n", > + *doorbell_off, (kfd->doorbell_kernel_ptr + inx)); > > return kfd->doorbell_kernel_ptr + inx; > } > @@ -215,7 +214,7 @@ inline void write_kernel_doorbell(u32 __iomem *db, u32 > value) > { > if (db) { > writel(value, db); > - pr_debug("Writing %d to doorbell address 0x%p\n", value, db); > + pr_debug("Writing %d to doorbell address %p\n", value, db); > } > } > ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH umr] Allow specifying virtual devices now
Now you can specify a device not present in the system for the purposes of using the --lookup command (also -lr and -lb). Handy for decoding register dumps for ASICs you don't have access to. Simply use the --force command with a '.' prefix, e.g. umr -f .vega10 -lb Can be combined with NPI scripts as well, e.g. umr -f .@/home/user/device.npi -lb Signed-off-by: Tom St Denis--- doc/umr.1 | 5 - src/lib/discover.c | 8 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/umr.1 b/doc/umr.1 index eb1b88bea8d0..eac77798d758 100644 --- a/doc/umr.1 +++ b/doc/umr.1 @@ -16,7 +16,10 @@ where 0 is the first card probed. Select a GFX INSTANCE/SH/SE bank in decimal. Can use 'x' to denote a broadcast selection. .IP "--force -f " Force a PCIE Device ID in hex or by asic name. This is used in case the amdgpu driver -is not yet loaded or a display is not yet attached. +is not yet loaded or a display is not yet attached. A '@' prefix will specify a path to + an NPI script, for instance, '@/home/user/device.npi'. A '.' prefix will specify a virtual +device which is handy for looking up register decodings for a device not present in the system, +for instance, '.vega10'. .IP "--pci " Force a specific PCI device using the domain:bus:slot.function format in hex. This is useful when more than one GPU is available. If the amdgpu driver is diff --git a/src/lib/discover.c b/src/lib/discover.c index bf6d9fc00c35..e1ccea1d20e4 100644 --- a/src/lib/discover.c +++ b/src/lib/discover.c @@ -103,6 +103,14 @@ struct umr_asic *umr_discover_asic(struct umr_options *options) long trydid = options->forcedid; int busmatch = 0, parsed_did, need_config_scan = 0; + // virtual device + if (options->dev_name[0] == '.') { + asic = umr_discover_asic_by_name(options, options->dev_name + 1); + if (asic) + asic->options = *options; + return asic; + } + // Try to map to instance if we have a specific pci device if (options->pci.domain || options->pci.bus || options->pci.slot || options->pci.func) { -- 2.12.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 1/2] drm/ttm: swap consecutive allocated cached pages v3
When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. v2: use swap v3: check if it's really the first allocated page Signed-off-by: Christian König--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index c82d94cbbabc..7c4d4edce0ba 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -875,7 +875,7 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, #endif struct list_head plist; struct page *p = NULL; - unsigned count; + unsigned count, first; int r; /* No pool for cached pages */ @@ -914,6 +914,7 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, } #endif + first = i; while (npages) { p = alloc_page(gfp_flags); if (!p) { @@ -921,6 +922,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, return -ENOMEM; } + /* Swap the pages if we detect consecutive order */ + if (i > first && pages[i - 1] == p - 1) + swap(p, pages[i - 1]); + pages[i++] = p; --npages; } -- 2.11.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 2/2] drm/ttm: swap consecutive allocated pooled pages v3
When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. v2: use swap v3: check if it's really the first allocated page Signed-off-by: Christian König--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 7c4d4edce0ba..da8a50f7c8fe 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -954,8 +954,13 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, r = ttm_page_pool_get_pages(pool, , flags, cstate, npages - count, 0); - list_for_each_entry(p, , lru) + first = count; + list_for_each_entry(p, , lru) { + /* Swap the pages if we detect consecutive order */ + if (count > first && pages[count - 1] == p - 1) + swap(p, pages[count - 1]); pages[count++] = p; + } if (r) { /* If there is any pages in the list put them back to -- 2.11.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 1/2] drm/ttm: swap consecutive allocated cached pages v2
-Original Message- From: Christian König [mailto:ckoenig.leichtzumer...@gmail.com] Sent: Monday, December 04, 2017 8:13 PM To: dri-de...@lists.freedesktop.org; amd-gfx@lists.freedesktop.org; He, Roger; ckoenig.leichtzumer...@gmail.com Subject: [PATCH 1/2] drm/ttm: swap consecutive allocated cached pages v2 When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. v2: use swap Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index c82d94cbbabc..b6c5148607e9 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -921,6 +921,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, return -ENOMEM; } How about add first index as below? first = i; //init first here while (npages) { p = alloc_page(gfp_flags); if (!p) { pr_debug("Unable to allocate page\n"); return -ENOMEM; } /* Swap the pages if we detect consecutive order */ if (i > first && pages[i - 1] == p - 1) //change to (i > first), because I worry if npages is 513, the first regular page is exactly consecutive with last page of huge page. Then swap them is not what I want here. swap(p, pages[i - 1]); pages[i++] = p; --npages; } pages[i++] = p; --npages; } -- 2.11.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/2] drm/ttm: swap consecutive allocated cached pages
Am 04.12.2017 um 12:51 schrieb Michel Dänzer: On 2017-12-04 12:42 PM, Christian König wrote: When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. Signed-off-by: Christian König--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index c82d94cbbabc..60401350a01a 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -921,6 +921,14 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, return -ENOMEM; } + /* Swap the pages if we detect consecutive order */ + if (i && pages[i - 1] == p - 1) { + struct page *tmp = p; + + p = pages[i - 1]; + pages[i - 1] = tmp; + } + Should be (something like): if (i && pages[i - 1] == p - 1) swap(pages[i - 1], p); Good point, updates patches send out a few seconds ago. Please review, Christian. ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 1/2] drm/ttm: swap consecutive allocated cached pages v2
When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. v2: use swap Signed-off-by: Christian König--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index c82d94cbbabc..b6c5148607e9 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -921,6 +921,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, return -ENOMEM; } + /* Swap the pages if we detect consecutive order */ + if (i && pages[i - 1] == p - 1) + swap(p, pages[i - 1]); + pages[i++] = p; --npages; } -- 2.11.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 2/2] drm/ttm: swap consecutive allocated pooled pages v2
When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. v2: use swap Signed-off-by: Christian König--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index b6c5148607e9..29652b2615a8 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -953,8 +953,12 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, r = ttm_page_pool_get_pages(pool, , flags, cstate, npages - count, 0); - list_for_each_entry(p, , lru) + list_for_each_entry(p, , lru) { + /* Swap the pages if we detect consecutive order */ + if (count && pages[count - 1] == p - 1) + swap(p, pages[count - 1]); pages[count++] = p; + } if (r) { /* If there is any pages in the list put them back to -- 2.11.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/2] drm/ttm: swap consecutive allocated cached pages
On 2017-12-04 12:42 PM, Christian König wrote: > When we detect consecutive allocation of pages swap them to avoid > accidentally freeing them as huge page. > > Signed-off-by: Christian König> --- > drivers/gpu/drm/ttm/ttm_page_alloc.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c > b/drivers/gpu/drm/ttm/ttm_page_alloc.c > index c82d94cbbabc..60401350a01a 100644 > --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c > +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c > @@ -921,6 +921,14 @@ static int ttm_get_pages(struct page **pages, unsigned > npages, int flags, > return -ENOMEM; > } > > + /* Swap the pages if we detect consecutive order */ > + if (i && pages[i - 1] == p - 1) { > + struct page *tmp = p; > + > + p = pages[i - 1]; > + pages[i - 1] = tmp; > + } > + Should be (something like): if (i && pages[i - 1] == p - 1) swap(pages[i - 1], p); -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] drm/amdkfd: Fix printing pointer cast
Just print a pointer instead of casting v2: Remove the 0x prefix, since %p prints that automatically, and remove it from one other spot as well Change-Id: I0564230d2985e703d59201832f50358da3b67afc Signed-off-by: Kent Russell--- drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c index feb76c2..ebb4da14 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c @@ -116,8 +116,7 @@ int kfd_doorbell_init(struct kfd_dev *kfd) pr_debug("doorbell aperture size == 0x%08lX\n", kfd->shared_resources.doorbell_aperture_size); - pr_debug("doorbell kernel address == 0x%08lX\n", - (uintptr_t)kfd->doorbell_kernel_ptr); + pr_debug("doorbell kernel address == %p\n", kfd->doorbell_kernel_ptr); return 0; } @@ -194,8 +193,8 @@ u32 __iomem *kfd_get_kernel_doorbell(struct kfd_dev *kfd, pr_debug("Get kernel queue doorbell\n" " doorbell offset == 0x%08X\n" -" kernel address== 0x%08lX\n", - *doorbell_off, (uintptr_t)(kfd->doorbell_kernel_ptr + inx)); +" kernel address== %p\n", + *doorbell_off, (kfd->doorbell_kernel_ptr + inx)); return kfd->doorbell_kernel_ptr + inx; } @@ -215,7 +214,7 @@ inline void write_kernel_doorbell(u32 __iomem *db, u32 value) { if (db) { writel(value, db); - pr_debug("Writing %d to doorbell address 0x%p\n", value, db); + pr_debug("Writing %d to doorbell address %p\n", value, db); } } -- 2.7.4 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 2/2] drm/ttm: swap consecutive allocated pooled pages
When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. Signed-off-by: Christian König--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 60401350a01a..909028fd663d 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -957,8 +957,16 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, r = ttm_page_pool_get_pages(pool, , flags, cstate, npages - count, 0); - list_for_each_entry(p, , lru) + list_for_each_entry(p, , lru) { + /* Swap the pages if we detect consecutive order */ + if (count && pages[count - 1] == p - 1) { + struct page *tmp = p; + + p = pages[count - 1]; + pages[count - 1] = tmp; + } pages[count++] = p; + } if (r) { /* If there is any pages in the list put them back to -- 2.11.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 1/2] drm/ttm: swap consecutive allocated cached pages
When we detect consecutive allocation of pages swap them to avoid accidentally freeing them as huge page. Signed-off-by: Christian König--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index c82d94cbbabc..60401350a01a 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -921,6 +921,14 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, return -ENOMEM; } + /* Swap the pages if we detect consecutive order */ + if (i && pages[i - 1] == p - 1) { + struct page *tmp = p; + + p = pages[i - 1]; + pages[i - 1] = tmp; + } + pages[i++] = p; --npages; } -- 2.11.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 0/2] Move scheduler out of AMDGPU
Hi, Am Samstag, den 02.12.2017, 12:14 + schrieb Liu, Monk: > I'm wondering if GPU reset still work after this home move ... Why wouldn't it continue to work? After all this is just a code move that doesn't change anything about the inner workings of the scheduler. Regards, Lucas > > -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On > Behalf Of Christian K?nig > Sent: Friday, December 1, 2017 11:55 PM > To: Lucas Stach; Deucher, Alexander er.deuc...@amd.com> > Cc: Grodzovsky, Andrey ; David Airlie l...@linux.ie>; amd-gfx@lists.freedesktop.org; patchwork-lst@pengutro > nix.de; dri-de...@lists.freedesktop.org; ker...@pengutronix.de > Subject: Re: [PATCH 0/2] Move scheduler out of AMDGPU > > Am 01.12.2017 um 16:28 schrieb Lucas Stach: > > Hi all, > > > > so this is the first step to make the marvelous AMDGPU scheduler > > useable for other drivers. I have a (mostly) working prototype of > > Etnaviv using the scheduler, but those patches need to keep baking > > for a while. > > > > I'm sending this out as I want to avoid rebasing this change too > > much > > and don't want to take people by surprise when the Etnaviv > > implementation surfaces. Also this might need some coordination > > between AMDGPU and Etnaviv, which might be good to get going now. > > > > Please speak up now if you have any objections or comments. > > Looks good to me, but question is what is this based upon? > > I strongly assume drm-next, so question is now if we have any patches > inside amd branches we should apply before doing this. > > CCing Andrey as well cause he has some tasks assigned around the > scheduler as well. > > Regards, > Christian. > > > > > Regards, > > Lucas > > > > Lucas Stach (2): > > drm: move amd_gpu_scheduler into common location > > drm/sched: move fence slab handling to module init/exit > > > > drivers/gpu/drm/Kconfig| 5 + > > drivers/gpu/drm/Makefile | 1 + > > drivers/gpu/drm/amd/amdgpu/Makefile| 5 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu.h| 16 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 8 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c| 38 +-- > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 8 - > > drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_job.c| 22 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 14 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 12 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 20 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_sched.h | 2 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 6 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 8 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h| 4 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c| 8 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h| 4 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c| 8 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h| 2 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c| 14 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h| 4 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +- > > drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 4 +- > > drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 +- > > drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 8 +- > > drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 8 +- > > drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 185 > > -- > > drivers/gpu/drm/scheduler/Makefile | 4 + > > .../gpu/drm/{amd => }/scheduler/gpu_scheduler.c| 281 > > +++-- > > drivers/gpu/drm/{amd => }/scheduler/sched_fence.c | 122 +--- > > - > > include/drm/gpu_scheduler.h| 171 > > + > > .../drm/gpu_scheduler_trace.h | 14 +- > > 34 files changed, 525 insertions(+), 511 deletions(-) > > delete mode 100644 drivers/gpu/drm/amd/scheduler/gpu_scheduler.h > > create mode 100644 drivers/gpu/drm/scheduler/Makefile > > rename drivers/gpu/drm/{amd => }/scheduler/gpu_scheduler.c (64%) > > rename drivers/gpu/drm/{amd => }/scheduler/sched_fence.c (58%) > > create mode 100644 include/drm/gpu_scheduler.h > > rename drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h => > > include/drm/gpu_scheduler_trace.h (83%) > > > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list