1. 11 Apr, 2013 6 commits
    • Archit Taneja's avatar
      drm/omap: Fix and improve crtc and overlay manager correlation · 0d8f371f
      Archit Taneja authored
      The omapdrm driver currently takes a config/module arg to figure out the number
      of crtcs it needs to create. We could create as many crtcs as there are overlay
      managers in the DSS hardware, but we don't do that because each crtc eats up
      one DSS overlay, and that reduces the number of planes we can attach to a single
      crtc.
      
      Since the number of crtcs may be lesser than the number of hardware overlay
      managers, we need to figure out which overlay managers to use for our crtcs. The
      current approach is to use pipe2chan(), which returns a higher numbered manager
      for the crtc.
      
      The problem with this approach is that it assumes that the overlay managers we
      choose will connect to the encoders the platform's panels are going to use,
      this isn't true, an overlay manager connects only to a few outputs/encoders, and
      choosing any overlay manager for our crtc might lead to a situation where the
      encoder cannot connect to any of the crtcs we have chosen. For example, an
      omap5-panda board has just one hdmi output. If num_crtc is set to 1, with the
      current approach, pipe2chan will pick up the LCD2 overlay manager, which cannot
      connect to the hdmi encoder at all. The only manager that could have connected
      to hdmi was the TV overlay manager.
      
      Therefore, there is a need to choose our overlay managers keeping in mind the
      panels we have on that platform. The new approach iterates through all the
      available panels, creates encoders and connectors for them, and then tries to
      get a suitable overlay manager to create a crtc which can connect to the
      encoders.
      
      We use the dispc_channel field in omap_dss_output to retrieve the desired
      overlay manager's channel number, we then check whether the manager had already
      been assigned to a crtc or not. If it was already assigned to a crtc, we assume
      that out of all the encoders which intend use this crtc, only one will run at a
      time. If the overlay manager wan't assigned to a crtc till then, we create a
      new crtc and link it with the overlay manager.
      
      This approach just looks for the best dispc_channel for each encoder. On DSS HW,
      some encoders can connect to multiple overlay managers. Since we don't try
      looking for alternate overlay managers, there is a greater possibility that 2
      or more encoders end up asking for the same crtc, causing only one encoder to
      run at a time.
      
      Also, this approach isn't the most optimal one, it can do either good or bad
      depending on the sequence in which the panels/outputs are parsed. The optimal
      way would be some sort of back tracking approach, where we improve the set of
      managers we use as we iterate through the list of panels/encoders. That's
      something left for later.
      Signed-off-by: default avatarArchit Taneja <archit@ti.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      0d8f371f
    • Archit Taneja's avatar
      drm/omap: Take a fb reference in omap_plane_update() · b03e14fd
      Archit Taneja authored
      When userspace calls SET_PLANE ioctl, drm core takes a reference of the fb and
      passes control to the update_plane op defined by the drm driver.
      
      In omapdrm, we have a worker thread which queues framebuffers objects received
      from update_plane and displays them at the appropriate time.
      
      It is possible that the framebuffer is destoryed by userspace between the time
      of calling the ioctl and apply-worker being scheduled. If this happens, the
      apply-worker holds a pointer to a framebuffer which is already destroyed.
      
      Take an extra refernece/unreference of the fb in omap_plane_update() to prevent
      this from happening. A reference is taken of the fb passed to update_plane(),
      the previous framebuffer (held by plane->fb) is unreferenced. This will prevent
      drm from destroying the framebuffer till the time it's unreferenced by the
      apply-worker.
      
      This is in addition to the exisitng reference/unreference in update_pin(),
      which is taken for the scanout of the plane's current framebuffer, and an
      unreference the previous framebuffer.
      Signed-off-by: default avatarArchit Taneja <archit@ti.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      b03e14fd
    • Archit Taneja's avatar
      drm/omap: Make fixed resolution panels work · bddabbe1
      Archit Taneja authored
      The omapdrm driver requires omapdss panel drivers to expose ops like detect,
      set_timings and check_timings. These can be NULL for fixed panel DPI, DBI, DSI
      and SDI drivers. At some places, there are no checks to see if the panel driver
      has these ops or not, and that leads to a crash.
      
      The following things are done to make fixed panels work:
      
      - The omap_connector's detect function is modified such that it considers panel
        types which are generally fixed panels as always connected(provided the panel
        driver doesn't have a detect op). Hence, the connector corresponding to these
        panels is always in a 'connected' state.
      
      - If a panel driver doesn't have a check_timings op, assume that it supports the
        mode passed to omap_connector_mode_valid(the 'mode_valid' drm helper function)
      
      - The function omap_encoder_update shouldn't really do anything for fixed
        resolution panels, make sure that it calls set_timings only if the panel
        driver has one.
      Signed-off-by: default avatarArchit Taneja <archit@ti.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      bddabbe1
    • Archit Taneja's avatar
      drm/omap: fix modeset_init if a panel doesn't satisfy omapdrm requirements · 581382e3
      Archit Taneja authored
      modeset_init iterates through all the registered omapdss devices and has some
      initial checks to see if the panel has a driver and the required driver ops for
      it to be usable by omapdrm.
      
      The function bails out from modeset_init if a panel doesn't meet the
      requirements, and stops the registration of the future panels and encoders which
      come after it, that isn't the correct thing to do, we should go through the rest
      of the panels. Replace the 'return's with 'continue's.
      Signed-off-by: default avatarArchit Taneja <archit@ti.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      581382e3
    • Tomi Valkeinen's avatar
      OMAPDSS: DPI: widen the pck search when using dss fck · 2c6360fb
      Tomi Valkeinen authored
      When not using DSI PLL to generate the pixel clock, but DSS FCK, the
      possible pixel clock rates are rather limited. DSS FCK is currently used
      on OMAP2 and OMAP3.
      
      When using Beagleboard with a monitor that supports high resolutions,
      the clock rates do not match (at least for me) for the monitor's pixel
      clocks within the current threshold in the code, which is +/- 1MHz.
      
      This patch widens the search up to +/- 15MHz. The search is done in
      steps, i.e. it first tries to find a rather exact clock, than a bit less
      exact, etc. so this should not change the cases where a clock was
      already found.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      2c6360fb
    • Tomi Valkeinen's avatar
      OMAPDSS: fix dss_fck clock rate rounding · 648a55e1
      Tomi Valkeinen authored
      DSS func clock is calculated with prate / div * m. However, the current
      omapdss code calculates it with prate * m / div, which yields a slightly
      different result when there's a remainder. For example, 432000000 / 14 *
      2 = 61714284, but 432000000 * 2 / 14 = 61714285.
      
      In addition to that, the clock framework wants the clock rate given with
      clk_set_rate to be higher than the actual (truncated) end result. So, if
      prate is 432000000, and div is 14, the real result is 30857142.8571...
      We need to call clk_set_rate with 30857143, which gives us a clock of
      30857142. That's why we need to use DIV_ROUND_UP() when calling
      clk_set_rate.
      
      This patch fixes the clock calculation.
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      648a55e1
  2. 03 Apr, 2013 28 commits
  3. 31 Mar, 2013 5 commits
    • Linus Torvalds's avatar
      Linux 3.9-rc5 · 07961ac7
      Linus Torvalds authored
      07961ac7
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma · 0bb44280
      Linus Torvalds authored
      Pull slave-dmaengine fixes from Vinod Koul:
       "Two fixes for slave-dmaengine.
      
        The first one is for making slave_id value correct for dw_dmac and
        the other one fixes the endieness in DT parsing"
      
      * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
        dw_dmac: adjust slave_id accordingly to request line base
        dmaengine: dw_dma: fix endianess for DT xlate function
      0bb44280
    • Linus Torvalds's avatar
      Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · a7b436d3
      Linus Torvalds authored
      Pull media fixes from Mauro Carvalho Chehab:
       "For a some fixes for Kernel 3.9:
         - subsystem build fix when VIDEO_DEV=y, VIDEO_V4L2=m and I2C=m
         - compilation fix for arm multiarch preventing IR_RX51 to be selected
         - regression fix at bttv crop logic
         - s5p-mfc/m5mols/exynos: a few fixes for cameras on exynos hardware"
      
      * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
        [media] [REGRESSION] bt8xx: Fix too large height in cropcap
        [media] fix compilation with both V4L2 and I2C as 'm'
        [media] m5mols: Fix bug in stream on handler
        [media] s5p-fimc: Do not attempt to disable not enabled media pipeline
        [media] s5p-mfc: Fix encoder control 15 issue
        [media] s5p-mfc: Fix frame skip bug
        [media] s5p-fimc: send valid m2m ctx to fimc_m2m_job_finish
        [media] exynos-gsc: send valid m2m ctx to gsc_m2m_job_finish
        [media] fimc-lite: Fix the variable type to avoid possible crash
        [media] fimc-lite: Initialize 'step' field in fimc_lite_ctrl structure
        [media] ir: IR_RX51 only works on OMAP2
      a7b436d3
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20130331' of git://git.kernel.dk/linux-block · d299c290
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Alright, this time from 10K up in the air.
      
        Collection of fixes that have been queued up since the merge window
        opened, hence postponed until later in the cycle.  The pull request
        contains:
      
         - A bunch of fixes for the xen blk front/back driver.
      
         - A round of fixes for the new IBM RamSan driver, fixing various
           nasty issues.
      
         - Fixes for multiple drives from Wei Yongjun, bad handling of return
           values and wrong pointer math.
      
         - A fix for loop properly killing partitions when being detached."
      
      * tag 'for-linus-20130331' of git://git.kernel.dk/linux-block: (25 commits)
        mg_disk: fix error return code in mg_probe()
        rsxx: remove unused variable
        rsxx: enable error return of rsxx_eeh_save_issued_dmas()
        block: removes dynamic allocation on stack
        Block: blk-flush: Fixed indent code style
        cciss: fix invalid use of sizeof in cciss_find_cfgtables()
        loop: cleanup partitions when detaching loop device
        loop: fix error return code in loop_add()
        mtip32xx: fix error return code in mtip_pci_probe()
        xen-blkfront: remove frame list from blk_shadow
        xen-blkfront: pre-allocate pages for requests
        xen-blkback: don't store dev_bus_addr
        xen-blkfront: switch from llist to list
        xen-blkback: fix foreach_grant_safe to handle empty lists
        xen-blkfront: replace kmalloc and then memcpy with kmemdup
        xen-blkback: fix dispatch_rw_block_io() error path
        rsxx: fix missing unlock on error return in rsxx_eeh_remap_dmas()
        Adding in EEH support to the IBM FlashSystem 70/80 device driver
        block: IBM RamSan 70/80 error message bug fix.
        block: IBM RamSan 70/80 branding changes.
        ...
      d299c290
    • Paul Walmsley's avatar
      Revert "lockdep: check that no locks held at freeze time" · dbf520a9
      Paul Walmsley authored
      This reverts commit 6aa97070.
      
      Commit 6aa97070 ("lockdep: check that no locks held at freeze time")
      causes problems with NFS root filesystems.  The failures were noticed on
      OMAP2 and 3 boards during kernel init:
      
        [ BUG: swapper/0/1 still has locks held! ]
        3.9.0-rc3-00344-ga937536b #1 Not tainted
        -------------------------------------
        1 lock held by swapper/0/1:
         #0:  (&type->s_umount_key#13/1){+.+.+.}, at: [<c011e84c>] sget+0x248/0x574
      
        stack backtrace:
          rpc_wait_bit_killable
          __wait_on_bit
          out_of_line_wait_on_bit
          __rpc_execute
          rpc_run_task
          rpc_call_sync
          nfs_proc_get_root
          nfs_get_root
          nfs_fs_mount_common
          nfs_try_mount
          nfs_fs_mount
          mount_fs
          vfs_kern_mount
          do_mount
          sys_mount
          do_mount_root
          mount_root
          prepare_namespace
          kernel_init_freeable
          kernel_init
      
      Although the rootfs mounts, the system is unstable.  Here's a transcript
      from a PM test:
      
        http://www.pwsan.com/omap/testlogs/test_v3.9-rc3/20130317194234/pm/37xxevm/37xxevm_log.txt
      
      Here's what the test log should look like:
      
        http://www.pwsan.com/omap/testlogs/test_v3.8/20130218214403/pm/37xxevm/37xxevm_log.txt
      
      Mailing list discussion is here:
      
        http://lkml.org/lkml/2013/3/4/221
      
      Deal with this for v3.9 by reverting the problem commit, until folks can
      figure out the right long-term course of action.
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Mandeep Singh Baines <msb@chromium.org>
      Cc: Jeff Layton <jlayton@redhat.com>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: <maciej.rutecki@gmail.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ben Chan <benchan@chromium.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dbf520a9
  4. 30 Mar, 2013 1 commit
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 13d2080d
      Linus Torvalds authored
      Pull SCSI target fixes from Nicholas Bellinger:
       "This includes the bug-fix for a >= v3.8-rc1 regression specific to
        iscsi-target persistent reservation conflict handling (CC'ed to
        stable), and a tcm_vhost patch to drop VIRTIO_RING_F_EVENT_IDX usage
        so that in-flight qemu vhost-scsi-pci device code can detect the
        proper vhost feature bits.
      
        Also, there are two more tcm_vhost patches still being discussed by
        MST and Asias for v3.9 that will be required for the in-flight qemu
        vhost-scsi-pci device patch to function properly, and that should
        (hopefully) be the last target fixes for this round."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        target: Fix RESERVATION_CONFLICT status regression for iscsi-target special case
        tcm_vhost: Avoid VIRTIO_RING_F_EVENT_IDX feature bit
      13d2080d