1. 17 6月, 2015 7 次提交
    • T
      OMAPDSS: DISPC: check if scaling setup failed · 3ce17b48
      Tomi Valkeinen 提交于
      The DISPC's scaling code seems to presume that decimation always
      succeeds, and so we always do find a suitable downscaling setup.
      However, this is not the case, and the algorithm can fail.
      
      When that happens, the code just proceeds with wrong results, causing
      issues later.
      
      Add the necessary checks to bail out if the scaling algorithm failed.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      3ce17b48
    • T
      OMAPDSS: DISPC: fix 64 bit issue in 5-tap · c582935c
      Tomi Valkeinen 提交于
      The DISPC driver uses 64 bit arithmetic to calculate the required clock
      rate for scaling. The code does not seem to work correctly, and instead
      calculates with 32 bit numbers, giving wrong result.
      
      Fix the code by typecasting values to u64 first, so that the
      calculations do happen in 64 bits.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      c582935c
    • T
      OMAPDSS: DISPC: fix row_inc for OMAP3 · f2aee319
      Tomi Valkeinen 提交于
      pixel_inc and row_inc work differently on OMAP2/3 and OMAP4+ DSS. On
      OMAP2/3 DSS, the pixel_inc is _not_ added by the HW at the end of the
      line, after the last pixel, whereas on OMAP4+ it is.
      
      The driver currently works for OMAP4+, but does not handle OMAP2/3
      correctly, which leads to tilted image when row_inc is used.
      
      This patch adds a flag to DISPC driver so that the pixel_inc is added
      when required.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      f2aee319
    • T
      OMAPDSS: DISPC: add check for scaling limits · ab6b2582
      Tomi Valkeinen 提交于
      On OMAP3/AM43xx some scaling factors cause underflows/synclosts. After
      studying this, I found that sometimes the driver uses three-tap scaling
      with downscaling factor smaller than x0.5. This causes issues, as x0.5
      is the limit for three-tap scaling.
      
      The driver has FEAT_PARAM_DOWNSCALE parameter, but that seems to be for
      five-tap scaling, which allows scaling down to x0.25.
      
      This patch adds checks for both horizontal and vertical scaling. For
      horizontal the HW always uses 5 taps, so the limit is x0.25.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ab6b2582
    • T
      OMAPDSS: DISPC: fix check_horiz_timing_omap3 args · f5a73482
      Tomi Valkeinen 提交于
      After calculating the required decimation for scaling, the dispc driver
      checks once more if the resulting configuration is valid by calling
      check_horiz_timing_omap3().
      
      Earlier calls to this function have correctly used in_width and
      in_height as parameters, but the last call uses width and height. This
      causes the driver to possibly reject scaling that would work.
      
      This patch fixes the parameters.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      f5a73482
    • T
      OMAPDSS: DISPC: fix predecimation for YUV modes · c4661b33
      Tomi Valkeinen 提交于
      DISPC needs even input buffer width for YUV modes. The DISPC driver
      doesn't check this at the moment (although omapdrm does), but worse,
      when DISPC driver does x predecimation the result may be uneven. This
      causes sometimes sync losts, underflows, or just visual errors.
      
      This patch makes DISPC driver return an error if the user gives uneven
      input width for a YUV buffer. It also makes the input width even in case
      of predecimation.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      c4661b33
    • T
      OMAPDSS: DISPC: work-around for errata i631 · 3397cc6a
      Tomi Valkeinen 提交于
      Errata i631 description:
      
      "When in YUV4:2:0 format in 1D burst, the DISPC DMA skips lines when
      fetching Chroma sampling."
      
      Workaround:
      
      "If YUV4:2:0-1D burst is required: Set
      DISPC_VIDp_ATTRIBUTES[22]DOUBLESTRIDE to 0x0 and
      DISPC_VIDp_ATTRIBUTES[13:12]ROTATION to 0x1 or 0x3"
      
      The description is somewhat confusing, but testing has shown that DSS
      fetches extra rows from memory when using NV12 format in 1D mode. If the
      memory after the framebuffer is inaccessible, this leads to OCP errors.
      
      The driver always uses DOUBLESTRIDE=0 when using 1D mode, so we only
      need to handle the ROTATION part.
      
      The issue exist on all OMAP4 and OMAP5 based DSS IPs.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      3397cc6a
  2. 26 2月, 2015 8 次提交
    • T
      OMAPDSS: workaround for MFLAG + NV12 issue · fe59e5cf
      Tomi Valkeinen 提交于
      It was found that having two displays enabled and having an NV12 overlay
      on one of the displays will cause underflows/synclosts. Debugging this
      pointed to some issue with MFLAG.
      
      It is unclear why this issue is happening, but it looks like there is a
      HW bug related to MFLAG and FIFO management. Disabling MFLAG makes this
      issue go away, but then we lose the benefit of MFLAG. Also forcing MFLAG
      always on makes the issue go away.
      
      Also, using certain values for MFLAG_START, MFLAG thresholds and PRELOAD
      makes the issue go away, but there was no obvious logic to which values
      work and which don't.
      
      As a workaround until more information about this is found, force MFLAG
      always on to make NV12 usable.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      fe59e5cf
    • T
      OMAPDSS: Add support for MFLAG · c64aa3a6
      Tomi Valkeinen 提交于
      OMAP5 has support for MFLAG feature, which allows DSS to dynamically
      increase the priority of DISPC's DMA traffic. At the moment we don't
      have support for it.
      
      It was noticed that on DRA7 with high bandwidth use cases we see FIFO
      underflows. Implementing MFLAG support removed those underflows.
      Interestingly, on OMAP5 uEVM no such overflows were seen.
      
      This patch adds a simple MFLAG implementation, where we use a fixed
      MFLAG threshold value based on the FIFO size. The thresholds are set to
      4/8 of fifo size for low threshold, and 5/8 of fifo size for high
      threshold.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      c64aa3a6
    • T
      OMAPDSS: setup default fifo thresholds · 47fc469b
      Tomi Valkeinen 提交于
      At the moment we don't setup FIFO thresholds by default in omapdss. It's
      supposed to be done by the user of omapdss. And that is missing from
      omapdrm, causing unoptimal thresholds to be used when using omapdrm.
      
      While I believe it's in theory better to allow the user of omapdss to
      setup the fifo thresholds, in practice we always use the same values,
      and we could as well setup the thresholds in omapdss.
      
      Furthermore, in omapdss init we always swap the FIFO used for GFX and WB
      overlays, but we don't swap the FIFO thresholds for those overlays
      (which is the reason for omapdrm using unoptimal HW reset values). So
      it would make sense to setup the thresholds to account for the swapping
      of the FIFOs.
      
      So, this patch adds code to setup default FIFO tresholds at omapdss
      init.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      47fc469b
    • T
      OMAPDSS: DISPC: lock access to DISPC_CONTROL & DISPC_CONFIG · d49cd155
      Tomi Valkeinen 提交于
      Dispc driver presumes that the callers handle locking for all normal
      functions. However, omapdrm doesn't handle this, and presumes that all
      overlay manager registers are private to that overlay manager, and thus
      presumes that configurations for overlay managers can be written via
      different threads freely.
      
      For many registers the above is true. The exceptions are DISPC_CONTROL
      and DISPC_CONFIG registers, which contain bits for both LCD and TV
      overlay managers.
      
      Fixing this properly in omapdrm means a big omapdrm rewrite. So, for
      now, add locking to dispc for the problematic registers.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Reported-by: NSomnath Mukherjee <somnath@ti.com>
      d49cd155
    • T
      OMAPDSS: DISPC: fix div by zero issue in overlay scaling · 4e1d3ca0
      Tomi Valkeinen 提交于
      omapdrm doesn't always configure the overlays correctly, causing the
      overlay setup functions to be called with zero timings. This leads to
      division by zero error.
      
      This happens, for example, when a HDMI cable is not connected, but a
      user tries to setup a plane with scaling.
      
      Fixing omapdrm is a big job, so for now let's check for the bad timings
      in DISPC and return an error.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      4e1d3ca0
    • T
      OMAPDSS: DISPC: explicit handling for sync and de levels · ed351881
      Tomi Valkeinen 提交于
      When configuring the lcd timings, instead of writing enum values
      directly to the HW, use switch-case to get the value to be programmed.
      
      This is safer and also allows us to change the enum values.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ed351881
    • T
      OMAPDSS: DISPC: remove OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES · 7a16360d
      Tomi Valkeinen 提交于
      DISPC can drive data lines either on rising or falling pixel clock edge,
      which can be configured by the user.
      
      Sync lines can also be driven on rising or falling pixel clock edge, but
      additionally the HW can be configured to drive the sync lines on
      opposite clock edge from the data lines.
      
      This opposite edge setting does not make any sense, as the same effect
      can be achieved by just setting the sync lines to be driven on the other
      edge compared to the data lines. It feels like some kind of backward
      compatibility option, even if all DSS versions seem to have the same
      implementation.
      
      To simplify the code and configuration of the signals, and to make the
      dispc timings more compatible with what is used on other platforms,
      let's just remove the whole opposite-edge support.
      
      The drivers that used OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES setting are
      changed so that they use the opposite setting from the data edge.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      7a16360d
    • T
      OMAPDSS: fix paddr check for TILER addresses · e566658f
      Tomi Valkeinen 提交于
      The DISPC driver checks that the buffer address is not 0. However, when
      using TILER, the address space is TILER specific and 0 is a valid
      address.
      
      Fix the check to allow address of 0 for TILER.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Reported-by: Nsrinivas pulukuru <srinivas.pulukuru@ti.com>
      e566658f
  3. 04 2月, 2015 2 次提交
  4. 12 11月, 2014 1 次提交
    • T
      OMAPDSS: DSI: use common DSS PLL support · 2daea7af
      Tomi Valkeinen 提交于
      Now that we have the common DSS PLL support, change DSI to use it. This
      results in quite a lot of changes, but almost all of them are trivial
      name changes.
      
      The functions to calculate and program the PLL settings can be removed
      from dsi.c, as the common PLL API contains the same functionality.
      
      We also need to create struct dss_pll_hw entries for PLL hardware
      features for different OMAP platforms, instead of using the
      dss_features.c as the old code does.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      2daea7af
  5. 22 10月, 2014 2 次提交
  6. 20 10月, 2014 1 次提交
  7. 04 7月, 2014 3 次提交
  8. 09 5月, 2014 4 次提交
  9. 17 4月, 2014 1 次提交
  10. 14 4月, 2014 2 次提交
    • J
      OMAPDSS: Change struct reg_field to dispc_reg_field · 5c348ba9
      Jyri Sarha 提交于
      Avoid colision with regmap's struct reg_field definition by renaming
      omapdss's struct reg_field to dispc_reg_field, and moving it inside
      dispc.c as that's the only place it is used.
      Signed-off-by: NJyri Sarha <jsarha@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5c348ba9
    • T
      OMAPDSS: fix shared irq handlers · 0925afc9
      Tomi Valkeinen 提交于
      DSS uses shared irq handlers for DISPC and DSI, because on OMAP3, the
      DISPC and DSI share the same irq line.
      
      However, the irq handlers presume that the hardware is enabled, which,
      in theory, may not be the case with shared irq handlers. So if an
      interrupt happens while the DISPC/DSI is off, the kernel will halt as
      the irq handler tries to access the DISPC/DSI registers.
      
      In practice that should never happen, as both DSI and DISPC are in the
      same power domain. So if there's an IRQ for one of them, the other is
      also enabled. However, if CONFIG_DEBUG_SHIRQ is enabled, the kernel will
      generate a spurious IRQ, which then causes the problem.
      
      This patch adds an is_enabled field for both DISPC and DSI, which is
      used to track if the HW is enabled. For DISPC the code is slightly more
      complex, as the users of DISPC can register the interrupt handler, and
      we want to hide the is_enabled handling from the users of DISPC.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      0925afc9
  11. 19 3月, 2014 1 次提交
  12. 05 3月, 2014 1 次提交
    • T
      OMAPDSS: convert pixel clock to common videomode style · d8d78941
      Tomi Valkeinen 提交于
      omapdss has its own video-timings struct, but we want to move the common
      videomode.
      
      The first step is to change the omapdss's pixelclock unit from kHz to
      Hz. Also, omapdss uses "pixel_clock" field name, whereas the common
      videomode uses "pixelclock" field name. This patch changes the field
      name also, as that makes it easy to spot any non-converted pixel_clock
      uses.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      d8d78941
  13. 28 2月, 2014 1 次提交
  14. 11 2月, 2014 1 次提交
    • T
      OMAPDSS: DISPC: decimation rounding fix · eec77da2
      Tomi Valkeinen 提交于
      The driver uses DIV_ROUND_UP when calculating decimated width & height.
      For example, when decimating with 3, the width is calculated as:
      
        width = DIV_ROUND_UP(width, decim_x);
      
      This yields bad results for some values. For example, 800/3=266.666...,
      which is rounded to 267. When the input width is set to 267, and pixel
      increment is set to 3, this causes the dispc to read a line of 801
      pixels, i.e. it reads a wrong pixel at the end of the line.
      
      Even more pressing, the above rounding causes a BUG() in pixinc(), as
      the value of 801 is used to calculate row increment, leading to a bad
      value being passed to pixinc().
      
      This patch fixes the decimation by removing the DIV_ROUND_UP()s when
      calculating width and height for decimation.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      eec77da2
  15. 14 1月, 2014 1 次提交
    • I
      OMAPDSS: DISPC: Fix 34xx overlay scaling calculation · e4998634
      Ivaylo Dimitrov 提交于
      commit 7faa9233 OMAPDSS: DISPC: Handle
      synclost errors in OMAP3 introduces limits check to prevent SYNCLOST errors
      on OMAP3. However, it misses the logic found in Nokia kernels that is
      needed to correctly calculate whether 3 tap or 5 tap rescaler to be used as
      well as the logic to fallback to 3 taps if 5 taps clock results in too
      tight horizontal timings. Without that patch "horizontal timing too tight"
      errors are seen when a video with resolution above 640x350 is tried to be
      played. The patch is a forward-ported logic found in Nokia N900 and N9/50
      kernels.
      Signed-off-by: NIvaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      e4998634
  16. 13 1月, 2014 2 次提交
    • A
      OMAPDSS: DISPC: Preload more data in pipeline DMAs for OMAP4+ SoCs · 8bc65552
      Archit Taneja 提交于
      DISPC pipeline DMAs preload some bytes of pixel data in the vertical blanking
      region before the start of each frame. The preload ensures the pipeline doesn't
      underflow when the active region of the display starts.
      
      DISPC_GFX/VIDp_PRELOAD registers allow us to program how many bytes of data
      should be preloaded for each pipeline. Calculating a precise preload value
      would be a complex function of the pixel clock of the connected display, the
      vertical blanking duration and the interconnect traffic at that instance. If
      the register is left untouched, a default value is preloaded.
      
      We observe underflows for OMAP4+ SoCs for certain bandwidth intensive use cases
      with many other initiators active, and in situations where memory access isn't
      very efficient(like accessing Tiler mapped buffers and EMIF configured in
      non-interleaved more). The cause of the underflow is because the default preload
      value isn't sufficient for the DMA to reach a steady state. We configure the
      PRELOAD register such that the pipelines preload data up to the high threshold
      of the FIFO.
      
      Preloading lot of data for older SoCs can have a negative impact. Due to slower
      interconnects, it's possible that the DISPC DMA cannot preload up to the high
      threshold within the vertical blanking region of the panel. We leave the PRELOAD
      registers to their reset values since we haven't faced underflows with these
      SoCs because of low value of PRELOAD.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      8bc65552
    • T
      OMAPDSS: DISPC: fix context restore · be07dcd7
      Tomi Valkeinen 提交于
      DISPC_MSTANDBY_CTRL register is used in the driver, but it's not
      restored in dispc_restore_context(), causing problems after resume.
      
      Instead of adding DISPC_MSTANDBY_CTRL to dispc_restore_context(), let's
      call _omap_dispc_initial_config() as the first thing in
      dispc_runtime_resume(). This will initialize the DISPC core registers
      properly, and will avoid similar issues in the future.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      be07dcd7
  17. 09 1月, 2014 1 次提交
    • T
      drm/omap: fix (un)registering irqs inside an irq handler · 6da9f891
      Tomi Valkeinen 提交于
      omapdrm (un)registers irqs inside an irq handler. The problem is that
      the (un)register function uses dispc_runtime_get/put() to enable the
      clocks, and those functions are not irq safe by default.
      
      This was kind of fixed in 48664b21
      (OMAPDSS: DISPC: set irq_safe for runtime PM), which makes dispc's
      runtime calls irq-safe.
      
      However, using pm_runtime_irq_safe in dispc makes the parent of dispc,
      dss, always enabled, effectively preventing PM for the whole DSS module.
      
      This patch makes omapdrm behave better by adding new irq (un)register
      functions that do not use dispc_runtime_get/put, and using those
      functions in interrupt context. Thus we can make dispc again
      non-irq-safe, allowing proper PM.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Rob Clark <robdclark@gmail.com>
      6da9f891
  18. 30 12月, 2013 1 次提交