Gamma correction - missing gray values

Due to the gamma correction, some gray levels are lost. For example, if I gamma encode 255, and then decode, I obtain 255.
However, if I gamma encode 254, and then decode, I obtain 255, not 254.
Therefore, gray level 254 is lost due to the gamma compression.
This happens because of the non-linearities of gamma, that affect the subsequent quantization process.

This way, if I do the gamma correction programmatically. I wish there was a way to discard this gamma at all, because my LCD is linear and does not need any gamma. If I have a gamma of 1, I won’t have this problem of losing gray levels anymore.

For example, some monitors can be configured to change the gamma to 1. I can do this using the buttons behind the monitor, or using the NVIDIA control panel. In these cases, do I suffer from the problem of losing gray values?

Alternatively, is it possible to quantize only after the gamma decoding? If my graphics driver gamma decodes directly the float values, and only performes quantization immediately before sending the voltage to the pixels, then I should not lose any gray level. Is this possible?

Best regards,
André Amorim