1. 30 9月, 2011 8 次提交
    • T
      OMAP: DSS2: DISPC: Fix minimum PCD value · 9eaaf207
      Tomi Valkeinen 提交于
      The current driver had a hardcoded minimum value of 2 for pixel clock
      divisor (PCD). This doesn't seem to be right.
      
      OMAP4 TRM says that PCD can be 1 when not downscaling, and inverted
      pixel clock (IPC) is off.
      
      OMAP3 TRM says the same, but also in the register descriptions that PCD
      value 1 is invalid.
      
      OMAP2 TRM says PCD 2 is the minimum.
      
      OMAP2 is still untested, but for both OMAP3 and OMAP4 PCD of 1 seems to
      work fine.
      
      This patch adds a new DSS feature, FEAT_PARAM_DSS_PCD, which is used to
      find the minimum and maximum PCD. The minimum is set to 2 for OMAP2, and
      1 for OMAP3/4.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      9eaaf207
    • A
      OMAP: DSS2: Clean up stallmode and io pad mode selection · 569969d6
      Archit Taneja 提交于
      Split the function dispc_set_parallel_interface_mode() into 2 separate
      functions called dispc_mgr_set_io_pad_mode() and dispc_mgr_enable_stallmode().
      The current function tries to set 2 different modes(io pad mode and stall mode)
      based on a parameter omap_parallel_interface_mode which loosely corresponds to
      the panel interface type.
      
      This isn't correct because a) these 2 modes are independent to some extent,
      b) we are currently configuring gpout0/gpout1 for DSI panels which is
      unnecessary, c) a DSI Video mode panel won't get configured correctly.
      
      Splitting the functions allows the interface driver to set these modes
      independently and hence allow more flexibility.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      569969d6
    • T
      OMAP: DSS2: DISPC: rename manager related funcs · 26d9dd0d
      Tomi Valkeinen 提交于
      Rename dispc's manager related functions as follows:
      
      - Remove prepending underscores, which were originally used to inform
        that the clocks needs to be enabled. This meaning is no longer valid.
      - Prepend the functions with dispc_mgr_*
      - Remove "channel" from the name, e.g. dispc_enable_channel ->
        dispc_mgr_enable
      
      The idea is to group manager related functions so that it can be deduced
      from the function name that it writes to manager spesific registers.
      
      All dispc_mgr_* functions have enum omap_channel as the first parameter.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      26d9dd0d
    • T
      OMAP: DSS2: DISPC: rename overlay related funcs · f0e5caab
      Tomi Valkeinen 提交于
      Rename dispc's overlay related functions as follows:
      
      - Remove prepending underscores, which were originally used to inform
        that the clocks needs to be enabled. This meaning is no longer valid.
      - Prepend the functions with dispc_ovl_*
      - Remove "plane" from the name, e.g. dispc_set_plane_ba0 ->
        dispc_ovl_set_ba0
      
      The idea is to group overlay related functions so that it can be deduced
      from the function name that it writes to overlay spesific registers.
      
      All dispc_ovl_* functions have enum omap_plane as the first parameter.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      f0e5caab
    • T
      OMAP: DSS2: Add GLOBAL_ALPHA & PRE_MULT_ALPHA to ovl caps · f6dc8150
      Tomi Valkeinen 提交于
      Add OMAP_DSS_OVL_CAP_GLOBAL_ALPHA and OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA to
      overlay capabilities. Use these instead of FEAT_GLOBAL_ALPHA,
      FEAT_GLOBAL_ALPHA_VID1 and FEAT_PRE_MULT_ALPHA in code.
      
      Remove FEAT_GLOBAL_ALPHA_VID1 and FEAT_PRE_MULT_ALPHA which are no
      longer used. FEAT_GLOBAL_ALPHA is still used to decide if the HW has
      global alpha register.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: NArchit Taneja <archit@ti.com>
      f6dc8150
    • T
      OMAP: DSS2: DISPC: use lookup tables for bit shifts · fe3cc9d6
      Tomi Valkeinen 提交于
      Use lookup tables instead of switch/if in some DISPC functions to make
      the code cleaner.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: NArchit Taneja <archit@ti.com>
      fe3cc9d6
    • T
      OMAP: DSS2: Remove support for non-DISPC overlays · 4a9e78ab
      Tomi Valkeinen 提交于
      Remove support for non-DISPC overlays and overlay managers.
      
      The support to possibly have non-DISPC overlays and managers was made to
      make it possible to use CPU and/or sDMA to update RFBI or DSI command
      mode displays. It is ok to remove the support, because:
      
      - No one has used the feature.
      - Display update without DISPC is very slow, so it is debatable if the
        update would even be usable.
      - Removal cleans up code.
      - If such a feature is needed later, it is better implemented outside
        omapdss driver.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: NArchit Taneja <archit@ti.com>
      4a9e78ab
    • T
      OMAP: DSS2: Handle manager change in apply · 8fa8031c
      Tomi Valkeinen 提交于
      Currently when changing the manager of an overlay, set_manager() directly
      calls dispc to set the overlay's destination.
      
      Change this to be more in line with other overlay configurations, and
      this will also remove the need to have dispc clocks enabled when calling
      set_manager().
      
      A new field is added to overlay struct, "manager_changed". This is
      similar to "display_changed" field in manager struct, and is used to
      inform apply that the manager has changed and thus write to the
      registers is needed.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      8fa8031c
  2. 20 9月, 2011 1 次提交
    • T
      OMAP: DSS2: remove unneeded fck enable/disables · f3646582
      Tomi Valkeinen 提交于
      Now that the HWMOD fmwk handles the fcks of DSS modules properly, the
      DSS driver no longer needs to explicitely enable/disable the fck.
      
      This patch removes the enables/disables of fck from dispc, dsi and dss.
      The clk_get(fck) is still needed there, as the modules need to know the
      frequency of the clock.
      
      For hdmi and venc this patch also removes the clk_get(fck), as they
      don't need the clock at all.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      f3646582
  3. 14 9月, 2011 6 次提交
  4. 25 7月, 2011 3 次提交
  5. 01 7月, 2011 4 次提交
    • T
      OMAP: DSS2: Fix FIFO threshold and burst size for OMAP4 · 5ed8cf5b
      Tomi Valkeinen 提交于
      The DMA FIFO threshold registers and burst size registers have changed
      for OMAP4.  The current code only handles OMAP2/3 case, and so the
      values are a bit off for OMAP4.  A summary of the differences between
      OMAP2/3 and OMAP4:
      
      Burst size:
      OMAP2/3: 4 x 32 bits / 8 x 32 bits / 16 x 32 bits
      OMAP4: 2 x 128 bits / 4 x 128 bits / 8 x 128 bits
      
      Threshold size:
      OMAP2/3: in bytes (8 bit units)
      OMAP4: in 128bit units
      
      This patch fixes the issue by creating two new helper functions in
      dss_features: dss_feat_get_buffer_size_unit() and
      dss_feat_get_burst_size_unit(). These return (in bytes) the unit size
      for threshold registers and unit size for burst size register,
      respectively, and are used to calculate correct values.
      
      For the threshold size the usage is straightforward. However, the burst
      size register has different multipliers for OMAP2/3 and OMAP4. This
      patch solves the problem by defining the multipliers for the burst size
      as 2x, 4x and 8x, which fit fine for the OMAP4 burst size definition
      (i.e. burst size unit for OMAP4 is 128bits), but requires a slight twist
      on OMAP2/3 by defining the burst size unit as 64bit.
      
      As the driver in practice always uses the maximum burst size, and no use
      case currently exists where we would want to use a smaller burst size,
      this patch changes the driver to hardcode the burst size when
      initializing DISPC. This makes the threshold configuration code somewhat
      simpler.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5ed8cf5b
    • T
      OMAP: DSS2: Add Color Phase Rotation support · 3c07cae2
      Tomi Valkeinen 提交于
      Add Color Phase Rotation (CPR) support and sysfs files to enable CPR and
      to set the CPR coefficient matrix.
      
      CPR is enabled via manager?/cpr_enable file, and the coefficient matrix
      is set via manager?/cpr_coef file. The values in cpr_coef are in the
      following order:
      
      RR RG RB GR GG GB BR BG BB
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      3c07cae2
    • T
      OMAP: DSS2: Add new FEAT definitions for features missing from OMAP2 · 332e9d70
      Tomi Valkeinen 提交于
      OMAP2 doesn't have CPR, PRELOAD nor FIR_COEF_V registers. Add new
      feature definitions for those, and check the feature before accessing
      those registers.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      332e9d70
    • T
      OMAP: DSS2: remove extra includes from include/video/omapdss.h · 24e6289c
      Tomi Valkeinen 提交于
      omapdss.h included platform_device.h and atomic.h, neither of which is
      needed by omapdss.h. Remove those includes from omapdss.h, and fix the
      affected .c files which did not include platform_device.h even though
      they should.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      24e6289c
  6. 23 5月, 2011 5 次提交
    • A
      OMAP: DSS2: Add support for NV12 format · 0d66cbb5
      Amber Jain 提交于
      Add the support for NV12 color format.
      Configure base address for UV component of NV12 color format.
      Change the way chroma scaling is handled for YUV formats on OMAP4 by enabling
      chroma-resampling for video pipeline and hence using FIR2 register set for
      scaling UV.
      Changes to _dispc_set_scaling(), because of the reason above, are:
      - call _dispc_set_scaling_common() to handle scaling for all color formats
        except for OMAP4 where it only handles scaling for RGB or Y-component
      - call _dispc_set_scaling_uv() for special handling required for UV
        component on OMAP4.
      - dispc_set_scaling_uv() also resets chroma-resampling bit for RGB color modes.
      
      Contains chroma scaling (_dispc_set_scaling_uv) design and implemented by
      Lajos Molnar <molnar@ti.com>
      Signed-off-by: NAmber Jain <amber@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      0d66cbb5
    • A
      OMAP: DSS2: Add new registers for NV12 support · ab5ca071
      Amber Jain 提交于
      Add new registers specific to UV color component that are introduced in OMAP4.
      Add simple helper functions to configure the newly added registers.
      These new registers are mainly:
      - UV base address registers used specifically for NV12 color-format
      - FIR registers used for UV-color-component scaling on OMAP4
      - Accumulator registers used for UV-color-component scaling
      Add these new registers to save/restore and DUMPREG functions.
      Also add two new features for OMAP4:
      - FEAT_HANDLE_UV_SEPARATE - this is used on OMAP4 as UV color-component requires
        separate handling.
      - FEAT_ATTR2 - this is used on OMAP4 to configure new ATTRIBUTES2 register.
      Signed-off-by: NAmber Jain <amber@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ab5ca071
    • A
      OMAP: DSS2: Use for loop where ever possible in SR(), RR() · 5719d35c
      Amber Jain 提交于
      Use for loop instead of individual entries for OVL_FIR_COEF_H, OVL_FIR_COEF_HV,
      OVL_FIR_COEF_V and OVL_CONV_COEF in SR() and  RR().
      Signed-off-by: NAmber Jain <amber@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5719d35c
    • A
      OMAP: DSS2: Ensure non-zero FIR values are configured · ed14a3ce
      Amber Jain 提交于
      FIR values can never be zero as per TRM, and the current code writes zero
      when scaling is not used. It was not causing any problem as scaling was
      disabled when zero was written. Its still safer to not write zero to
      it in any case.
      Now we configure correct FIR values even when scaling is not used (i.e. set FIR
      to 1024 when scaling is not used), but the scaling enable bits are still kept
      off if the scaling is not needed.
      Signed-off-by: NAmber Jain <amber@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ed14a3ce
    • A
      OMAP: DSS2: Add new color formats for OMAP4 · f20e4220
      Amber Jain 提交于
      Add new color formats supported by OMAP4: NV12, RGBA16, RGBX16,
      ARGB16_1555, XRGB16_1555.
      NV12 color format is defined here, its support in DSS will be added separately.
      Signed-off-by: NAmber Jain <amber@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      f20e4220
  7. 13 5月, 2011 2 次提交
    • A
      OMAP4: DSS2: DSI: Changes for DSI2 on OMAP4 · 5a8b572d
      Archit Taneja 提交于
      Introduce DSI2 PLL clock sources needed by LCD2 channel and DSI2 Protocol
      engine and DISPC Functional clock. Do the following:
      
      - Modify dss_get_dsi_clk_source() and dss_select_dsi_clk_source() to take the
        dsi module number as an argument.
      - Create debugfs files for dsi2, split the corresponding debugfs functions.
      - Allow DPI to use these new clock sources.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5a8b572d
    • A
      OMAP: DSS2: Pass platform_device as an argument in dsi functions · a72b64b9
      Archit Taneja 提交于
      The DSI interface is represented as a platform device, using the DSI platform
      driver(dsi.c). The current DSI driver design is capable of running only one
      instance of a DSI device. On OMAP4, there are 2 very similar DSI modules which
      can be represented as instances of "omapdss_dsi" platform device.
      
      Add member "module" in "dssdev.phy.dsi" that tells us which DSI module's lanes
      the panel is connected to. Modify dsi.c functions to take the device's
      platform_device struct pointer, provide functions dsi_get_dsidev_from_dssdev()
      and dsi_get_dsidev_from_id() take the panel's omap_dss_device and module number
      respectively, and return the platform_device pointer. Currently, the dsi struct
      is declared globally and is accessed when dsi data is needed. The new pdev
      argument will be used later to provide the platform device's dsi related data.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      a72b64b9
  8. 11 5月, 2011 5 次提交
  9. 16 3月, 2011 1 次提交
  10. 11 3月, 2011 5 次提交
    • T
      OMAP4: DSS2: Clock source changes for OMAP4 · ea75159e
      Taneja, Archit 提交于
      On OMAP3, the pixel clock for the LCD manager was derived through DISPC_FCLK as:
      
      Lcd Pixel clock = DISPC_FCLK / lcd / pcd
      
      Where lcd and pcd are divisors in the DISPC_DIVISOR register.
      
      On OMAP4, the pixel clocks for LCD1 and LCD2 managers are derived from 2 new
      clocks named LCD1_CLK and LCD2_CLK. The pixel clocks are calculated as:
      
      Lcd_o Pixel clock = LCDo_CLK / lcdo /pcdo, o = 1, 2
      
      Where lcdo and pcdo registers are divisors in DISPC_DIVISORo registers.
      
      LCD1_CLK and LCD2_CLK can have DSS_FCLK, and the M4 divider clocks of DSI1 PLL
      and DSI2 PLL as clock sources respectively. Introduce functions to select and
      get the clock source for these new clocks. Modify DISPC functions get the
      correct lck and pck rates based on the clock source of these clocks. Since
      OMAP2/3 don't have these clocks, force OMAP2/3 to always have the LCD_CLK source
      as DSS_CLK_SRC_FCK by introducing a dss feature.
      
      Introduce clock source names for OMAP4 and some register field changes in
      DSS_CTRL on OMAP4.
      
      Currently, LCD2_CLK can only have DSS_FCLK as its clock source as DSI2 PLL
      functionality hasn't been introduced yet. BUG for now if DSI2 PLL is selected as
      clock.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ea75159e
    • T
      OMAP2PLUS: DSS2: Cleanup clock source related code · 66534e8e
      Taneja, Archit 提交于
      Clean up some of the DSS functions which select/get clock sources, use switch
      to select the clock source members since more clock sources will be introduced
      later on.
      
      Remove the use of macro CONFIG_OMAP2_DSS_DSI in dispc_fclk_rate, use a dummy
      inline for function for dsi_get_pll_hsdiv_dispc_rate() instead for code clarity.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      66534e8e
    • T
      OMAP: DSS2: fix omap_dispc_register_isr() fail path · b9cb0984
      Tomi Valkeinen 提交于
      Fix handling of error in omap_dispc_register_isr() in case there are no
      free isr slots available.
      Reported-by: NBen Tucker <btucker@mpcdata.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      b9cb0984
    • M
      OMAP4: DSS2: Using dss_features to set independent core clock divider · 0cf35df3
      Murthy, Raghuveer 提交于
      Using dss_features to select independent core clock divider and setting
      it. Added the register used, to DISPC context save and restore group
      
      -----------------------------------------------------------------------
      In OMAP4, the minimum DISPC_CORE_CLK required can be expressed as:
      
      	DISPC_CORE_CLK >= max(PCLK1*HSCALE1, PCLK2*HSCALE2, ...)
      
      Where PCLKi is the pixel clock generated by MANAGERi and HSCALEi is the
      maximum horizontal downscaling done through MANAGERi
      
      Based on the usecase, core clk can be increased or decreased at runtime
      to save power. Such mechanism are not yet implemented. Hence, we set the
      core clock divisor to 1, to support maximum range of resolutions
      ------------------------------------------------------------------------
      Signed-off-by: NRaghuveer Murthy <raghuveer.murthy@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      0cf35df3
    • M
      OMAP: DSS2: Renaming register macro DISPC_DIVISOR(ch) · ce7fa5eb
      Murthy, Raghuveer 提交于
      The OMAP4 DISPC_DIVISOR1 is backward compatible to OMAP3xxx DISPC_DIVISOR.
      However DISPC_DIVISOR is also provided in OMAP4, to control DISPC_CORE_CLK
      independent of Primary and Secondary display clocks.
      
      Renamed DISPC_DIVISOR(ch) to DISPC_DIVISORo(ch), to facilitate introduction
      of DISPC_DIVISOR register, which is specific for OMAP4. OMAP4 has 3 registers
      DISPC_DIVISOR, DISPC_DIVISOR1 and DISPC_DIVISOR2.
      
      Also updated, all the usages of DISPC_DIVISOR(ch) to DISPC_DIVISORo(ch).
      Use DISPC_DIVISORo(ch) when DISPC_DIVISOR1 or DISPC_DIVISOR2 has to be
      configured
      
      OMAP4 TRM uses DISPC_DIVISORo generically to refer to DISPC_DIVISOR1 and
      DISPC_DIVISOR2
      Signed-off-by: NRaghuveer Murthy <raghuveer.murthy@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ce7fa5eb