“7b895f7d57a4c4ef0ecb2bb01bf4a4cf106f0888”上不存在“...telephonyjstest/git@gitcode.net:openharmony/xts_acts.git”
  • J
    drm/msm: Ensure that the hardware write pointer is valid · 88b333b0
    Jordan Crouse 提交于
    Currently the value written to CP_RB_WPTR is calculated on the fly as
    (rb->next - rb->start). But as the code is designed rb->next is wrapped
    before writing the commands so if a series of commands happened to
    fit perfectly in the ringbuffer, rb->next would end up being equal to
    rb->size / 4 and thus result in an out of bounds address to CP_RB_WPTR.
    
    The easiest way to fix this is to mask WPTR when writing it to the
    hardware; it makes the hardware happy and the rest of the ringbuffer
    math appears to work and there isn't any point in upsetting anything.
    Signed-off-by: NJordan Crouse <jcrouse@codeaurora.org>
    [squash in is_power_of_2() check]
    Signed-off-by: NRob Clark <robdclark@gmail.com>
    88b333b0
msm_ringbuffer.c 1.6 KB