1. 26 Sep, 2012 4 commits
    • Archit Taneja's avatar
      OMAPDSS: outputs: Create a new entity called outputs · 484dc404
      Archit Taneja authored
      The current OMAPDSS design contains 3 software entities: Overlays, Managers and
      Devices. These map to pipelines, overlay managers and the panels respectively in
      hardware. One or more overlays connect to a manager to represent a composition,
      the manager connects to a device(generally a display) to display the content.
      
      The part of DSS hardware which isn't represented by any of the above entities
      are interfaces/outputs that connect to an overlay manager, i.e blocks like DSI,
      HDMI, VENC and so on. Currently, an overlay manager directly connects to the
      display, and the output to which it is actually connected is ignored. The panel
      driver of the display is responsible of calling output specific functions to
      configure the output.
      
      Adding outputs as a new software entity gives us the following benefits:
      
      - Have exact information on the possible connections between managers and
        outputs: A manager can't connect to each and every output, there only limited
        hardware links between a manager's video port and some of the outputs.
      
      - Remove hacks related to connecting managers and devices: Currently, default
        links between managers and devices are set in a not so clean way. Matching is
        done via comparing the device type, and the display types supported by the
        manager. This isn't sufficient to establish all the possible links between
        managers, outputs and devices in hardware.
      
      - Make panel drivers more generic: The DSS panel drivers currently call
        interface/output specific functions to configure the hardware IP. When making
        these calls, the driver isn't actually aware of the underlying output. The
        output driver extracts information from the panel's omap_dss_device pointer
        to figure out which interface it is connected to, and then configures the
        corresponding output block. An example of this is when a DSI panel calls
        dsi functions, the dsi driver figures out whether the panel is connected
        to DSI1 or DSI2. This isn't correct, and having output as entities will
        give the panel driver the exact information on which output to configure.
        Having outputs also gives the opportunity to make panel drivers generic
        across different platforms/SoCs, this is achieved as omap specific output
        calls can be replaced by ops of a particular output type.
      
      - Have more complex connections between managers, outputs and devices: OMAPDSS
        currently doesn't support use cases like 2 outputs connect to a single
        device. This can be achieved by extending properties of outputs to connect to
        more managers or devices.
      
      - Represent writeback as an output: The writeback pipeline fits well in OMAPDSS
        as compared to overlays, managers or devices.
      
      Add a new struct to represent outputs. An output struct holds pointers to the
      manager and device structs to which it is connected. Add functions which can
      register/unregister an output, or look for one. Create an enum which represent
      each output instance.
      Signed-off-by: default avatarArchit Taneja <archit@ti.com>
      484dc404
    • Archit Taneja's avatar
      OMAPDSS: APPLY: Remove omap_dss_device references in wait_for_go functions · fc22a843
      Archit Taneja authored
      The functions dss_mgr_wait_for_go() and dss_mgr_wait_for_go_ovl() check if there
      is an enabled display connected to the manager before trying to see the state of
      the GO bit.
      
      The checks related to the display can be replaced by checking the state of the
      manager, i.e, whether the manager is enabled or not. This makes more sense than
      checking with the connected display as the GO bit behaviour is more connected
      with the manager state rather than the display state. A GO bit can only be set
      if the manager is enabled. If a manager isn't enabled, we can safely assume that
      the GO bit is not set.
      Signed-off-by: default avatarArchit Taneja <archit@ti.com>
      fc22a843
    • Archit Taneja's avatar
      OMAPDSS: DSI: Pass dsi platform device wherever possible · 9e7e9372
      Archit Taneja authored
      Many of the DSI functions receive the connected panel's omap_dss_device pointer
      as an argument. The platform device pointer is then derived via omap_dss_device
      pointers.
      
      Most of these functions don't really require omap_dss_device pointer anymore
      since we now keep copies of parameters in the driver data which were previously
      available only via omap_dss_device. Replace the arguments with platform device
      pointers for such functions.
      Signed-off-by: default avatarArchit Taneja <archit@ti.com>
      9e7e9372
    • Tomi Valkeinen's avatar
      OMAPDSS: DSI: fix tlpx_half reg field length · e84dc1cc
      Tomi Valkeinen authored
      tlpx_half bit field in DSI_DSIPHY_CFG1 is [20,16], not [22,16] as
      accessed in the code currently. Fix this.
      
      The bug should not have caused any problems on OMAP3/4, as the bits
      21,22 are unused. They are used on OMAP5, though.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      e84dc1cc
  2. 25 Sep, 2012 4 commits
    • Chandrabhanu Mahapatra's avatar
      OMAPDSS: DISPC: Add predecimation limit for TILER based rotations · d557a9cf
      Chandrabhanu Mahapatra authored
      In OMAP4 and OMAP5 when TILER 2D burst mode is used, a maximum of one line can
      be skipped as per the respective TRMs. The MBlockStride OCP signal, which is
      sum of ROWINC and image width in memory, is only 17 bits wide. In 2D mode TILER
      supports 8192, 16384, 32768 and 65536 values of MBlockStride. In case when 2 or
      more lines are skipped the ROWINC value exceeds 65536 resulting in OCP errors.
      So, maximum vertical predecimation achievable is 2.
      Signed-off-by: default avatarChandrabhanu Mahapatra <cmahapatra@ti.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      d557a9cf
    • Tomi Valkeinen's avatar
      Merge OMAP5 DSS changes to omapdss · 406f7b8b
      Tomi Valkeinen authored
      This series adds basic OMAP5 DSS functionality, mainly related to DSS core, DPI
      and DSI.
      
      * omap5-dss:
        OMAPDSS: DSI: make OMAP2_DSS_DSI depend on ARCH_OMAP5
        OMAPDSS: DSI: Add code to disable PHY DCC
        OMAPDSS: DSI: Add new linebuffer size for OMAP5
        OMAPDSS: DSI: Add FEAT_DSI_PLL_REFSEL
        OMAPDSS: DSI: Add FEAT_DSI_PLL_SELFREQDCO
        OMAPDSS: Add support for DPI source selection
        OMAPDSS: move dss feats to the end of dss.c
        OMAPDSS: Add basic omap5 features to dss and dispc
        OMAPDSS: DSI: improve DSI clock calcs for DISPC
      406f7b8b
    • Tomi Valkeinen's avatar
      Merge omapdss single-dssdev series · c0ca7c38
      Tomi Valkeinen authored
      This series contains patches that change how omapdss's panel devices
      (omap_dss_device) are initialized and registered. There are two patches that
      change behaviour, the rest are just cleanups:
      
      The patch "omap_dss_register_device() doesn't take display index" affects the
      number for the "displayX" sysfs files. This hopefully doesn't affect the
      userspace, as the number has never been a clear indication of what the
      particular display is.
      
      The patch "register only one display device per output" affects how panel
      devices are created. Currently we support multiple panels per output, i.e. you
      could have DVI and an LCD displays using the same DPI output, as long as the
      DVI and LCD are not used at the same time.
      
      This patch changes the omapdss driver to only register one display device per
      output. If there are multiple displays for the output, either the first one is
      picked or, if def_display has been defined in kernel parameters and the
      def_display is one of the displays for this output, the def_display is picked.
      See the patch for more information.
      
        OMAPDSS: alloc dssdevs dynamically
        OMAPDSS: cleanup dss_recheck_connections further
        OMAPDSS: cleanup dss_recheck_connections
        OMAPDSS: handle errors in dss_init_device
        OMAPDSS: explicitely initialize dssdev->channel for new displays
        OMAPDSS: register only one display device per output
        OMAPDSS: Add dss_get_default_display_name()
        OMAPDSS: omap_dss_register_device() doesn't take display index
      c0ca7c38
    • Raphaël Assénat's avatar
      OMAPDSS: Do not require a VDDS_DSI regulator on AM35xx · 524d9f48
      Raphaël Assénat authored
      On our AM3505 based board, dpi.c complains that there is no VDDS_DSI
      regulator and the framebuffer cannot be enabled. However, this check
      does not seem to apply to AM3505/17 chips.
      
      This patch adds new features list for AM35xxx, which is the same as for
      OMAP3 except the VDDS_DSI is removed.
      Signed-off-by: default avatarRaphael Assenat <raph@8d.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      524d9f48
  3. 24 Sep, 2012 9 commits
  4. 18 Sep, 2012 8 commits
    • Tomi Valkeinen's avatar
      OMAPDSS: alloc dssdevs dynamically · 5274484b
      Tomi Valkeinen authored
      We currently create omap_dss_devices statically in board files, and use
      those devices directly in the omapdss driver. This model prevents us
      from having the platform data (which the dssdevs in board files
      practically are) as read-only, and it's also different than what we will
      use with device tree.
      
      This patch changes the model to be in line with DT model: we allocate
      the dssdevs dynamically, and initialize them according to the data in
      the board file's dssdev (basically we memcopy the dssdev fields).
      
      The allocation and registration is done in the following steps in the
      output drivers:
      
      - Use dss_alloc_and_init_device to allocate and initialize the device.
        The function uses kalloc and device_initialize to accomplish this.
      - Call dss_copy_device_pdata to copy the data from the board file's
        dssdev
      - Use dss_add_device to register the device.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      5274484b
    • Tomi Valkeinen's avatar
      OMAPDSS: cleanup dss_recheck_connections further · 5eeb55f8
      Tomi Valkeinen authored
      Cleanup dss_recheck_connections, move and rename it to a static
      dss_init_connections function inside display.c. Improve the function to
      return errors, and implement a matching dss_uninit_connections that can
      be used to free the mgr->dssdev link.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      5eeb55f8
    • Tomi Valkeinen's avatar
      OMAPDSS: cleanup dss_recheck_connections · 6b417858
      Tomi Valkeinen authored
      dss_recheck_connections is quite a mess. With the previous commit that
      initializes the channel field for HDMI and VENC displays, we can greatly
      simplify the dss_recheck_connections.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      6b417858
    • Tomi Valkeinen's avatar
      OMAPDSS: handle errors in dss_init_device · 47eb6763
      Tomi Valkeinen authored
      Add error handling to dss_init_device(), which has, for some reason,
      been missing.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      47eb6763
    • Tomi Valkeinen's avatar
      OMAPDSS: explicitely initialize dssdev->channel for new displays · bcb226a9
      Tomi Valkeinen authored
      HDMI and VENC outputs always use the DIGIT output from DISPC. The dssdev
      struct contains "channel" field which is used to specify the DISPC
      output for the display, but this was not used for HDMI and VENC.
      
      This patch fills the channel field explicitely for HDMI and VENC
      displays so that we can always rely on the channel field.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      bcb226a9
    • Tomi Valkeinen's avatar
      OMAPDSS: register only one display device per output · 1521653c
      Tomi Valkeinen authored
      We have boards with multiple panel devices connected to the same
      physical output, of which only one panel can be enabled at one time.
      Examples of these are Overo, where you can use different daughter boards
      that have different LCDs, and 3430SDP which has an LCD and a DVI output
      and a physical switch to select the active display.
      
      These are supported by omapdss so that we add all the possible display
      devices at probe, but the displays are inactive until somebody enables
      one. At this point the panel driver starts using the DSS, thus reserving
      the physcal resource and excluding the other panels.
      
      This is problematic:
      - Panel drivers can't allocate their resources properly at probe(),
        because the resources can be shared with other panels. Thus they can
        be only reserved at enable time.
      - Managing this in omapdss is confusing. It's not natural to have
        child devices, which may not even exist (for example, a daughterboard
        that is not connected).
      
      Only some boards have multiple displays per output, and of those, only
      very few have possibility of switching the display during runtime.
      Because of the above points:
      - We don't want to make omapdss and all the panel drivers more complex
        just because some boards have complex setups.
      - Only few boards support runtime switching, and afaik even then it's
        not required. So we don't need to support runtime switching.
      
      Thus we'll change to a model where we will have only one display device
      per output and this cannot be (currently) changed at runtime. We'll
      still have the possibility to select the display from multiple options
      during boot with the default display option.
      
      This patch accomplishes the above by changing how the output drivers
      register the display device. Instead of registering all the devices
      given from the board file, we'll only register one. If the default
      display option is set, the output driver selects that display from its
      displays. If the default display is not set, or the default display is
      not one of the output's displays, the output driver selects the first
      display.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      1521653c
    • Tomi Valkeinen's avatar
      OMAPDSS: Add dss_get_default_display_name() · 6a03fca9
      Tomi Valkeinen authored
      Add function dss_get_default_display_name() which returns the name of
      the default display, given from the board file or via module parameters.
      The default display name can be used by output drivers to decide which
      display is the wanted one.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      6a03fca9
    • Tomi Valkeinen's avatar
      OMAPDSS: omap_dss_register_device() doesn't take display index · 8768a52f
      Tomi Valkeinen authored
      We used to have all the displays of the board in one list, and we made a
      "displayX" directory in the sysfs, where X was the index of the display
      in the list.
      
      This doesn't work anymore with device tree, as there's no single list to
      get the number from, and it doesn't work very well even with non-DT as
      we need to do some tricks to get the index nowadays.
      
      This patch changes omap_dss_register_device() so that it doesn't take
      disp_num as a parameter anymore, but uses a private increasing counter
      for the display number.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      8768a52f
  5. 11 Sep, 2012 2 commits
  6. 10 Sep, 2012 1 commit
    • Tomi Valkeinen's avatar
      Merge miscellaneous omapdss changes · 6cd05430
      Tomi Valkeinen authored
      Most important changes:
      
      * Remove OMAP4 HDMI gpio handling from board files
      * Add vdda_hdmi_dac supply for HDMI to twl-common.c
      * Calculate DSI clocks dynamically
      * Remove DSS clock dividers from 4430sdp board file
      * vram.c no longer uses OMAP's sDMA to clear the memory
      * Fifomerge has been reverted
      * Swap GFX and WB fifos to avoid underflows
      6cd05430
  7. 07 Sep, 2012 12 commits
    • Tomi Valkeinen's avatar
      OMAPDSS: fix dss_ovl_unset_manager · b2f5976c
      Tomi Valkeinen authored
      When we removed fifomerge support, we also changed dss_ovl_disable so
      that it doesn't wait for the hardware to be finished with the overlay.
      This may cause a problem when changing the overlay's manager, as
      changing the manager is an immediate change. Thus if the overlay is
      still being used by the HW when the manager is changed, there may be
      glitches on the screen.
      
      This patch adds a wait into dss_ovl_unset_manager, which ensures the
      overlays are disabled in the HW.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      b2f5976c
    • Tomi Valkeinen's avatar
      OMAPDSS: fix set_timings · b82fe7f0
      Tomi Valkeinen authored
      set_timings function of DSS's output drivers are not consistent. Some of
      them disable the output, set the timings, and re-enable the output. Some
      set the timings on the fly, while the output is enabled. And some just
      store the given timings, so that they will be taken into use next time
      the output is enabled.
      
      We require the DISPC output to be disabled when changing the timings,
      and so we can change all the output drivers' set_timings to just store
      the given timings.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      b82fe7f0
    • Tomi Valkeinen's avatar
      OMAPDSS: Use WB fifo for GFX overlay · 66a0f9e4
      Tomi Valkeinen authored
      OMAP4's GFX overlay has smaller fifo than the rest of the overlays
      (including writeback "overlay"). This seems to be the reason for
      underflows in some more demanding scenarios.
      
      We can avoid the problems by using the WB fifo for GFX overlay, and vice
      versa. WB usage is not supported yet, but when it will, it should
      perform just fine with smaller fifo as there are no hard realtime
      constraints with WB.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      66a0f9e4
    • Tomi Valkeinen's avatar
      OMAPDSS: Improve fifo management code · 42a6961c
      Tomi Valkeinen authored
      OMAP4+ allows assigning the overlay FIFOs freely, but that is not
      supported by omapdss yet. This patch takes a step forward by improving
      the fifo management to be more flexible.
      
      dispc.c is changed to keep track of the sizes of each fifo, and also the
      overlay using each fifo.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      42a6961c
    • Tomi Valkeinen's avatar
      Revert "OMAPDSS: APPLY: add fifo merge support funcs" · 85099f11
      Tomi Valkeinen authored
      This reverts commit fb011974.
      
      Adding fifo merge feature as an omapdss internal configuration was a
      mistake. We cannot hide from the users of omapdss the complexities of
      fifo merge.
      
      The previous commit removed fifo merge itself, and this removes the
      remaining fifo merge support functions.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      85099f11
    • Tomi Valkeinen's avatar
      Revert "OMAPDSS: APPLY: add fifo-merge support" · b3e93cbd
      Tomi Valkeinen authored
      This reverts commit 1d71f42b.
      
      Adding fifo merge feature as an omapdss internal configuration was a
      mistake. We cannot hide from the users of omapdss the complexities of
      fifo merge.
      
      This commit removes the fifo merge support, which luckily is easily done
      as it was handled totally inside apply.c. Note that this is not a 1:1
      revert, but some resolving was needed for the dss_ovl_setup_fifo.
      
      The plan is to try fifo merge again later when it is more clear how the
      hardware acts in various situations, and how the omapdrm wants to use
      fifo merge.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      b3e93cbd
    • Tomi Valkeinen's avatar
      OMAPDSS: clean up dss_mgr_set_timings · fed62e54
      Tomi Valkeinen authored
      dss_mgr_set_timings() can only be called when the output is not active.
      This means that most of the code in the function is extra, as there's no
      need to write the values to registers, etc, because that will be handled
      when the output will be enabled.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      fed62e54
    • Tomi Valkeinen's avatar
      OMAPDSS: clean up dss_mgr_set_lcd_config · aba96570
      Tomi Valkeinen authored
      dss_mgr_set_lcd_config() can only be called when the output is not
      active. This means that most of the code in the function is extra, as
      there's no need to write the values to registers, etc, because that will
      be handled when the output will be enabled.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      aba96570
    • Tomi Valkeinen's avatar
      OMAPDSS: split manager sysfs code · f6a0492e
      Tomi Valkeinen authored
      Separate sysfs code for managers to a separate file. This is a bit
      cleaner, and will allow us later to easily switch off the sysfs support
      via Kconfig option.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      f6a0492e
    • Tomi Valkeinen's avatar
      OMAPDSS: split overlay sysfs code · 91691516
      Tomi Valkeinen authored
      Separate sysfs code for overlays to a separate file. This is a bit
      cleaner, and will allow us later to easily switch off the sysfs support
      via Kconfig option.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      91691516
    • Tomi Valkeinen's avatar
      OMAPDSS: TFP410: use devm_gpio_request_one · a6df3fd9
      Tomi Valkeinen authored
      Use devm_ version instead of the regular gpio_request_one to simplify
      the error handling.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      a6df3fd9
    • Tomi Valkeinen's avatar
      OMAPDSS: Taal: Reogranize for device tree · f075a594
      Tomi Valkeinen authored
      Reorganize taal driver to make it easier to integrate device tree code.
      Instead of storing the panel's platform data, we'll "parse" the platform
      data and store the required information in driver's own data. This way
      adding device tree data parsing is simple.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      f075a594