1. 03 Apr, 2017 22 commits
    • Peter Ujfalusi's avatar
      drm/omap: dss: Support for detecting display stack readiness · 1e08c822
      Peter Ujfalusi authored
      When omapdss is loaded (all core components are in place) create a list of
      devices used in the display graph. This list later can be used by omapdrm
      via the omapdss_stack_is_ready() function to check that these components
      are loaded. Based on this information, omapdrm can defer probe in case when
      the omapdss stack is not ready yet.
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      1e08c822
    • Peter Ujfalusi's avatar
      drm/omap: dss: Functions to check components in the display/output list · 7c79e8d6
      Peter Ujfalusi authored
      The functions can be used to check a component (by it's of_node) if it is
      part of the omapdss display or output list. If the component is found, it
      means that the driver is loaded.
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      7c79e8d6
    • Tomi Valkeinen's avatar
      drm/omap: fix replication logic · be2d68c6
      Tomi Valkeinen authored
      DSS uses "replication logic" to convert color components from smaller
      bit widths to bigger bit widths. Without replication logic, the color
      component would be shifted and the least significant bits would be left
      at 0, whereas with replication logic, the least significat bits will be
      filled with the most significant bit.
      
      For some reason omapdrm leaves replication logic always to off, which,
      in the most common case, means that showing 16-bit RGB colors on 24-bit
      display gives a bit darker colors than expected.
      
      The reset value of the replication logic bit is enabled, and it should
      always be set, as there's no practical reason to disable it. This patch
      removes the option to disable it from omapdrm, and always sets it to
      enabled in dispc.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      be2d68c6
    • Tomi Valkeinen's avatar
      b8480cab
    • Tomi Valkeinen's avatar
      drm/omap: remove all EXPORT_SYMBOLs from dispc.c · 5034b1fa
      Tomi Valkeinen authored
      omapdrm now uses dispc_ops instead of direct function calls so we can
      remove all EXPORT_SYMBOLs from dispc. Most of the functions can also be
      made static, but a few are used outside dispc.c.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      5034b1fa
    • Tomi Valkeinen's avatar
      drm/omap: use dispc_ops · 9f759225
      Tomi Valkeinen authored
      Change omapdrm to get dispc_ops and use that to call the dispc functions
      instead or direct function calls.
      
      The change is very straightforward.
      
      The only problem was in omap_crtc_init() which calls pipe2vbl(crtc), and
      at that point of time the crtc->dev link, which is used to get the
      dispc_ops, has not been set up yet. This patch makes omap_crtc_init()
      skip the call to pipe2vbl() and instead calls
      dispc_ops->mgr_get_vsync_irq() directly.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      9f759225
    • Tomi Valkeinen's avatar
      drm/omap: fill dispc_ops · a1a37647
      Tomi Valkeinen authored
      This patch changes the current omapdss driver to fill a dispc_ops struct
      and set it to omapdss-base.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      a1a37647
    • Tomi Valkeinen's avatar
      drm/omap: add dispc_ops · 8a13398c
      Tomi Valkeinen authored
      We want to change the dispc API from plain functions to a struct with
      functions pointers, so that omapdrm can call either omapdss or omapdss6
      depending on the platform.
      
      This patch adds 'struct dispc_ops' and adds functions to omapdss-base
      to set and get the ops.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      8a13398c
    • Tomi Valkeinen's avatar
      drm/omap: move dispc related dss-feat funcs to dispc · c283400a
      Tomi Valkeinen authored
      omapdrm still uses a few non-dispc functions: dss_feat_get_num_mgrs(),
      dss_feat_get_num_ovls() and  dss_feat_get_supported_color_modes(). We
      want to provide omapdrm a single dispc_ops function pointer struct so
      that omapdrm will use either the current omapdss or the new omapdss6
      driver depending on the platform.
      
      Those three functions are really dispc functions, but are located in the
      dss_features.c for legacy reasons.
      
      This patch adds similar functionss to the dispc, and changes omapdrm to
      use those new functions. Underneath the functions still call the
      functions from dss_feature.c.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      c283400a
    • Tomi Valkeinen's avatar
      drm/omap: move display, dss-of, output to omapdss-base · 82e83f67
      Tomi Valkeinen authored
      This patch moves the common parts of omapdss to omapdss-base so that
      both the current omapdss driver and the new omapdss6 driver can use
      them.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      82e83f67
    • Tomi Valkeinen's avatar
      drm/omap: display: don't use dsi_get_pixel_size() · 892fdcb0
      Tomi Valkeinen authored
      display.c uses dsi_get_pixel_size() which is implemented in the DSI
      driver, and we won't have that in the omapdss-base module, to which we
      want to move display.c
      
      This patch changes display.c not to use dsi_get_pixel_size(). The call
      can be replaced with a simple check for OMAP_DSS_DSI_FMT_RGB565.
      
      We can also make dsi_get_pixel_size() static as it's no longer used
      outside dsi.c.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      892fdcb0
    • Tomi Valkeinen's avatar
      drm/omap: output: use dev_err instead of DSSERR · 39637e10
      Tomi Valkeinen authored
      We don't have omapdss's custom error printing functions in the common
      omapdss-base module, to which we want to move output.c.
      
      This patch changes output.c to use dev_err instead of DSSERR so that it
      doesn't depend on DSSERR.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      39637e10
    • Tomi Valkeinen's avatar
      drm/omap: move dss_initialized to omapdss-base · 7c299716
      Tomi Valkeinen authored
      omapdss_is_initialized() is used to find out if omapdss has been probed
      successfully. This patch moves the related code to the common
      omapdss-base module, so that the same support will be there for both
      omapdss and omapdss6.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      7c299716
    • Tomi Valkeinen's avatar
      drm/omap: add omapdss-base.ko · a99ac0d9
      Tomi Valkeinen authored
      We are working towards enabling omapdss6, which will consists of a new
      dss, dispc and dpi drivers. omapdss6 will be a new module. The panel,
      encoder and omapdrm will need to use either the current omapdss driver
      or the new omapdss6 driver, depending on the platform.
      
      This will be implemented with a common base module and function
      pointers.
      
      This patch adds a skeleton omapdss-base.ko module, to which we'll be
      moving common dss functionality like registration of the panels.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      a99ac0d9
    • Tomi Valkeinen's avatar
      drm/omap: fix HDMI sync polarities · d5e7efad
      Tomi Valkeinen authored
      While implementing writeback support, odd behavior of WBDELAYCOUNT was
      observed with the combination of WB capture and HDMI. The result of the
      debugging was that the HDMI sync polarities are not set correctly.
      
      The current code sets the sync polarities going from HDMI WP to DISPC
      according to the video mode used, which seems to work normally fine, but
      causes problems with WB as WB expects the syncs to be active-high.
      
      This patch changes the HDMI sync polarities so that the DISPC always
      gets active-high syncs from HDMI WP, and the HDMI core gets sync
      polarities according to the used video mode.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      d5e7efad
    • Hemant Hariyani's avatar
      drm/omap: Add support for render nodes · 5f6ab8ca
      Hemant Hariyani authored
      Add support for render nodes in omap driver and allow required
      ioctls to be accessible via render nodes.
      
      This enables unprivileged clients to allocate resources like GEM buffers
      for rendering their content into. Mode setting (KMS ioctls) is not
      allowed using render nodes. These buffers are then shared with
      a previleged process (e.g compositor) that has mode setting access.
      
      An example of this use case is Android where the hardware composer is
      the only master and has mode setting access. Every other client then
      uses render node(e.g /dev/dri/renderD128 to allocate and use its buffers.
      Signed-off-by: default avatarHemant Hariyani <hemanthariyani@ti.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      5f6ab8ca
    • Tomi Valkeinen's avatar
      drm/omap: improve DPI clock selection on DRA7xx · 7bbdef2b
      Tomi Valkeinen authored
      The clock source selection for the LCD outputs is too hardcoded at the
      moment. For example, LCD3 is set to use PLL2_1, and PLL2 doesn't exist
      on DRA72x SoCs.
      
      There are quite many ways to configure the clocks, even using HDMI PLL
      for LCD outputs, but enabling full configuration of the clocks is rather
      tricky.
      
      This patch improves the situation a bit by checking if the PLL about to
      be used exists, and if not, tries another one.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      7bbdef2b
    • Tomi Valkeinen's avatar
      drm/omap: decrease min width & height · 1e90711d
      Tomi Valkeinen authored
      mode_config's min_width and min_height are both set to 32, which is
      overly restrictive.
      
      The real limits depend on whether we're configuring a crtc or a plane,
      but a limit of 8x2 is safe for both cases.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      1e90711d
    • Tomi Valkeinen's avatar
      drm/omap: remove divider constraint from hsdiv · 0e81798e
      Tomi Valkeinen authored
      The driver only uses even dividers for hsdiv when pclk >= 100MHz, as odd
      dividers can create uneven duty cycle. However, while this holds true
      for some dividers like DISPC's LCK and PCK dividers, it is not actually
      true for hsdiv.
      
      hsdiv always produces even duty cycle, so the constraint can be removed.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      0e81798e
    • Tomi Valkeinen's avatar
      drm/omap: refactor CRTC HW property setup · 7e3d9274
      Tomi Valkeinen authored
      The current driver doesn't expose any of the CRTC HW properties like
      background color or transparency key, and sets them at CRTC enable time.
      
      Refactor this into a separate function and call that function from
      omap_crtc_atomic_flush(). This is the behavior we want when the
      properties can be configured, so this patch makes it easier to add
      patches later which implement those properties.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      7e3d9274
    • Tomi Valkeinen's avatar
      drm/omap: work-around for errata i886 · 7d267f06
      Tomi Valkeinen authored
      DRA7 errata i886 (FPDLink PLL Unlocks With Certain SoC PLL M/N Values)
      says that FPDLink is sensitive to jitter on the vout clock, and that low
      PLL M and N values result in more jitter than high M and N values.
      
      This patch implements a workaround for the problem by changing the PLL
      setup to search for clocks starting from high M and N values, instead of
      low values. This should not cause any functional change, and only
      reduces the jitter.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      7d267f06
    • Dave Airlie's avatar
      Merge tag 'drm-misc-next-2017-03-31' of git://anongit.freedesktop.org/git/drm-misc into drm-next · 320d8c3d
      Dave Airlie authored
      drm-misc for 4.12:
      
      Core:
      - Removed some fb subsampling dimension checks from core (Ville)
      - Some MST slot cleanup (Dhinakaran)
      - Extracted drm_debugfs.h & drm_ioctl.h from drmP.h (Daniel)
      - Added drm_atomic_helper_shutdown() to compliment suspend/resume counterparts
        (Daniel)
      - Pipe context through legacy modeset to remove legacy_backoff nasties (Daniel)
      - Cleanups around vblank as well as allowing lockless counter reads (Chris W.)
      - VGA Switcheroo added to MAINTAINERS with Lukas Wunner as reviewer (Lukas)
      
      Drivers:
      - Enhancements to rockchip driver probe (Jeffy) and dsi (Chris Z.)
      - Thunderbolt external GPU awareness added (Lukas)
      
      * tag 'drm-misc-next-2017-03-31' of git://anongit.freedesktop.org/git/drm-misc: (63 commits)
        apple-gmux: Don't switch external DP port on 2011+ MacBook Pros
        drm/nouveau: Don't register Thunderbolt eGPU with vga_switcheroo
        drm/amdgpu: Don't register Thunderbolt eGPU with vga_switcheroo
        drm/radeon: Don't register Thunderbolt eGPU with vga_switcheroo
        PCI: Recognize Thunderbolt devices
        MAINTAINERS: Add Lukas Wunner as reviewer for vga_switcheroo
        drm: Fix locking gotcha in page_flip ioctl
        drm: Clarify the role of plane_state argument to drm_simple update().
        drm: Clear e after kfree in drm_mode_page_flip_ioctl
        drm: Convert cmpxchg(bool) back to a two step operation
        drm/bridge: ti-tfp410: support hpd via gpio
        drm: use .hword to represent 16-bit numbers
        Revert unrelated part of "drm: simplify the locking in the GETCRTC ioctl"
        drm: Fixup failure paths in drm_atomic_helper_set_config
        drm: Peek at the current counter/timestamp for vblank queries
        drm: Refactor vblank sequence number comparison
        drm: vblank cannot be enabled if dev->irq_enabled is false
        drm: Mark up accesses of vblank->enabled outside of its spinlock
        drm: Make the decision to keep vblank irq enabled earlier
        drm/atomic-helper: Remove the backoff hack from set_config
        ...
      320d8c3d
  2. 02 Apr, 2017 1 commit
    • Dave Airlie's avatar
      Merge branch 'drm-vmwgfx-next' of git://people.freedesktop.org/~syeh/repos_linux into drm-next · 7558ab66
      Dave Airlie authored
      This series enables atomic mode set for vmwgfx.  A number of features and
      larger fixes are also included.
      
      * 'drm-vmwgfx-next' of git://people.freedesktop.org/~syeh/repos_linux: (22 commits)
        drm/vmwgfx: Properly check display/scanout surface size
        drm/vmwgfx: Support topology greater than texture size
        drm/vmwgfx: Define an overlaid handle_close ioctl.
        drm/vmwgfx: Re-implement the stream resource as a simple resource.
        drm/vmwgfx: Introduce a simple resource type
        drm/vmwgfx: Revert "drm/vmwgfx: Replace numeric parameter like 0444 with macro"
        drm/vmwgfx: Fix LDU X blank screen until mode change issue
        drm/vmwgfx: Skipping fbdev fb pinning for ldu
        drm/vmwgfx: Explicityly track screen target width and height
        drm/vmwgfx: Turn on DRIVER_ATOMIC flag
        drm/vmwgfx: Switch over to internal atomic API for SOU and LDU
        drm/vmwgfx: Switch over to internal atomic API for STDU
        drm/vmwgfx: Fixes to vmwgfx_fb
        drm/vmwgfx: Add and connect atomic state object check/commit
        drm/vmwgfx: Add and connect connector helper function
        drm/vmwgfx: Add and connect plane helper functions
        drm/vmwgfx: Add and connect CRTC helper functions
        drm/vmwgfx: Connector atomic state
        drm/vmwgfx: Plane atomic state
        drm/vmwgfx: CRTC atomic state
        ...
      7558ab66
  3. 31 Mar, 2017 17 commits