Skip to content
  • Naveen Kumar S's avatar
    6d8560f2
    video: fbdev: add support for storing pixclk in hz · 6d8560f2
    Naveen Kumar S authored
    
    
    fbdev framework stores pixelclock in pico seconds. Since monitors
    advertize pixclock in hz, we need to convert it from Hz to pico
    seconds when creating mode database. During modeset, it again needs
    to be converted back to Hz. These conversions cause precision loss,
    because of which the final pixclock value does not match the original
    value advertized by the sink.
    
    This issue is prominently seen in case of non-CEA modes.
    
    Most of the monitors handle this slight variation in pixclock without
    complaining. But, there are a few monitors that fail when the exact
    pixclock is not programmed. Hence, interoperability is affected.
    
    Avoiding the pixclock conversion helps in avoiding the precision loss
    issue. But, the idea of updating the core kernel fbdev driver to use
    pixel clock in hz intead of pico seconds was rejected because it might
    cause ABI compatibility issues.
    
    The finalized solution is to store the original pixclock in hz along
    with the pixclock in pico seconds, and use the hz pixclock during
    modeset instead of the converted one.
    
    Implementation Details:
    
    fb_var_screeninfo is the  structure used by userspace clients to specify
    their chosen mode timings to kernel. To avoid breaking the current fbdev
    ABI, we avoided making any changes to this structure.
    
    A new variable, pixclock_hz, has been added to the existing fb_videomode
    structure. It is used to store the original pixclock value in hz during
    mode database creation. As part of modeset, this value is used instead of
    the one that went through conversion between hz and pico seconds. This
    in-turn helps in setting accurate pixel clock advertized by sinks.
    
    New defconfig option introduced:
    
    To make it easy to enable/disable this feature, the whole implementation
    has been wrapped under a new defconfig option, CONFIG_FB_MODE_PIXCLOCK_HZ.
    Any updates to existing data structures has also been isolated under this
    defconfig option.
    
    bug 2045478
    
    Change-Id: Id3ef39a0d50beee95b9eaba32afa65a7aa28c53a
    Signed-off-by: default avatarNaveen Kumar S <nkumars@nvidia.com>
    Reviewed-on: https://git-master.nvidia.com/r/1812545
    (cherry picked from commit 09877297e4f43aa8844c009a6a30c70033ac664e)
    Reviewed-on: https://git-master.nvidia.com/r/1932350
    
    
    GVS: Gerrit_Virtual_Submit
    Reviewed-by: default avatarSantosh Galma <galmar@nvidia.com>
    Reviewed-by: default avatarBibek Basu <bbasu@nvidia.com>
    Reviewed-by: default avatarmobile promotions <svcmobile_promotions@nvidia.com>
    Tested-by: default avatarmobile promotions <svcmobile_promotions@nvidia.com>
    6d8560f2
    video: fbdev: add support for storing pixclk in hz
    Naveen Kumar S authored
    
    
    fbdev framework stores pixelclock in pico seconds. Since monitors
    advertize pixclock in hz, we need to convert it from Hz to pico
    seconds when creating mode database. During modeset, it again needs
    to be converted back to Hz. These conversions cause precision loss,
    because of which the final pixclock value does not match the original
    value advertized by the sink.
    
    This issue is prominently seen in case of non-CEA modes.
    
    Most of the monitors handle this slight variation in pixclock without
    complaining. But, there are a few monitors that fail when the exact
    pixclock is not programmed. Hence, interoperability is affected.
    
    Avoiding the pixclock conversion helps in avoiding the precision loss
    issue. But, the idea of updating the core kernel fbdev driver to use
    pixel clock in hz intead of pico seconds was rejected because it might
    cause ABI compatibility issues.
    
    The finalized solution is to store the original pixclock in hz along
    with the pixclock in pico seconds, and use the hz pixclock during
    modeset instead of the converted one.
    
    Implementation Details:
    
    fb_var_screeninfo is the  structure used by userspace clients to specify
    their chosen mode timings to kernel. To avoid breaking the current fbdev
    ABI, we avoided making any changes to this structure.
    
    A new variable, pixclock_hz, has been added to the existing fb_videomode
    structure. It is used to store the original pixclock value in hz during
    mode database creation. As part of modeset, this value is used instead of
    the one that went through conversion between hz and pico seconds. This
    in-turn helps in setting accurate pixel clock advertized by sinks.
    
    New defconfig option introduced:
    
    To make it easy to enable/disable this feature, the whole implementation
    has been wrapped under a new defconfig option, CONFIG_FB_MODE_PIXCLOCK_HZ.
    Any updates to existing data structures has also been isolated under this
    defconfig option.
    
    bug 2045478
    
    Change-Id: Id3ef39a0d50beee95b9eaba32afa65a7aa28c53a
    Signed-off-by: default avatarNaveen Kumar S <nkumars@nvidia.com>
    Reviewed-on: https://git-master.nvidia.com/r/1812545
    (cherry picked from commit 09877297e4f43aa8844c009a6a30c70033ac664e)
    Reviewed-on: https://git-master.nvidia.com/r/1932350
    
    
    GVS: Gerrit_Virtual_Submit
    Reviewed-by: default avatarSantosh Galma <galmar@nvidia.com>
    Reviewed-by: default avatarBibek Basu <bbasu@nvidia.com>
    Reviewed-by: default avatarmobile promotions <svcmobile_promotions@nvidia.com>
    Tested-by: default avatarmobile promotions <svcmobile_promotions@nvidia.com>
Loading