On Tue, Apr 9, 2024 at 8:20 AM Kevin O'Connor kevin@koconnor.net wrote:
Introduce stdvga_dac_read_many() and stdvga_dac_write_many() for writing multiple dac palette entries. Convert the stdvga_dac_read() and stdvga_dac_write() low-level IO access functions in stdvgaio.c to access just one color palette entry.
Signed-off-by: Kevin O'Connor kevin@koconnor.net
There should not be any functional change resulting from this patch. However, during mode switches (and a few other rare calls) there will likely be a few more outb() calls due to additional writes to the dac index register. In theory this could adversely impact performance, but in practice I think it is unlikely it will be noticeable. The original code was also not optimized (it already makes a large number of redundant writes to the dac index register), and performance sensitve code already avoids using the vgabios.
Looks reasonable to me, and .red/.green/.blue is definitely more readable than the array indexing. I don't think the performance difference should practically matter either.
Thanks, -- Daniel