Commit Graph

22 Commits

Author SHA1 Message Date
Sudhir Sharma
bea6dbbe98 Revert "Camera Bring-up MR1."
This reverts commit 5cf67b1a1f82e20e9659a4a120c67abe4f918893.

Change-Id: If4e182553f46918e5b7a84e9f915039a52541ebb
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:21:25 -08:00
Azam Sadiq Pasha Kapatrala Syed
ded2688a9d Camera Bring-up MR1.
Change-Id: I84d3b4d7ff4147506fdfc81cd26b0aa9cfb72467
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:21:17 -08:00
David Brown
a01a8cabfd msm: video: vcap: Add video capture driver
commit 6a744e339817d68e2b371fa35b0040382b38d044
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Dec 7 15:50:32 2012 -0500

    media: video: Allow NR threshold to be updated by motion est

    VCAP did not allow for client to update threshold values based
    on the motion estimation. By enabling an option for this threshold
    to be updated dynamically by hardware, this allows for a more
    aggressive noise reduction to be applied at the request of the
    client.

    Change-Id: I0ac590ef826ce4567c048745efafbeb05011f31e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 06550627e1f08b3956e9bf190999cd14123acf9d
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Nov 30 14:35:16 2012 -0500

    media: video: Prevent memory leak in VCAP

    If a client were to do the following, VCAP would not free the ion
    handle:
     -Opened VCAP
     -Start initial configuration
     -Queues buffers
     -Close VCAP without ever calling stream on

    Since VCAP was not freeing ion this would cause a memory leak

    CRs-Fixed: 423881
    Change-Id: I594924d85884aa5e0a647bc52fa9e89e720f4ff6
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 14600e5b94992cebb0cdc1b541293c8f6c952715
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Nov 7 17:16:27 2012 -0500

    media: video: vp_enabled state incorrect after a forced reset

    After a forced reset occurred on VP, during a stream_off call,
    vp_enabled state was incorrect causing one extra call to
    disable_irq. This would result in VP isr to be called whenever
    interrupt was triggered.

    CRs-Fixed: 418792
    Change-Id: Ia66b2d70506d4b06782bc5c25c83587c78f8e9c8
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit df1d4deafb7931eed7ae102440aea76647aab234
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Nov 5 17:06:02 2012 -0500

    media: video: Stride alignment configurable by client

    Prior to this patch VCAP assumed that the line stride should be
    aligned to 16 bytes. It is possible that that the client needs a
    line stride to be 32 bytes aligned. Line stride is now a
    configurable parameter.

    Change-Id: Id05aa862813582c23b18c79bd9edf95b2cdfffbe
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit b0c58b1c28f95b653808a32e1069f88e474bfd0d
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Oct 30 17:56:36 2012 -0400

    media: video: Prevent buffer ion resource from being freed twice

    It was possible for the client to have two threads running where
    one would be blocked in dq_buf that would wake up while the other
    thread was in the process of turning the stream off. This cause
    two thread to try freeing the ion resource which would result
    in a crash.

    Change-Id: Ibbbf34c7770eed99e1a89d2a4c41ad48f5b6a13a
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit aa64d3a2c70286485c37ae640bf929c451ac6188
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Oct 29 13:05:37 2012 -0400

    media: video: VC ISR restructure to make code more readable

    As new features were added to VCAP the ISR for VC has become
    increasingly complex and difficult to read. It was determined that
    the VC ISR code should be simplified and cleaned up in order to
    make the code flow more easier to read.

    Change-Id: If7bc0a41e14c40f67120dacde9a1544e8f1ef7b1
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 37b1ecc312d7fcc3baa4423dfde6a107d85c2500
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Oct 29 17:53:39 2012 -0400

    media: video: Make VCAP properly call regulator_get

    VCAP was not providing a pointer to the device when calling
    regulator_get. Although the call was able to get the regulator,
    there was always an error message regarding not being able to
    create a debugfs node. The problem was because the device provided
    to the regulator_get call was NULL.

    Change-Id: I6b344cafd96db50e95abfbf46021a361ac0de638
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 1f0f274818326a871184fa3e5597d0d2d82002b1
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Oct 24 17:43:47 2012 -0400

    media: video: VC to use data polarity given by client

    VC would ignore the polarity given by the client and hardcode the
    value to zero. Now client is properly reporting value, VC now
    takes the value provided by the client.

    Change-Id: I511b59ed3e9f6b47d14cd688592d85ab97a5204d
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit f0ab1ee4a19e9616b8726d7974b1fb89baec9086
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Oct 22 12:43:36 2012 -0400

    media: video: Force drop 2nd field after VC drops 1st field

    If a field was dropped by the VC, the VP would not be able to
    de-interlace the content properly. The problem with the VP is
    it would have an unbalanced number of top fields and bottom
    fields. In order to alleviate this problem the subsequent field
    will also be dropped. That way there would be a balanced number
    of top and bottom fields in the VP which would prevent jumping
    behavior observed in the de-interlaced frame.

    Change-Id: I96e8c0670b5b29baea8d1574b21c259c16a7a32e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 0857c97b89fdc6316ed3a1029179963a07c785b4
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Oct 17 16:24:21 2012 -0400

    media: video: Prevent VCAP from dequeue buffers once turned off

    VCAP should not report any buffers ready to be dequeued or allow
    for any buffers to be dq once streamoff has been called.

    CRs-Fixed: 398896
    Change-Id: I2eccf62b7ddff0f7cc0343c8e26bd699b335b9dc
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 8d1c327634466332a93c6d7403758e61de79f728
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Jul 27 16:36:31 2012 -0400

    media: video: Use IOMMU mapping API

    The ion_phys API is being deprecated. Instead there is a new set
    of API.

    Change-Id: I701cc045fe5a0cb0026574dd08016a2bccbc4c72
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit f1b7b584430f6cd33bfee13b916a084fc1b80419
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Oct 16 11:49:24 2012 -0400

    media: video: Shutdown VP before freeing VP buffers

    It was possible for buffers to be freed while VP was still using
    them. This patch ensures that VP has been stopped before that
    happens.

    Change-Id: Ifff689f690cdc43c935ee355dfaca61ade9e9d65
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 9d6f89cb2343ff5adaccb77a177fdc6c3844c65d
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Oct 3 16:24:04 2012 -0400

    msm: mpq8064: Correct VCAP stride calucation

    VCAP was not properly calucating the stride values. This patch
    allows for line stride to be 16 byte aligned.

    CRs-Fixed: 390191
    Change-Id: Id9eca2fd3ec4a51347f2656271591f7bccf36ad5
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit c4aa4c09475ed3029d010417393a6a6368449772
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Aug 31 04:49:21 2012 -0400

    msm: mpq8064: Adding debugfs support to VCAP

    In order to assist in debugging various VCAP issue it would be
    useful to have debugfs. This patch is about making everything to
    debug VCAP, from message to getting important data, available
    within debugfs.

    Change-Id: Ic9373036af6a5eb795da2d89d6f26fcd404264af
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit f3cd9a12838bfe4688e184f90ad16b6c304a8245
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Sep 21 11:18:02 2012 -0400

    msm: mpq8064: Correct VP event type

    There is a VP error that was being incorrectly reported as a VC
    error event. This patch allows for the error to properly be
    reported.

    Change-Id: Ic2a1c6eb3b149bb7075417d54e2040d2261dda08
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 674f4799a54da7f5c38675308c3471c1b70bba4f
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Sep 21 11:10:22 2012 -0400

    msm: mpq8064: VCAP probe properly reports failures

    It was possible for VCAP probe to fail, but still return 0.

    Change-Id: I395cecea90475ea07491a57dde12aae1fa67166e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit f51f6e6d43c8d1d9b5a8ed86e044f19020146407
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Aug 29 11:02:17 2012 -0400

    msm: mpq8064: Improve VCAP performance

    This patch increase bandwidth request and VCAP core clock
    for 1080 interlace or progressive content. This increase
    helps VCAP capture and process content in a timely manner.

    Change-Id: I8cb8d6e87954272b28a8e83351152354ea75a184
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 911b4b702a63fbd241863966cad45909e40e4665
Author: Mitchel Humpherys <mitchelh@codeaurora.org>
Date:   Wed Sep 12 14:42:50 2012 -0700

    ion: change ion kernel map function to not take flags argument

    Buffer flags are going to be specified at allocation time rather than
    map time. This removes the flags argument from the ion kernel map
    function.

    Change-Id: I91589ca7b1ab142bb5ac8e6b0f4c06fa1305f23a
    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

commit 7d72bad55a0e03392d81eee77a9a8c9df6b73a9a
Author: Hanumant Singh <hanumant@codeaurora.org>
Date:   Wed Aug 29 18:39:44 2012 -0700

    ion: Port heap mask change to ion

    Heap mask field passes as argument at allocation time to specify ion
    heap.

    Change-Id: I8881dfc491dc0f8f70581ad97b35756a6a33dd6d
    Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

commit 8ba7ad9492496e12c5555da796bc1f60d52c46f8
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Sep 18 17:01:34 2012 -0400

    msm: mpq8064: Improve VP de-interlacing completion time

    VP time to de-interlacing for 1080i content was over 20ms. This
    was way too long considering content updating at 60Hz requires
    latency to be under 16ms. This change allow for de-interlacing
    to complete within 7ms.

    Change-Id: Iae2be758ef8d5a6fcecb96df93448226c9ed9109
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 9c4f8a220532407fd890187522b0ddb365b1d660
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Sep 12 10:25:50 2012 -0400

    msm: mpq8064: VC report field info that is used by VP

    VP assumed that the first field provided was a bottom field, if VP
    was incorrect in this assumption it would not properly de-interlace
    content. It was also possible for VC to drop a field, when this
    happened VP would become out of sync again causing de-interlacing
    to be incorrect.

    CRs-Fixed: 397534
    Change-Id: I7a75a5dcd27149220273284a3d48f407bc5a4f31
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 3af95c07d0ff5be80502734f87ed90dc811face7
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Sep 18 16:43:38 2012 -0400

    msm: mpq8064: VP report proper timestamp value

    There was a problem where de-interlace content was not getting a
    valid timestamp.

    Change-Id: Ief9e19c9d20bae3d785a7932b5021e2bba36d238
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit a1e8af4e6cf4bf8a4187a1be844a1462d37affff
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Sep 18 16:41:57 2012 -0400

    msm: mpq8064: Timestamp properly populated within VCAP

    Before this change VCAP was only populating the usec parameter in
    timeval. Now VCAP populates sec and accounts for timestamp counter
    overflows.

    Change-Id: I32b2c49604baba95f56faa483acfe787fdb13b34
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 616762dc78540d8cf82fed1cbbc19cf90956aa4b
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Thu Aug 16 17:47:44 2012 -0400

    msm: mpq8064: Allow any client to control noise reduction parms

    It was requested that any client be allowed to modify the nr
    parameters. Reason for this is that there will be a separate
    pc tool that will be controlling NR for demos. Also fixed a
    bug with that cause s_fmt to failed with EINVAL when arguments
    were valid.

    Change-Id: Ie58972a036bb6637a938b48212ef85faf894002e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 4b88553634efb3b8748a4c2462c71b69bf491947
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Sep 4 03:51:55 2012 -0400

    msm: mpq8064: Prevent VC from running after error reported

    If VC continues to capture frames after receiving an error the
    frames do not contain a valid frame it is possible for a system
    crash to occur. This change resets NPL as soon as an error occurs,
    thus preventing VC from capturing any more frames. VC waits for
    client to handle error reported by VC.

    CRs-Fixed: 372564
    Change-Id: I72bdbab3251852520801541ed6d5521dc75f7cf1
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 2cba63f9f64c1c5e7d53eeddefc67d075d78d6f8
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Aug 21 10:54:38 2012 -0400

    msm: mpq8064: Allow client to select num bufs for VC to hold onto

    VC part of the VCAP driver was initial implmented for the hardware
    to 2 store and work with 2 buffers. Since hardware is capable of
    storing and filling up to 6 buffers, a new API was created to allow
    client to select how many they want VC to use.

    Change-Id: I0548f1322c9703d9ccf12700be05511b0e1eb0de
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit b128b98ac802c210dfb0ea0b279271c0c24bc2eb
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Thu Aug 16 14:41:19 2012 -0400

    msm: mpq8064: Correct VCAP shutdown procedure

    VCAP hardware shutdown sequence was incorrect. This would cause
    the hardware to become unstable, which would result in the system
    crashing. This patch corrects it so the driver calls the correct
    shutdown procedure.

    Change-Id: I78273f2c70d9eab060dcc34aef0b3704ed685f40
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 72452631e2db3ca641414d05d2437144ac0366c6
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Aug 13 12:32:24 2012 -0400

    msm: mpq8064: Fix false error reported by VP

    Logical or where there should have been a bitwise or. Also ignoring
    cadence change interrupt, because there is nothing for the driver
    to do cadence change occurs.

    Change-Id: I8a6214a66b67f6397a7b99ef54969761640abedf
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit a2cba0df366dc571feb8f8a750405f2ad8284cf6
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Aug 8 11:39:53 2012 -0400

    msm: mpq8064: Use ION to alloc driver buffers

    Since VCAP is behind IOMMU, in order to get proper address for VCAP
    hw to write to driver needs to alloc buffer from ION and not
    kzalloc.

    Change-Id: I1f4fcc6834d0ea09ba0fc812b301219d35f40721
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit cc88c1256aaf04ad1ecc1d7ae6b35ae05112a397
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Jul 16 18:20:02 2012 -0400

    msm: mpq8064: Avoid NPL clock overflow

    Since external components has its own variation there is a need
    for an additional 2% margin for the npl_clk

    Change-Id: I27d77ccd2f5cd9a9635975ea286bf3d0f8dba1d2
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 3dff4ef26eb40494eebb17adef80e66a0a469478
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Jun 13 15:20:59 2012 -0400

    msm: mpq8064: Enable separate ioctl call for noise reduction (nr)

    NR for VCAP is capable of receiving manual tuning parameters. In
    order for the client to pass in these parameters a separate ioctl
    was developed.

    Change-Id: Ia8d7e8de80ee4fd7ccd2019d30b4457f1000e106
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 54d3a6d39374c5fe3bd22be970717f57480d6ad8
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Jul 10 14:05:35 2012 -0400

    msm: mpq8064: Dummy read to prevent false interrupt from triggering

    The VBIF is capable of triggering a false bus error the first time
    it performs a read. This fix creates a dummy read event that
    happens every time that the VCAP is powered on that will ignore
    the false positive VBIF interrupt error, so that during normal
    operation the error can be properly identified.

    Change-Id: Ie56e60faf2067fab7a05a0f16c2d840408c35035
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit ad33c513b4b9455f0822c125affc39138603459e
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Jul 16 17:50:00 2012 -0400

    msm: mpq8064: VCAP corner case bug fixes

    Closing VCAP devices could be called without calling stream off:
    This problem would make VCAP resources taken by devices no longer
    running.

    Using unsigned variable to store signed result: This problem would
    allow stream on to continue even when function returned error.

    Fix problem of reading VP irq status register too early: It was
    possible for cadence detection bit to be propgated faster by only
    a few clock cycles then the picture done bit. When the irq status
    read was performed and by the time a write to the clear register
    was performed the picture done bit would propgate. Since the irq
    is rising edge triggered this would cause a problem and the irq
    would not be triggered until VP was reset.

    Remove unused code

    Change-Id: Iba72354c06287efb27178edf64d8d3f459dbf954
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit a6c9648dd8e85e1e1e854347a78e4497578ebf51
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Jul 6 17:53:09 2012 -0400

    msm: mpq8064: Separate q/dq buffer for VCAP de-interlacing mode

    This change fixes a crash when running VCAP in de-interlace mode.
    The problem was noticed in the introduction of kernel 3.4. VCAP
    was improperly using the videobuf2 framework APIs. Since VCAP is
    already reliant on queue structure provided by videobuf2 framework,
    we created our own basic version of the qbuf and dqbuf calls that
    have some similarities to the videobuf2 framework. This addition
    was necessary since we are calling qbuf from a kernel work thread.
    Since moving to kernel 3.4 there has been a change in videobuf2
    qbuf that dereferences the current process.s mm_struct, from a
    kernel work thread this struct is NULL, which was causing a crash.
    When we are de-interlacing a captured video we are cycling the
    buffers internally in the driver, which is why we needed to create
    our own q/dq buffer functionality.

    Change-Id: Id51b775ae7f0a58bbac8a581e07fa02417802a30
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit b14ed96f74b1258b1f102831a2b0ccd56f991132
Author: Laura Abbott <lauraa@codeaurora.org>
Date:   Mon Jan 30 14:18:08 2012 -0800

    gpu: ion: Pull in patches for 3.4

    Pull in Ion patches for 3.4 upgrade. Inclues the following
    patches from google:

     commit 7191e9ba25
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Mon Jan 30 14:18:08 2012 -0800

         ion: Switch map/unmap dma api to sg_tables

         Switch these api's from scatterlists to sg_tables

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 6f9e56945d
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Tue Jan 31 09:40:30 2012 -0800

         ion: Add reserve function to ion

         Rather than requiring each platform call memblock_remove or reserve
         from the board file, add this to ion

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 9ae7e01de1
     Author: KyongHo Cho <pullip.cho@samsung.com>
     Date:   Wed Sep 7 11:27:07 2011 +0900

         gpu: ion: several bugfixes and enhancements of ION

         1. Verifying if the size of memory allocation in ion_alloc() is aligned
         by PAGE_SIZE at least. If it is not, this change makes the size to be
         aligned by PAGE_SIZE.

         2. Unmaps all mappings to the kernel and DMA address spaces when
         destroying ion_buffer in ion_buffer_destroy(). This prevents leaks in
         those virtual address spaces.

         3. Makes the return value of ion_alloc() to be explicit Linux error code
         when it fails to allocate a buffer.

         4. Makes ion_alloc() implementation simpler. Removes 'goto' statement and
         relavant call to ion_buffer_put().

         5. Checks if the task is valid before calling put_task_struct() due
         to failure on creating a ion client in ion_client_create().

         6. Returns error when buffer allocation requested by userspace is failed.

         Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>

     commit 043a61468f
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Wed Feb 1 11:09:46 2012 -0800

         ion: Switch ion to use dma-buf

         Ion now uses dma-buf file descriptors to share
         buffers with userspace.  Ion becomes a dma-buf
         exporter and any driver that can import dma-bufs
         can now import ion file descriptors.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 0d1259b5f8
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Mon Apr 30 16:45:38 2012 -0700

         gpu: ion: Use alloc_pages instead of vmalloc from the system heap

         With this change the ion_system_heap will only use kernel address
         space when the memory is mapped into the kernel (rare case).

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit be4a1ee79a
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Thu Apr 26 20:44:10 2012 -0700

         gpu: ion: support begin/end and kmap/kunmap dma_buf ops

         These ops were added in the 3.4 kernel.  This patch adds support
         for them to ion.  Previous ion_map/unmap_kernel api is also
         retained in addition to this new api.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 46d71337f9
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Mon May 7 16:06:32 2012 -0700

         gpu: ion: Allocate the sg_table at creation time rather than dynamically

         Rather than calling map_dma on the allocations dynamically, this patch
         switches to creating the sg_table at the time the buffer is created.
         This is necessary because in future updates the sg_table will be used
         for cache maintenance.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 903f6c716d
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Wed May 23 12:55:55 2012 -0700

         gpu: ion: Get an sg_table from an ion handle

         This patch adds an interface to return and sg_table given a
         valid ion handle.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

    The commit also includes fixups needed for MSM specific code.

    Change-Id: Idbcfa9d6af0febf06f56daaa6beaa59cc08e4351
    Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

commit 779dc76f0a8d5db02df5d8b7d9794cd6766d0b9d
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Thu Jun 7 15:59:27 2012 -0400

    msm: mpq8064: Allow power up and down to be more dynamic

    To save power regulators are only powered on when needed. Also in
    this change is that clock rate is not longer set to max rate.
    Clock speed set to lowest rate and still remain properly functional

    Change-Id: I7141c8d630e4dbf5c2593e0aea9a18dc3866a1fd
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 98d11809bd87467a452f9e74d591515499abcfd8
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Jun 6 18:18:43 2012 -0400

    msm: mpq8064: Enable v4l2 event handle in VCAP

    This will allow client to subscribe and receive events regarding
    VCAP device

    Change-Id: If8b6723feaa29dcf4e6a3bb9275ccc776081c830
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 5b1e6f1afb70ace03b32b48d4d70f34302decdc2
Author: Laura Abbott <lauraa@codeaurora.org>
Date:   Mon May 28 08:13:55 2012 -0700

    msm: camera: Remove subsystem_map header

    The old subsystem_map APIs are being deprecated. The
    msm_subsystem_map.h header file used to have definitions for
    iommu domains. Remove this header file and include iommu_domains.h
    to get the necessary iommu definitions.

    Change-Id: I417a357789a8fea16bbadd98663a8ebe873ff4e7
    Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

commit aeb793ea48f0958b0aafac76c3fe774862f4dc69
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri May 11 11:41:16 2012 -0400

    msm: mpq8064: Add Video processing driver block for VCAP

    Adding VP portion to MSM VCAP. VP is used for deinterlacing video.

    Change-Id: I888e841cf4d65cf1e5b0316db16923c914469235
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 7d5bfbc69248f59e4889372e536d310ccfeb49a3
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue May 8 13:33:48 2012 -0400

    msm: mpq8064: Client passes timing information to VCAP

    This will allow the VCAP driver to be more dynamic and will allow
    for the timing table to be removed from the Video Capture

    Change-Id: Ib631104cc2c45adf429b6a6ca90415c191e24566
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 3cd5b3d7ce774bf6ea5b1aa5cf38db9ac470985c
Author: Matt Wagantall <mattw@codeaurora.org>
Date:   Thu May 3 20:35:20 2012 -0700

    msm: vcap: Pass device pointers to regulator_get()

    Passing a device pointer instead of NULL as the first argument
    to regulator_get() allows the device to be taken into account
    when finding a matching regulator.

    Change-Id: I8cb02e5dc3294090f2f81371fca64b82139756d7
    Signed-off-by: Matt Wagantall <mattw@codeaurora.org>

commit 2dd21d788f51b52b32b3bbfd9baeda9726940ad7
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Apr 24 11:16:51 2012 -0400

    msm: mpq8064: Change in how vcap req_buf calcs num buf

    A design change in how req_buf is suppose to work. Before req_buf
    would set the number of buffers needed to the minimum required by
    VCAP plus one buffer for cycling. The design now is now designed
    that req_buf now adds the minimum number of buffers requred by the
    VCAP to the value passed in.

    Change-Id: If3ac47fee076aefc9095804abfb38cf26c4a806f
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit a6914ca5f03f7f8e35ad443c612a6081a8efa127
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Apr 9 14:06:50 2012 -0400

    msm: mpq8064: Add VCAP v4l2 device for MPQ8064

    Adding v4l2 interface for VCAP device driver that utilizes
    video capture (VC) portion of VCAP.

    Future addition will allow for v4l2 VCAP to utilize video
    processing (VP).

    Change-Id: I5e68f4ba39f569ef07d67ca39fb922ad5a19aa4e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:29:48 -08:00
Linus Torvalds
250f6715a4 Merge tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
Pull <linux/device.h> avoidance patches from Paul Gortmaker:
 "Nearly every subsystem has some kind of header with a proto like:

	void foo(struct device *dev);

  and yet there is no reason for most of these guys to care about the
  sub fields within the device struct.  This allows us to significantly
  reduce the scope of headers including headers.  For this instance, a
  reduction of about 40% is achieved by replacing the include with the
  simple fact that the device is some kind of a struct.

  Unlike the much larger module.h cleanup, this one is simply two
  commits.  One to fix the implicit <linux/device.h> users, and then one
  to delete the device.h includes from the linux/include/ dir wherever
  possible."

* tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  device.h: audit and cleanup users in main include dir
  device.h: cleanup users outside of linux/include (C files)
2012-03-24 10:41:37 -07:00
Paul Gortmaker
313162d0b8 device.h: audit and cleanup users in main include dir
The <linux/device.h> header includes a lot of stuff, and
it in turn gets a lot of use just for the basic "struct device"
which appears so often.

Clean up the users as follows:

1) For those headers only needing "struct device" as a pointer
in fcn args, replace the include with exactly that.

2) For headers not really using anything from device.h, simply
delete the include altogether.

3) For headers relying on getting device.h implicitly before
being included themselves, now explicitly include device.h

4) For files in which doing #1 or #2 uncovers an implicit
dependency on some other header, fix by explicitly adding
the required header(s).

Any C files that were implicitly relying on device.h to be
present have already been dealt with in advance.

Total removals from #1 and #2: 51.  Total additions coming
from #3: 9.  Total other implicit dependencies from #4: 7.

As of 3.3-rc1, there were 110, so a net removal of 42 gives
about a 38% reduction in device.h presence in include/*

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-03-16 10:38:24 -04:00
Hans Verkuil
a26243b0e3 [media] v4l2-ctrls: add helper functions for control events
Many drivers just support control events, and most radio drivers just need
to poll for control events. Add some functions to simplify those jobs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14 16:38:43 -02:00
Hans Verkuil
e2ecb257ee [media] v4l2: standardize log start/end message
For drivers that properly use the v4l2 framework (i.e. set v4l2_dev in the
video_device struct), the start and end messages of VIDIOC_LOG_STATUS are
now generated automatically. People tended to forget these, but the v4l2-ctl
tool scans for these messages, and it also makes it easier to read the status
output in the kernel log.

The cx18, ivtv and bttv drivers were changed since they no longer need to
log these start/end messages.

In saa7164 two empty log_status functions were removed.

Also added a helper function to v4l2-ctrl.c that can be used as the
vidioc_log_status callback if all you need to do is to log the current control
values. This is now used by pwc and vivi.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Steven Toth <stoth@kernellabs.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14 16:38:13 -02:00
Hans Verkuil
5626b8c75b [media] v4l2-ctrls: implement new volatile autocluster scheme
The problem tackled in this patch is how to handle volatile autoclusters
correctly. A volatile autocluster is a cluster of related controls where one
control is the control that toggles between manual and auto mode and the other
controls are the values for the manual mode. For example autogain and gain,
autoexposure and exposure, etc.

If the hardware lets you read out the automatically calculated manual values
while in automode, then those manual controls should be marked volatile.

gain value as calculated by the autogain circuitry, then you would mark the
gain control as volatile (i.e. continuously changing).

The question in such use cases is what to do when switching from the auto
mode to the manual mode. Should we switch to the last set manual values or
should the volatile values be copied and used as the initial manual values.

For example: suppose the mode is manual gain and gain is set to 5. Then
autogain is turned on and the gain is set by the hardware to 2. Finally
the user switches back to manual gain. What should the gain be? 2 or 5?

After a long discussion the decisions was made to keep the last value as
calculated by the auto mode (so 2 in the example above).

The reason is that webcams that do such things will adapt themselves to
the current light conditions and when you switch back to manual mode you
expect that you keep the same picture. If you would switch back to old
manual values, then that would give you a suddenly different picture,
which is jarring for the user.

Additionally, this would be difficult to implement in applications that
store and restore the control values at application exit and start.

If you want to keep the old manual values when you switch from auto to
manual, then there would have to be a way for applications to get hold
of those old values while in auto mode, but there isn't.

So this patch will do all the heavy lifting in v4l2-ctrls.c: if you go
from auto mode to manual mode and the manual controls are volatile, then
g_volatile_ctrl will be called to get the current values for the manual
controls before switching to manual mode.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-21 10:48:30 -03:00
Hans Verkuil
88365105d6 [media] v4l2-ctrls: replace is_volatile with V4L2_CTRL_FLAG_VOLATILE
With the new flag there is no need anymore to have a separate is_volatile
field. Modify all users to use the new flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-21 09:52:21 -03:00
Hans Verkuil
3f66f0ed31 [media] v4l2-ctrls/v4l2-events: small coding style cleanups
Thanks to Laurent Pinchart <laurent.pinchart@ideasonboard.com>.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:34 -03:00
Hans Verkuil
eb5b16efb2 [media] v4l2-ctrls: improve discovery of controls of the same cluster
The implementation of VIDIOC_G/S/TRY_EXT_CTRLS in the control framework has
to figure out which controls in the control list belong to the same cluster.
Since controls belonging to the same cluster need to be handled as a unit,
this is important information.

It did that by going over the controls in the list and for each control that
belonged to a multi-control cluster it would walk the remainder of the list
to try and find controls that belong to that same cluster.

This approach has two disadvantages:

1) it was a potentially quadratic algorithm (although highly unlikely that
it would ever be that bad in practice).
2) it took place with the control handler's lock held.

Since we want to make it possible in the future to change control values
from interrupt context, doing a lot of work while holding a lock is not a
good idea.

In the new code the algorithm is no longer quadratic but linear in the
number of controls in the list. Also, it now can be done beforehand.

Another change that was made was to so the try and set at the same time.
Before when S_TRY_EXT_CTRLS was called it would 'try' the controls first,
and then it would 'set' them. The idea was that any 'try' errors would
prevent the 'set' from happening, thus avoiding having partially set
control lists.

However, this caused more problems than it solved because between the 'try'
and the 'set' changes might have happened, so it had to try a second time,
and since actual controls with a try_ctrl op are very rare (and those that
we have just adjust values and do not return an error), I've decided to
drop that two-stage approach and just combine try and set.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:31 -03:00
Hans Verkuil
f1e393de38 [media] v4l2-event/ctrls/fh: allocate events per fh and per type instead of just per-fh
The driver had to decide how many events to allocate when the v4l2_fh struct
was created. It was possible to add more events afterwards, but there was no
way to ensure that you wouldn't miss important events if the event queue
would fill up for that filehandle.

In addition, once there were no more free events, any new events were simply
dropped on the floor.

For the control event in particular this made life very difficult since
control status/value changes could just be missed if the number of allocated
events and the speed at which the application read events was too low to keep
up with the number of generated events. The application would have no idea
what the latest state was for a control since it could have missed the latest
control change.

So this patch makes some major changes in how events are allocated. Instead
of allocating events per-filehandle they are now allocated when subscribing an
event. So for that particular event type N events (determined by the driver)
are allocated. Those events are reserved for that particular event type.
This ensures that you will not miss events for a particular type altogether.

In addition, if there are N events in use and a new event is raised, then
the oldest event is dropped and the new one is added. So the latest event
is always available.

This can be further improved by adding the ability to merge the state of
two events together, ensuring that no data is lost at all. This will be
added in the next patch.

This also makes it possible to allow the user to determine the number of
events that will be allocated. This is not implemented at the moment, but
would be trivial.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:31 -03:00
Hans Verkuil
77068d36d8 [media] v4l2-ctrls/event: remove struct v4l2_ctrl_fh, instead use v4l2_subscribed_event
The v4l2_ctrl_fh struct connected v4l2_ctrl with v4l2_fh so the control
would know which filehandles subscribed to it. However, it is much easier
to use struct v4l2_subscribed_event directly for that and get rid of that
intermediate struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:31 -03:00
Hans Verkuil
82a7c04944 [media] v4l2-ctrls: make manual_mode_value 8 bits and check against control range
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Hans Verkuil
ce7275747b [media] v4l2-ctrls: simplify event subscription
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil
6e239399e5 [media] v4l2-ctrls: add control events
Whenever a control changes value or state an event is sent to anyone
that subscribed to it.

This functionality is useful for control panels but also for applications
that need to wait for (usually status) controls to change value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil
ab892bac84 [media] v4l2-ctrls: add v4l2_fh pointer to the set control functions
When an application changes a control you want to generate an event.
However, you want to avoid sending such an event back to the application
(file handle) that caused the change.

Add the filehandle to the various set control functions.

The filehandle isn't used yet, but the control event patches will need
this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:19 -03:00
Hans Verkuil
72d877cac0 [media] v4l2-ctrls: add v4l2_ctrl_auto_cluster to simplify autogain/gain scenarios
It is a bit tricky to handle autogain/gain type scenerios correctly. Such
controls need to be clustered and the V4L2_CTRL_FLAG_UPDATE should be set on
the autofoo controls. In addition, the manual controls should be marked
inactive when the automatic mode is on, and active when the manual mode is on.
This also requires specialized volatile handling.

The chances of drivers doing all these things correctly are pretty remote.
So a new v4l2_ctrl_auto_cluster function was added that takes care of these
issues.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:18 -03:00
Laurent Pinchart
01c40c048b [media] v4l: Include linux/videodev2.h in media/v4l2-ctrls.h
The later makes extensive use of structures defined in the former.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:52:09 -02:00
Hans Verkuil
2a863793be [media] v4l2-ctrls: v4l2_ctrl_handler_setup must set is_new to 1
Renamed has_new to is_new.

Drivers can use the is_new field to determine if a new value was specified
for a control. The v4l2_ctrl_handler_setup() must always set this to 1 since
the setup has to force a full update of all controls.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:32 -02:00
Hans Verkuil
513521eaee [media] v4l2-ctrls: use const char * const * for the menu arrays
This prevents checkpatch warnings generated when defining
'static const char *foo[]' arrays. It makes sense to use
const char * const * anyway since the pointers in the array
are indeed const.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:02:14 -02:00
Hans Verkuil
0996517cf8 V4L/DVB: v4l2: Add new control handling framework
Add a new framework to handle controls which makes life for driver
developers much easier.

Note that this patch moves some of the control support that used to be in
v4l2-common.c to v4l2-ctrls.c. The tables were copied unchanged. The body
of v4l2_ctrl_query_fill() was copied to a new v4l2_ctrl_fill() function
in v4l2-ctrls.c. This new function doesn't use the v4l2_queryctrl
struct anymore, which makes it more general.

The remainder of v4l2-ctrls.c is all new. Highlights include:

- No need to implement VIDIOC_QUERYCTRL, QUERYMENU, S_CTRL, G_CTRL,
  S_EXT_CTRLS, G_EXT_CTRLS or TRY_EXT_CTRLS in either bridge drivers
  or subdevs. New wrapper functions are provided that can just be plugged in.
  Once everything has been converted these wrapper functions can be removed as well.

- When subdevices are added their controls can be automatically merged
  with the bridge driver's controls.

- Most drivers just need to implement s_ctrl to set the controls.
  The framework handles the locking and tries to be as 'atomic' as possible.

- Ready for the subdev device nodes: the same mechanism applies to subdevs
  and their device nodes as well. Sub-device drivers can make controls
  local, preventing them from being merged with bridge drivers.

- Takes care of backwards compatibility handling of VIDIOC_S_CTRL and
  VIDIOC_G_CTRL. Handling of V4L2_CID_PRIVATE_BASE is fully transparent.
  CTRL_CLASS controls are automatically added.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08 23:43:03 -03:00