summaryrefslogtreecommitdiff
path: root/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
AgeCommit message (Collapse)Author
2017-12-29media: staging: atomisp2: replace DEVICE_ATTR with DEVICE_ATTR_ROAishwarya Pant
This is a clean-up patch which replaces DEVICE_ATTR() macro with file permission specific DEVICE_ATTR_RO() macro for compaction and readability. Done using coccinelle: @r@ identifier attr, show_fn; declarer name DEVICE_ATTR; @@ DEVICE_ATTR(attr, \(S_IRUGO\|0444\), show_fn, NULL); @script: python p@ attr_show; attr << r.attr; @@ // standardise the show fn name to {attr}_show coccinelle.attr_show = attr + "_show" @@ identifier r.attr, r.show_fn; declarer name DEVICE_ATTR_RO; @@ // change the attr declaration - DEVICE_ATTR(attr, \(S_IRUGO\|0444\), show_fn, NULL); + DEVICE_ATTR_RO(attr); @rr@ identifier r.show_fn, p.attr_show; @@ // rename the show function - show_fn + attr_show (...) { ... } @depends on rr@ identifier r.show_fn, p.attr_show; @@ // rename fn usages - show_fun + attr_show Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: staging: atomisp: Remove FSF snail addressAndy Shevchenko
Snail address is subject to change, remove it completely from the code. This has been done using the following script: sed -i '/You should/,/02110-1301/d' \ $(git grep -n -w Franklin -- drivers/staging/media/atomisp/ | cut -f1 -d:) No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: staging: atomisp: hmm: Alignment code (rebased)Philipp Guendisch
This patch fixed code alignment to open paranthesis. Semantic should not be affected by this patch. It has been rebased on top of media_tree atomisp branch Signed-off-by: Philipp Guendisch <philipp.guendisch@fau.de> Signed-off-by: Chris Baller <chris.baller@gmx.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: staging: atomisp: hmm: Fixed comment stylePhilipp Guendisch
This patch fixed comment style. Semantic should not be affected. There are also two warnings left about too long lines, which reduce readability if changed. Signed-off-by: Philipp Guendisch <philipp.guendisch@fau.de> Signed-off-by: Chris Baller <chris.baller@gmx.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: staging: atomisp: Remove unnecessary return statement in void functionAmitoj Kaur Chawla
Return statement at the end of a void function is useless. The Coccinelle semantic patch used to make this change is as follows: //<smpl> @@ identifier f; expression e; @@ void f(...) { <... - return e; ...> } //</smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07[media] staging: atomisp: Fix endless recursion in hmm_initHans de Goede
hmm_init calls hmm_alloc to set dummy_ptr, hmm_alloc calls hmm_init when dummy_ptr is not yet set, which is the case in the call from hmm_init, so it calls hmm_init again, this continues until we have a stack overflow due to the recursion. This commit fixes this by adding a separate flag for tracking if hmm_init has been called. Not pretty, but it gets the job done, eventually we should be able to remove the hmm_init call from hmm_alloc. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07[media] atomisp: use NULL instead of 0 for pointersPaolo Cretaro
Fix warning issued by sparse: Using plain integer as NULL pointer Signed-off-by: Paolo Cretaro <melko@frugalware.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-28staging: media: atomisp: kmap() can't failFabian Frederick
There's no need to check kmap() return value because it won't fail. If it's highmem mapping, it will receive virtual address or a new one; if it's lowmem, all kernel pages are already being mapped. (Thanks to Jan Kara for explanations) Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28atomisp: clean up the hmm init/cleanup indirectionsAlan Cox
We don't need any of these indirections as we only support one MMU type. Start by getting rid of the init/clear/free ones. The init ordering check we already pushed down in a previous patch. The allocation side is more complicated so leave it for now. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28atomisp: handle allocation calls before init in the hmm layerAlan Cox
Currently the code handles this in the abstraction above. We want to remove that abstraction so begin by pushing down the sanity check. Unfortunately at this point we can't simply fix the init order. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29Staging: atomisp - octal permissions, style fixDerek Robson
Changed permissions to octal style Found using checkpatch Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29atomisp: kill another defineAlan Cox
We don't need an ifdef for the sake of 8-12 bytes. Avoid the ifdef added by fde469701c7efabebf885e785edf367bfb1a8f3f. Instead turn it into a single const string array at a fixed location thereby saving even more memory. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-17Revert "staging: media: atomisp: fill properly hmm_bo_type_strings when ION ↵Jérémy Lefaure
is disabled" This reverts commit fde469701c7efabebf885e785edf367bfb1a8f3f. Adding a preprocessor condition is not the best solution to fix this issue. Let's revert this commit before fixing this problem in a more appropriate way. Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-16staging: media: atomisp: fill properly hmm_bo_type_strings when ION is disabledJérémy Lefaure
When CONFIG_ION is disabled, HMM_BO_LAST is 3. In this case, "i" should not be added in hmm_bo_type_strings. Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12atomisp: remove dead code for SSSE3Alan Cox
This is another define which is never used and references a header that doesn't exist, so consider it dead. Our memcpy is pretty smart anyway. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: media: atomisp: Remove useless cast.Varsha Rao
Explicit type casting of variable, with same type as that of variable, is not required. The following coccinelle script is used to remove it. @@ type T; T *ptr; T p; @@ ( - (T *)(&p) + &p | - (T *)ptr + ptr | - (T *)(ptr) + ptr | - (T)(p) + p ) This patch also removes unnecessary parentheses. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging/atomisp: Add support for the Intel IPU v2Alan Cox
This patch adds support for the Intel IPU v2 as found on Android and IoT Baytrail-T and Baytrail-CR platforms (those with the IPU PCI mapped). You will also need the firmware files from your device (Android usually puts them into /etc) - or you can find them in the downloadable restore/upgrade kits if you blew them away for some reason. It may be possible to extend the driver to handle the BYT/T windows platforms such as the ASUS T100TA. These platforms don't expose the IPU via the PCI interface but via ACPI buried in the GPU description and with the camera information somewhere unknown so would need a platform driver interface adding to the codebase *IFF* the firmware works on such devices. To get good results you also need a suitable support library such as libxcam. The camera is intended to be driven from Android so it has a lot of features that many desktop apps don't fully spport. In theory all the pieces are there to build it with -DISP2401 and some differing files to get CherryTrail/T support, but unifying the drivers properlly is a work in progress. The IPU driver represents the work of a lot of people within Intel over many years. It's historical goal was portability rather than Linux upstream. Any queries about the upstream aimed driver should be sent to me not to the original authors. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>