News for hackers. Stuff that matters.
Re:The AMD Radeon Graphics Driver Makes Up Roughly 10.5% of ... by deaddodo on Sunday October 11, 2020 @04:25PM (#24748805)
How do you figure? VCN 1.0[0] and VCN 2.0[1] differ within the first few lines and only do so further, the more you compare them. The files seem to correlate to each version of AMD's Video Core Next hardware[2]; and not anything to do with autogeneration.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

[2] https://en.wikipedia.org/wiki/Video_Core_Next

Re:The AMD Radeon Graphics Driver Makes Up Roughly 10.5% of ... by atq2119 on Sunday October 11, 2020 @07:51PM (#24750133)
Actually, there's a lot of commonality between those two files. Just look at all the "is_idle", "get_wptr", "set_wptr" type functions. They're either literally identical or the v2_0 version is a superset of functionality of the v1_0 version.

This is a case where code is identical not by random chance but due to an underlying logical pattern (in this case: ring buffers for communication between CPU and GPU seem to continue working the same way). Hiding that via code duplication is going to make the code overall less maintainable, because the code lacks implicit knowledge of these patterns.

P.S.: It's interesting how many people missed that my complaint was specifically not about the auto-generated part, but about the part that humans copy&paste.

Re:The AMD Radeon Graphics Driver Makes Up Roughly 10.5% of ... by flohofwoe on Monday October 12, 2020 @04:58AM (#24752592)
Code duplication sometimes make sense to better decouple different parts of the code base, however that often only becomes apparent long after the "code cleanup" to remove duplicates has been done.
Re:The AMD Radeon Graphics Driver Makes Up Roughly 10.5% of ... by fulafel on Monday October 12, 2020 @12:12AM (#24751317)
Code duplication this way (versions of code for different hw) is common in Linux though and makes a certain kind of sense.