12 Apr, 2019

1 commit


24 Mar, 2019

1 commit


14 Mar, 2019

1 commit


25 Feb, 2019

1 commit

  • The hdmi_drm_infoframe_pack() was wrongly packing the HDR metadata. It
    was setting the x display primaries followed by the y display primaries.
    Instead, in the specifications, each x display primary should be
    followed by the corresponding y display primary.

    Also, byte 8 of the frame payload was being skipped. Fixed that too.

    Signed-off-by: Laurentiu Palcu
    Reported-by: Jared Hu

    Laurentiu Palcu
     

12 Feb, 2019

36 commits

  • The problem is that the kthread from submit workqueue aquires the queue_mutex
    and blocks the kthread from interrupt workqueue. But the kthread from interrupt
    workqueue is the one that should update the used_luts variable (on which the
    kthread from submit workqueue keeps polling), but it doesn't have a chance to
    do it (because it is blocked by mutex), even if the LUT complete interrupts are
    triggered. So the fix is, after the polling to release the mutex so that the
    kthread from interrupt workqueue can process the LUT complete interrupts and
    update the used_luts variable accordingly.

    Signed-off-by: Bogdan Chircu
    Signed-off-by: Robby Cai

    Bogdan Chircu
     
  • After suspend, the qos setting is lost. This patch restores it after resume.

    Signed-off-by: Robby Cai

    Robby Cai
     
  • Fix structurally dead code reported by coverity. Assign the return value
    to ret, instead of returning it so there will be a proper clean up.

    Signed-off-by: Robert Chiras

    Robert Chiras
     
  • Fixing two coverity issues:
    1. Checking disp_videomode against 0, which will always be true, since
    disp_videomode is a char array. So, fix it by checking it's first byte
    instead.
    2. Possible division by zero, if clk_get_rate returns 0 (which is
    possible).

    Signed-off-by: Robert Chiras

    Robert Chiras
     
  • The Driver IC 'RM68191' is used in the MIPI panel
    'RK055IQH042' whose default mode is '540x960@60Hz'.
    So this commit adds a new FBDEV driver for 'RM68191'
    and enables the 'RK055IQH042' panel on IMX7ULP1-EVKB
    platform with Northwest MIPI DSI controller.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • The Driver IC 'RM68200' is used in the MIPI panel
    'RK055AHD042' whose default mode is '720x1280@60Hz'.
    So this commit adds a new FBDEV driver for 'RM68200'
    and enables the 'RK055AHD042' panel on IMX7ULP1-EVKB
    platform with Northwest MIPI DSI controller.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • This fixes Coverity issue where an unsigned variable is tested for
    less-than-zero value.

    Make val a signed integer instead.

    Signed-off-by: Laurentiu Palcu
    CC: Sandor Yu

    Laurentiu Palcu
     
  • This fixes less-then-zero comparison Coverity issue. roi_param->roi_n is
    unsigned, hence the comparison is not needed.

    Signed-off-by: Laurentiu Palcu
    CC: Sandor Yu

    Laurentiu Palcu
     
  • This fixes Coverity issue since the function does nothing. The function
    only returns some values which are never used.

    Signed-off-by: Laurentiu Palcu
    CC: Fancy Fang

    Laurentiu Palcu
     
  • This fixes Coverity issue since num_pix_x and num_pix_y are unsigned and
    the conditions are never true.

    Signed-off-by: Laurentiu Palcu
    CC: Fancy Fang

    Laurentiu Palcu
     
  • Some HDMI Sink may failed to work when running HDCP enable/disable
    stress test. HDMI sink may not support change HDCP state on the fly.
    So reset HDMI PHY and controller to resolve the issue.

    Signed-off-by: Sandor Yu

    Sandor Yu
     
  • This driver registers itself as a fb_client and handles notifications
    from all FB in the system.

    It can end up trying to call fb_draw_logo on an overlay FB and this will
    crash because overlay_fb_ops has no fb_imageblit function.

    It also handles blank/unblank indiscriminately and for example if you
    connect a second LVDS display on 6sx and blank/unblank it then HDMI will
    also incorrectly blank/unblank. This last issue even affects imx_4.9.y

    Fix by only processing notifications from the FB that it's bound to.

    Bind to the first FB whose name starts with "mxs-lcdif" by checking
    fb_info->fix.id on FB_EVENT_FB_REGISTERED.

    Signed-off-by: Leonard Crestez
    Acked-by: Robert Chiras

    Leonard Crestez
     
  • For overlay framebuffer, when its grayscale is '0' and the format
    bpp is 32, enable the global alpha blending by default which can
    make the overlay fb can display the framebuffer content as long as
    it is unblanked.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • imx8 hdmi fb driver is not maintain.
    imx8 hdmi function have implemented with DRM framework
    in driver/gpu/drm/imx folder.
    So remove hdmi fb driver.

    Signed-off-by: Sandor Yu

    Sandor Yu
     
  • Since f7b48681ec68 ("MLK-16137 video: fbdev: add defer probe for mxs framebuffer")
    the mxsfb_dispdrv_init function will return -EPROBE_DEFER on all
    mxc_dispdrv_gethandle failures. That makes sense because all
    mxc_dispdrv_entry are registered in their respective probe functions and
    an absent entry should result in probing mxsfb later.

    However in some cases an the disp_dev is empty and those configurations
    now result in enless EPROBE_DEFER loops. Fix this by accepting empty
    disp_dev at the start of mxsfb_dispdrv_init.

    Signed-off-by: Leonard Crestez
    Reviewed-by: Robert Chiras

    Leonard Crestez
     
  • This is a large leak and repeated probing can even exhaust CMA

    Signed-off-by: Leonard Crestez
    Reviewed-by: Robert Chiras

    Leonard Crestez
     
  • Enable Dynamic Range and Mastering Infoframe for HDR
    content, which is defined in CEA 861.3 spec.

    The metadata will be computed based on blending
    policy in userspace compositors and passed as a connector
    property blob to driver. The same will be sent as infoframe
    to panel which support HDR.

    Signed-off-by: Uma Shankar

    Uma Shankar
     
  • Change mem variable type.

    Signed-off-by: Sandor Yu

    Sandor Yu
     
  • For the '640x480' cea mode, change the 'pixclock' from
    39722 ps to 39683 ps to satisfy the imx7ulp hdmi display
    requirement.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • Move the code slice of getting 'phy-ref-clkfreq' property
    to probe function to support arm32 socs besides arm64.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • On ARM32 socs, the 'UL' and 'ULL' postfix are different.
    And if using a 64bit constant integer, 'ULL' is the right
    postfix.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • Compiling the 64-bit integer direct division statement by
    32-bit GCC compiler may trigger below linker error:

    "
    drivers/built-in.o: In function `mipi_dsi_enable':
    core.c:(.text+0x2ad48): undefined reference to `__aeabi_uldivmod'
    core.c:(.text+0x2ad60): undefined reference to `__aeabi_uldivmod'
    core.c:(.text+0x2ada4): undefined reference to `__aeabi_uldivmod'
    core.c:(.text+0x2ade8): undefined reference to `__aeabi_uldivmod'
    core.c:(.text+0x2aed4): undefined reference to `__aeabi_uldivmod'
    drivers/built-in.o:core.c:(.text+0x2af00): more undefined references to
    `__aeabi_uldivmod' follow
    make: *** [vmlinux] Error 1
    "

    In this case, use 'do_div()' can solve this linker error.
    This patch changes all the 'DIV_ROUND_CLOSEST()' to its
    64-bit version 'DIV_ROUND_CLOSEST_ULL()' and also uses
    'do_div()' to replace all the direct division operations
    if required.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • The MXL PLL uses the following function to generate
    the output clock 'CLKOUT' based on the input 'CLKREF'
    (which is the reference clock):

    "
    CLKOUT = CLKREF * CM / (CN * CO);
    CM range is in [16, 255];
    CN range is in [1, 16];
    CO range is in {1, 2, 4, 8};
    "

    So the DSI driver needs to derive proper 'CM', 'CN'
    and 'CO' to get the required 'CLKOUT' based on the
    'CLKREF'. This commit provides a general method to
    derive the best 'CM', 'CN' and 'CO' values for any
    required 'CLKOUT' and input 'CLKREF' combinations.
    'best' means the actual generated output clock freq
    is closest to the required 'CLKOUT' by using the
    derived 'CM', 'CN' and 'CO'.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • The 'CM', 'CN' and 'CO' possible values have no apparent
    relationships with their registers config values. So add
    three tables to describe mappings for them.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • Add 'phy_ref_clkfreq' field to 'struct mipi_dsi_info'
    to save the reference clock frequency configed in dtb
    file for mipi phy pll.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • The 'PICOS2KHZ' macro is used to get pixel clock frequency
    from 'pixclock' value to derive the required mipi phy bit
    clock frequency. But the result precision get from this
    macro is not good enough in some cases. The patch defines
    an new improved macro 'PICOS2KHZ2' to replace 'PICOS2KHZ'.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • HDMI CEC clock have management in HDMI CEC driver,
    so bypass CEC clock in HDMI driver.

    Signed-off-by: Sandor Yu

    Sandor Yu
     
  • Add hdmi audio config function to hdmi driver.

    Signed-off-by: Sandor Yu

    Sandor Yu
     
  • -Relocate hdmi api source code from drivers/video/fbdev/mxc/cdn_hdp
    to drivers/mxc/hdp.
    -Add displayport and hdcp api function.
    -Move t28hpc_hdmitx function from api source code folder
    to hdmi fb driver folder.
    -Update imx8 hdmi fb driver according api source code change.
    -Sync api source code with CDN_API_1_0_33 release.

    Acked-by: Robby Cai
    Signed-off-by: Sandor Yu

    Sandor Yu
     
  • Use 'struct kref' type for 'refcount' field instead of
    'atomic_t' to take advantage of 'kref_*()' interface
    series. The benefit to do so can improve the defered
    cfifo flush performance, since this defered flush does
    not need to wait to be done until next vsync happens.

    Signed-off-by: Fancy Fang
    Reviewed-by: Robby Cai

    Fancy Fang
     
  • After changing the strategy to 'flush cfifo once per frame',
    the cfifo wrapping handling should also be changed accordingly.
    Now, when it is found that the cfifo has no enough room from 'in'
    to the buffer end to hold the current commit, the 'commit_cfifo'
    will cancel this commit and flush the cfifo workqueue before
    restart the commit again.

    Signed-off-by: Fancy Fang
    Reviewed-by: Robby Cai

    Fancy Fang
     
  • The correct return value for 'dcss_wait_for_vsync()' when
    it executes successfully should be '0'. But this current
    value now gets from 'wait_event_interruptible_timeout()'
    which returns non-zero value when the wait is not timeout.

    Signed-off-by: Fancy Fang
    Reviewed-by: Robby Cai

    Fancy Fang
     
  • The macro 'kfifo_to_end_len()' is used to get the length
    between the current kfifo 'in' and the kfifo end. Previous
    implementation has a short-coming under the new strategy
    that multiple commits are combined into one cfifo flush.

    For a simple example, commits 'A' and 'B' are going to be
    combined into one flush, and the last byte of 'A' exactly
    occupy the last byte of fifo coincidently. Then when handling
    the 'B' commit, the old 'kfifo_to_end_len()' logic returns
    the fifo size instead of 0, So the condition 'commit_size >
    kfifo_to_end_len(&cfifo->fifo)' will be false and let 'B'
    to be stored from fifo beginning which finally triggers
    below kernel BUG log:

    [ 568.558341] ------------[ cut here ]------------
    [ 568.558343] kernel BUG at drivers/video/fbdev/mxc/imx_dcss.c:2261!
    [ 568.558348] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
    [ 568.558354] Modules linked in:
    [ 568.558362] CPU: 0 PID: 34 Comm: kworker/u8:1 Not tainted
    [ 568.558364] Hardware name: Freescale i.MX8MQ EVK (DT)
    [ 568.558385] Workqueue: ctxld-wq dcss_ctxld_config
    [ 568.558387] task: ffff8000ba2d8c80 task.stack: ffff8000ba2f8000
    [ 568.558392] PC is at dcss_ctxld_config+0x1dc/0x1e8
    [ 568.558396] LR is at dcss_ctxld_config+0x1dc/0x1e8
    [ 568.558398] pc : [] lr : []
    pstate: 80000145
    [ 568.558399] sp : ffff8000ba2fbd30
    [ 568.558404] x29: ffff8000ba2fbd30 x28: ffff8000ba1f0000
    [ 568.558407] x27: ffff8000ba0096a8 x26: ffff8000ba9d8930
    [ 568.558411] x25: ffff8000ba3a2410 x24: 0000000000000003
    [ 568.558414] x23: 0000000000000008 x22: ffff8000ba9d8918
    [ 568.558417] x21: ffff8000ba9d88f0 x20: ffff8000ba9d8818
    [ 568.558421] x19: ffff8000bbdd0080 x18: ffffffffffffffff
    [ 568.558424] x17: 0000ffff934c8b60 x16: ffff0000081df178
    [ 568.558427] x15: ffff0000092db010 x14: 202c387830203d20
    [ 568.558431] x13: ffff0000092dafe0 x12: ffff0000091be498
    [ 568.558434] x11: ffff0000091be498 x10: ffff0000092d8650
    [ 568.558437] x9 : 0000000000000000 x8 : ffff8000bff7352f
    [ 568.558441] x7 : 0000000000000000 x6 : 0000000000000016
    [ 568.558444] x5 : 0000000000804738 x4 : 0000000000000000
    [ 568.558447] x3 : 0000000000000140 x2 : 000000000000f9bd
    [ 568.558450] x1 : ffff8000ba2f8000 x0 : 0000000000000030
    [ 568.558451]
    [ 568.558453] Process kworker/u8:1 (pid: 34, stack limit =
    0xffff8000ba2f8020)
    ...
    [ 568.558541] Call trace:
    [ 568.558545] Exception stack(0xffff8000ba2fbb60 to 0xffff8000ba2fbc90)
    ...
    [ 568.558586] [] dcss_ctxld_config+0x1dc/0x1e8
    [ 568.558595] [] process_one_work+0x11c/0x370
    [ 568.558600] [] worker_thread+0x50/0x4a0
    [ 568.558606] [] kthread+0xd0/0xe8
    [ 568.558611] [] ret_from_fork+0x10/0x50
    [ 568.558616] Code: d00055e1 aa1903e0 91074021 94056a66 (d4210000)
    [ 568.558623] ---[ end trace faae62afa988e865 ]---
    [ 568.558707] Unable to handle kernel paging request at virtual address
    ffffffffffffffd8
    [ 568.558709] pgd = ffff8000bbda1000
    [ 568.558712] [ffffffffffffffd8] *pgd=00000000fb7ad003
    [ 568.558714] , *pud=00000000fb6a0003
    [ 568.558715] , *pmd=0000000000000000
    ...

    Signed-off-by: Fancy Fang
    Reviewed-by: Robby Cai

    Fancy Fang
     
  • Change the cfifo flush to be once per frame to combine
    possible multiple flush requests in one frame into one
    flush to improve performance. And during one frame, only
    flush requests from different channels can be combined,
    and the different requests from the same channel cannot
    be combined into one flush.

    Signed-off-by: Fancy Fang
    Reviewed-by: Robby Cai

    Fancy Fang
     
  • The function 'dtg_irq_mask()' is not used at this
    moment which caused gcc compiler generate the build
    warning:

    "‘dtg_irq_mask’ defined but not used [-Wunused-function]"

    So add attribute '__maybe_unused' to 'dtg_irq_mask()'
    functon definition to avoid this build warning.

    Signed-off-by: Fancy Fang
    Reviewed-by: Robby Cai

    Fancy Fang
     
  • Unmask the 'IRQ_TC_LINE1' when initialize it by default,
    since the vsync count can be used as a reference count or
    timestamp.

    Signed-off-by: Fancy Fang
    Reviewed-by: Robby Cai

    Fancy Fang