[PATCH] drm/exec, drm/gpuvm: Prefer u32 over uint32_t

Jani Nikula jani.nikula at linux.intel.com
Fri Jan 19 15:32:52 UTC 2024


On Fri, 19 Jan 2024, Lucas De Marchi <lucas.demarchi at intel.com> wrote:
> On Fri, Jan 19, 2024 at 10:05:57AM +0100, Thomas Hellström wrote:
>>The relatively recently introduced drm/exec utility was using uint32_t
>>in its interface, which was then also carried over to drm/gpuvm.
>>
>>Prefer u32 in new code and update drm/exec and drm/gpuvm accordingly.
>>
>>Cc: Christian König <christian.koenig at amd.com>
>>Cc: Danilo Krummrich <dakr at redhat.com>
>>Signed-off-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>
>>---
>> drivers/gpu/drm/drm_exec.c | 2 +-
>> include/drm/drm_exec.h     | 4 ++--
>> include/drm/drm_gpuvm.h    | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>
>
> Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>
>
> I was surprised we have quite a few places using the c99 types rather
> than kernel types.
>
> $ git grep -ce uint[0-9][0-9]_t drivers/gpu/drm/*.c
> drivers/gpu/drm/drm_atomic.c:1
> drivers/gpu/drm/drm_atomic_helper.c:7
> drivers/gpu/drm/drm_atomic_state_helper.c:1
> drivers/gpu/drm/drm_atomic_uapi.c:17
> drivers/gpu/drm/drm_color_mgmt.c:4
> drivers/gpu/drm/drm_connector.c:6
> drivers/gpu/drm/drm_crtc.c:3
> drivers/gpu/drm/drm_damage_helper.c:2
> drivers/gpu/drm/drm_debugfs_crc.c:1
> drivers/gpu/drm/drm_exec.c:1
> drivers/gpu/drm/drm_fb_helper.c:10
> drivers/gpu/drm/drm_format_helper.c:6
> drivers/gpu/drm/drm_fourcc.c:6
> drivers/gpu/drm/drm_framebuffer.c:5
> drivers/gpu/drm/drm_gem.c:1
> drivers/gpu/drm/drm_gem_dma_helper.c:1
> drivers/gpu/drm/drm_gem_shmem_helper.c:1
> drivers/gpu/drm/drm_gem_ttm_helper.c:1
> drivers/gpu/drm/drm_gem_vram_helper.c:5
> drivers/gpu/drm/drm_lease.c:6
> drivers/gpu/drm/drm_mipi_dbi.c:3
> drivers/gpu/drm/drm_mode_config.c:4
> drivers/gpu/drm/drm_mode_object.c:20
> drivers/gpu/drm/drm_modeset_helper.c:1
> drivers/gpu/drm/drm_modeset_lock.c:1
> drivers/gpu/drm/drm_of.c:3
> drivers/gpu/drm/drm_plane.c:35
> drivers/gpu/drm/drm_plane_helper.c:2
> drivers/gpu/drm/drm_prime.c:9
> drivers/gpu/drm/drm_probe_helper.c:3
> drivers/gpu/drm/drm_property.c:11
> drivers/gpu/drm/drm_simple_kms_helper.c:4
> drivers/gpu/drm/drm_syncobj.c:26
>
> but maybe not worth the churn for what is already there for a long time?

Personally, I think the one time churn is worth it to unify and keep the
codebase in kernel types only. This is basically what we did in i915
years ago, and new c99 types don't really even creep in because there
are zero examples around. It's natural to follow the style around you
instead of mixing.

BR,
Jani.


-- 
Jani Nikula, Intel


More information about the dri-devel mailing list