RE: similar files amd vs radeon

From: Deucher, Alexander
Date: Tue Sep 08 2015 - 23:26:59 EST


> -----Original Message-----
> From: Peter Senna Tschudin [mailto:peter.senna@xxxxxxxxx]
> Sent: Monday, September 07, 2015 11:09 AM
> To: David Airlie; Deucher, Alexander; Koenig, Christian; Zhou, Jammy; dri-
> devel@xxxxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: similar files amd vs radeon
>
> I executed a clone detection tool* on drivers source code and I found
> that there are similar files between drivers/gpu/drm/amd/ and
> drivers/gpu/drm/radeon, but also inside each of theses folders.
>
> Some examples:
> drivers/gpu/drm/amd/amdgpu/dce_v11_0.c,drivers/gpu/drm/amd/amdgpu
> /dce_v10_0.c
> drivers/gpu/drm/amd/amdgpu/ci_dpm.c,drivers/gpu/drm/radeon/ci_dpm.c
> drivers/gpu/drm/radeon/kv_dpm.c,drivers/gpu/drm/amd/amdgpu/kv_dpm
> .c
>
> I use meld for seeing the differences and similarities. More results
> from the tool at: http://pastebin.com/iX3fhifG (The number on the
> first field is the number of probable cloned lines of code).
>
> Should these files be consolidated? And if so how?

No, they shouldn't be. Amdgpu was forked from radeon to restructure the driver and support new asics. However, due to the nature of the restructuring and our past experience with radeon, there's not much more we'd like to consolidate. We did the initial prototyping and bring up for amdgpu on CI parts (ci and kv) which are already supported in radeon since we wanted to use an asic that was already well supported in radeon so we had a good working base to compare against as we brought up the new driver. The CI support in amdgpu however can be conditionally compiled out to avoid duplication of support. The dce files are for specific versions of the display hw block. Each hardware version is similar, but there are enough version specific differences that I'd rather not further consolidate the code to avoid bug fixes in one version regressing features in another version.

Alex

>
> Thank you,
>
> Peter
>
> * https://github.com/petersenna/ccfinderx-core
>
> --
> Peter
N‹§²æ¸›yú²X¬¶ÇvØ–)Þ{.nlj·¥Š{±‘êX§¶›¡Ü}©ž²ÆzÚj:+v‰¨¾«‘êZ+€Êzf£¢·hšˆ§~†­†Ûÿû®w¥¢¸?™¨è&¢)ßf”ùy§m…á«a¶Úÿ 0¶ìå