summaryrefslogtreecommitdiff
path: root/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
AgeCommit message (Collapse)AuthorFilesLines
2022-11-25media: atomisp: Remove accelerator pipe creation codeHans de Goede1-7/+0
The ATOMISP_ACC_* custom ioctls and the ACC device node have been removed in commit a5c17adbadcb ("media: atomisp: Remove the ACC device node"). This means that pipe_configs[pipe_id].acc_extension now never gets set which causes atomisp_compat_css20.c: __create_pipe() to always skip creation of pipes with a pipe_id of IA_CSS_PIPE_ID_ACC / a mode of IA_CSS_PIPE_MODE_ACC. This allows removing of the acc_pipe creation / handling code from mainly sh_css.c and a bunch of other places. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-11-25media: atomisp: Add ia_css_frame_get_info() helperHans de Goede1-13/+13
Several places rely on the [frame_]info member being the first member of struct ia_css_frame, so that &frame->info will yield NULL when frame is NULL (some places already explicitly check for a NULL frame pointer but not nearly all). For videobuf2 support the vb2_v4l2_buffer struct needs to be embedded in the frame struct and it needs to be the first member. Breaking the assumption that &frame->info will yield NULL when frame is NULL. Add a ia_css_frame_get_info() helper to return either the ia_css_frame_info struct embedded in the frame, or NULL when the frame pointer is NULL and use this in places where a ia_css_frame_info ptr or NULL is expected. To make sure that we catch all uses of the info field this patch also renames the info field to frame_info. This is a preparation patch for converting the driver to videobuf2. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: atomisp: drop contiguous flag from struct ia_css_frameHans de Goede1-2/+0
Drop the contiguous flag from struct ia_css_frame, it is always false / not used. Link: https://lore.kernel.org/linux-media/20220615205037.16549-8-hdegoede@redhat.com Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2021-11-17media: atomisp: simplify sh_css_defs.hMauro Carvalho Chehab1-1/+1
There are several unused macros. Simplify the logic there, making it closer to the Intel Aero driver and the corresponding firmware, as this is what we have widely available for this device. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-23media: atomisp: cleanup __printf() atributes on printk messagesMauro Carvalho Chehab1-2/+1
There are still some warnings produced by -Wsuggest-attribute=format, like this one: drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c: In function ‘dtrace_dot’: drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2466:2: warning: function ‘dtrace_dot’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] 2466 | ia_css_debug_vdtrace(IA_CSS_DEBUG_INFO, fmt, ap); | ^~~~~~~~~~~~~~~~~~~~ Also, on some places, is is using __atribute, while on others it is using the __printf() macro. Uniform those to always use the __printf() macro, placing it before the function, and fix the logic in order to cleanup all such warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-03media: atomisp: fix some bad indentsMauro Carvalho Chehab1-2/+2
As smatch reports, there are several bad indents: drivers/staging/media/atomisp/pci/hmm/hmm.c:271 hmm_alloc() warn: inconsistent indenting drivers/staging/media/atomisp/pci/runtime/bufq/src/bufq.c:390 ia_css_bufq_enqueue_psys_event() warn: inconsistent indenting drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2132 ia_css_debug_dump_isys_state() warn: inconsistent indenting drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:246 sh_css_binary_get_sc_requirements() warn: inconsistent indenting drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:565 ia_css_binary_get_shading_info_type_1() warn: inconsistent indenting drivers/staging/media/atomisp/pci/sh_css.c:5109 sh_css_pipes_stop() warn: inconsistent indenting drivers/staging/media/atomisp/pci/sh_css.c:8791 ia_css_pipe_create() warn: inconsistent indenting Some of them are due to ifdefs. Get rid of them by either getting a common code that would work for both ISP2400 and ISP2401 or by creating separate functions, one for each ISP version. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-03media: atomisp: cleanup ifdefs from ia_css_debug.cMauro Carvalho Chehab1-144/+41
There are lots of code dependency there. Get rid of most of them. We can't remove everything, as there are some structs that are conditionally built if ISP2401. So, keep ifdefs only on such cases. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-03media: atomisp: get rid of some unused codeMauro Carvalho Chehab1-15/+7
Now that the defines which are common for both ISP2400 and ISP2401 are at system_global.h, we can get rid of the code not used by those versions. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: get rid of a string_support.h abstraction layerMauro Carvalho Chehab1-24/+21
Some parts of the driver have their own implementation of memcpy() & friends. Replace all of them by strscpy(). Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: change the detection of ISP2401 at runtimeMauro Carvalho Chehab1-4/+4
Instead of having a static var to detect it, let's use the already-existing arch-specific bytes, as this is how other parts of the code also checks when it needs to do something different, depending on an specific chipset version. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: simplify IRQ ifdef logicMauro Carvalho Chehab1-10/+0
There are lots of mess with IRQ ifdef settings. As the *_global.h will already detect the type of IRQ system at compile time, we can get rid of them, replacing by just one ifdef for ISP2401. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: do some cleanup at irq_local.hMauro Carvalho Chehab1-1/+1
- Get rid of typedefs; - Get rid of a duplicated enum type with different names for ISP2400 and ISP2401; - adjust indentation on the touched code. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: add SPDX headersMauro Carvalho Chehab1-0/+1
This driver is licensed under GPL 2.0, as stated inside their headers. Add the proper tag there. We should probably latter cleanup the reduntant licensing text, but this could be done later, after we get rid of other abstraction layers. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: get rid of memory_access.cMauro Carvalho Chehab1-2/+1
Now that we have everything in place, we can get rid of the memory_access abstraction layer. Now, everything related to heterogeneous memory management (hmm) is under hmm.c & related pools. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: change the type returned by mmgr allocMauro Carvalho Chehab1-1/+1
The mmgr alloc code returns a different type than hmm, due to some abstraction layer. Change the driver to use just one type to represent the hmm memory. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: reduce abstraction at ia_css_memory_accessMauro Carvalho Chehab1-1/+1
Yet another memory abstraction layer. Getting rid of this may be a little trickier, but let's reduce it to a minimal. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: drop a cast for a const argumentMauro Carvalho Chehab1-1/+1
Some arguments for tnf and ref settings are meant to be const, but they're defined without such annotation. Due to that, there's an ugly cast at sh_css_sp.c. Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11media: atomisp: make it use dbg_level to control debug levelMauro Carvalho Chehab1-5/+2
This driver has 3 different types of debug messages: - dev_dbg() - dbg_level - ia_css_debug_trace_level Which is crazy. Ideally, it shold just use dev_dbg() everywhere, but for now let's unify the last two machanisms. Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of spmem_dump.cMauro Carvalho Chehab1-4/+0
Those files seem to be firmware-dependent, probably being used by some debug interface. Well, their contents are not really used by atomisp, so let's just send them to the trash can, as it shouldn't have any usage upstream. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of most checks for ISP2401 versionMauro Carvalho Chehab1-103/+68
There are lots of places inside this driver checking for ISP2400/ISP2401 verison. Get rid of most of those, while keep building for both. Most of stuff in this patch is trivial to solve. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of some broken codeMauro Carvalho Chehab1-3/+0
Probably due to some version conflicts while the atomisp code were generated, some things don't build for ISP2401. So, use the ISP2400 variant when available, or get rid of the code that doesn't build. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: cleanup directory hierarchyMauro Carvalho Chehab1-0/+3582
This driver has very long directories without a good reason (IMHO). Let's drop two directories from such hierarchy, in order to simplify things a little bit and make the dir output a bit more readable. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>