Commit Graph

146 Commits

Author SHA1 Message Date
ZwX1616 b7245e4cf5 tici fcam vignette compensation (#19971)
* simple model

* fix api

* this too
old-commit-hash: 8824966aad4da328cc393cda26dd80d5bbcd7265
2021-02-01 15:06:15 -08:00
Dean Lee a64b230637 get_frame_image: moved the global variables into function static (#19982)
old-commit-hash: 7f5a1ce02d83f3413137b6c9cb5534c1b787a712
2021-01-31 18:16:12 -08:00
ZwX1616 2dca9b49c7 tici dcam AE (#19970)
* tici_ae_front

* not const
old-commit-hash: 6d16bfab8243b7b320ac4ef20c98ddfc5ba6bfce
2021-01-29 19:11:27 -08:00
ZwX1616 099a5a21e2 camerad frame lag/drop jenkins tests (#19945)
* clean up test

* not needed for now

* this be enough

* comment this out

* clean up

* adjust tolerance

* use sof on tici

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 1a95127b0ef62fd744b2f9277b86d130020f5bde
2021-01-28 14:21:59 -08:00
Dean Lee da9b0e8baa remove cqueue, use class SafeQueue (#19774)
* class SafeQueue

* cleanup includes

* space

* add timeout

use try_poll

* add function empty() & size()

* class SafeQueue

* add timeout

use try_poll

* add function empty() & size()

* rebase master

* rebase master

* for loop

* fix bug
old-commit-hash: e6783f4d9f10a256a4c301eb1d1843d9e2a17ab6
2021-01-28 15:12:45 +01:00
Dean Lee 8dfd6dce43 CameraBuf::acquire : release on failure (#19935)
old-commit-hash: 064bcbe80b90dc8dabb36c713964d6834b81c7c0
2021-01-27 12:08:38 +01:00
Dean Lee bed2eb58c1 fill_frame_data: remove unused paramater cnt (#19936)
old-commit-hash: 80799c7272a35d69e508d724a4f95c44b61a3ec0
2021-01-27 12:03:12 +01:00
Dean Lee bf95f37eba cameras_qcom: fix dangling pointer in fill_frame_image (#19891)
old-commit-hash: cbd08d6f0c95089e89b268c76fb4054443730c5e
2021-01-26 17:19:06 +01:00
Dean Lee 8e0dc47f2e camera_common: rename create_thumbnail to publish_thumbnail (#19920)
* rename create_thumbnail to publish_thumbnail

* check pm
old-commit-hash: 90994baab00ab59428768a4b8841a14452d88248
2021-01-26 17:06:03 +01:00
Dean Lee 37d0943201 camera_webcam: add "thumbnail" to Pubmaster (#19919)
old-commit-hash: 6b245b5b0c2b998e166a03064eafa6d2157d5755
2021-01-25 20:30:02 -08:00
ZwX1616 7e383c881f fill sof
old-commit-hash: 2b6149572a78874176340a9363db9e50f4839811
2021-01-22 13:24:51 -08:00
robbederks 46191df6bb Change qcom2 fserial and readout timing (#19820)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 5eb16b11932c6fc6fc57eab1464eba141172089a
2021-01-20 12:54:20 +01:00
Adeeb Shihadeh a30859cf12 camera frame stream cleanup (#19741)
* clean up

* more clean up first
old-commit-hash: eae7a6ed22a96f792a5b6ca187a309505c3f249c
2021-01-19 14:40:47 -08:00
Adeeb Shihadeh c3783d5005 camerad: remove duplicate set_realtime_priority
old-commit-hash: 5cb6e69a78c9dadf0b12102e049fdb1feefa0295
2021-01-19 14:35:46 -08:00
Dean Lee 09a9eba635 CameraBuf: private variables (#19811)
old-commit-hash: aaac63689ddfd31c94ec490ef52faaa792ef3cb7
2021-01-19 14:28:40 -08:00
Adeeb Shihadeh 6a01983000 few fixes from LGTM
old-commit-hash: 758794dec5a886a8c3704d9e2ac191f8c208cc7e
2021-01-16 14:23:06 -08:00
Dean Lee 4eebd421a5 CameraBuf::acquire : using a scoped lock (#19764)
* Using a scoped lock

* Trigger Build
old-commit-hash: 20726997199aedea1ee40e6891a450ae70d56717
2021-01-15 12:09:18 +01:00
Dean Lee fbca888d7e camera_qcom2: simplify camera_process_frame (#19763)
* simplify camera_process_frame

* Trigger Build

* Update selfdrive/camerad/cameras/camera_qcom2.cc

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: c804059641d16dbb4d41b36afae1ba3ccc8a2dcc
2021-01-15 12:05:31 +01:00
Dean Lee b5d575eb9f fill_frame_image: reduce function parameters (#19736)
* reduce function paramaters

* add assert

* Trigger Build
old-commit-hash: ea9835f293e9c59715f794cd82474469965c1710
2021-01-15 11:12:56 +01:00
Dean Lee 8b2b835e62 camerad use std::thread (#19771)
old-commit-hash: 1b3c93813d37e09b0c695a9974cfc8789373352c
2021-01-15 11:10:52 +01:00
Dean Lee b1ccf416c7 CameraBuf: removed unused variables (#19735)
old-commit-hash: c28ba97e67f55a8a5f9e7d8baa6030d6b36cd44a
2021-01-14 18:49:52 +01:00
ZwX1616 3d3c77423c fix tici debayer GPU page faults
old-commit-hash: f0cc78ea9294ecbfc2a351cd38398e4a1ab31a86
2021-01-12 20:53:51 -08:00
Willem Melching 6f417e0051 CameraBuf::stop() is not used
old-commit-hash: 0b79d0e12d5da68c0d0985916b78e888d3fbdcb7
2021-01-12 15:28:30 +01:00
Dean Lee 7ea7f097c4 FIX: It is not safe to call cameras_close before all threads are done. (#19555)
* call cameras_close after all threads exited

* stop buffer before join

* remove buf->stop
old-commit-hash: 660abb79dc925427ae96e5bf03fb5635061cc919
2021-01-12 15:27:20 +01:00
Dean Lee 4c1919f41e merge utilpp.h into util.h (#19710)
old-commit-hash: 595830135bb79c8b23eb8339ae768ca7b6a822f8
2021-01-10 14:57:32 -08:00
Dean Lee 50da200b5a create_thumbnail in camera_common (#19553)
old-commit-hash: cefdca2fd67ed7cef1e536504ac71e631b7608ab
2021-01-08 14:31:21 -08:00
Dean Lee 46bd840be6 cleanup (#19564)
old-commit-hash: 621dcf8aa17ffe6342b6dbd660a8b24c1433f7d2
2021-01-08 14:07:33 -08:00
Willem Melching 3f950832b9 VisionIPC 2.0 (#19641)
* Squashed vipc

* Update release files

* Remove else

* add visionipc to release files

* use poller in vipc receive

* opencl framework instead of lib on macos

* Fix camera webcam

* Fix opencl on mac in ui

* more webcam fixes

* typo in ui sconsfile

* Use cur_yuv_buf

* visionbuf c++ class

* Camera qcom was still using visionbuf_allocate

* Turn loggerd back on

* fix snapshot

* No build needed

* update test camerad

* no more release callback

* make encoder c++

* Revert "no more release callback"

This reverts commit e5707b07002fee665d0483d90713154efc2d70d4.

* fix exit handlers

* No need to check errno

* move release callback call

* s/VIPCBufExtra/VisionIpcBufExtra/g

* use non blocking connect

* ui use non blocking connect

* Lower condition variable wait time

* Snapshot cleanup

* bump cereal

* bump cereal
old-commit-hash: fb496c692a9ebdcda15069a8d4eb95734b587d68
2021-01-08 14:54:25 +01:00
Dean Lee 5e557ed96d common exit handler (#19661)
* common signal handle

* fix typo

* rename to ExitHandler

* remove include signal.h

* remove include csignal

* rename variable exit to v

* rebase master
old-commit-hash: 86fe2d1697531bebdf5d0d83609e91ed4006f54b
2021-01-05 20:19:53 -08:00
Adeeb Shihadeh d89bb8b29c setup clang tidy (#19533)
* setup clang tidy

* config

* some cleanup

* little more

* remove that

* fix qcom build
old-commit-hash: 87950eb3127e175f0f2b0bb42440f5350c679369
2021-01-05 12:50:23 -08:00
Dean Lee bbfb751d69 Replace usleep with util::sleep_for (#19643)
* replace usleep with sleep_for

* sleep microseconds

* sleep nanoseconds

* Trigger Build
old-commit-hash: c1cf0882bd4e0fce5e1a581536f6a0e7afb640e6
2021-01-04 18:03:11 +01:00
Dean Lee 6d729af2f9 fix thread safety issue in camera focusing (#19576)
old-commit-hash: 06e3b1e445c1a99fb6284beb95ae92c48fb5bade
2021-01-04 10:18:10 +01:00
Dean Lee 3fa5602f75 should not break if poll timeout (#19578)
old-commit-hash: 37826c00324cc8f9c9eae9650cafc0df6c838ebe
2021-01-04 10:17:52 +01:00
Adeeb Shihadeh 4fbefc8e10 camerad: revert tbuffer dispatch change (#19589)
old-commit-hash: 15cd71707d5f2de0c302577cbcd05b7c989e9a23
2020-12-25 15:18:00 -08:00
Dean Lee 824106eab4 cameras: use common transform (#19552)
old-commit-hash: 9890f958d9c5a15398ce4ebf281aaca9ec83b8ce
2020-12-20 17:21:46 -08:00
Dean Lee 34e98ac4d7 cleanup qcom2 (#19506)
* cleanup qcom2

* define DEBAYER_LOCAL_WORKSIZE in camera_qcom2.h
old-commit-hash: bc1cfa6d4fcb208633e5916645b27ebef95648bc
2020-12-17 11:43:50 -08:00
Robbe Derks 0792290d72 Revert MCLK change
old-commit-hash: 91c760a9e55029bd401210ca2f201116ac96e2f5
2020-12-17 18:08:58 +01:00
robbederks 5d5fed58e2 Move MCLK freq on tici (#19494)
* Move MCLK freq

* change PLL settings to compensate

* messed that up

* undo extclk change, move the internal freq. Does mean pixclk is decreased from 88MHz to 80MHz though

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 18ab82221384f9439ed3cbfa16a57d375779dfeb
2020-12-17 11:29:34 +01:00
Adeeb Shihadeh b950cab874 HW abstraction layer (#19530)
* start hw refactor

* move that

* pins

* put that back
old-commit-hash: 8674b023bab2b44405139ceec5785a389f837682
2020-12-16 21:30:23 -08:00
Adeeb Shihadeh 762eda95cd Set GPU priorities + improved modeld priorities (#2691)
* give gpu threads rt priority

* modeld gets highest prio on core 2

* fix frame stream

* lower prio of cal thread

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: c57ee16e86275820f97631fb79df1685e914d564
2020-12-15 19:22:03 -08:00
Dean Lee 2865d75739 qcom: make camera_process_frame more readable (#2765)
* more readable

* rgb_addr

* offset

* speed up if statement

* --self_recover

* rgb_addr_offset

* x_offset&y_offset

* static rgb_roi_buf & conv_result

* remove variables from struct

* simplify read sensorEvents

* use i for loop

* split to functions

* make it works

* y_offset should be ROI_Y_MAX-ROY_Y_MIN+1

* std::size is better than ARRAYSIZE

* rebase master

* shorter variable name

* Revert "shorter variable name"

This reverts commit 47612e3a741d8b6ddfd72bccbb5337882b369224.

* std::fill_n

* reday for merge

* Revert "y_offset should be ROI_Y_MAX-ROY_Y_MIN+0"

This reverts commit 1f8526fb1c59c89d747210eb8bf17a2688a4f2bc.
old-commit-hash: d31a87cd218eeeb51193188b72332800d29dca69
2020-12-15 16:39:38 -08:00
Comma Device cfce32acb5 fix camerad qcom2 build
old-commit-hash: 536a8c587643bc4aa046c414b18292bd65b72caf
2020-12-15 04:52:40 +00:00
Dean Lee 6ab28556c8 camera_qcom: read SensorEvents in op thread (#2764)
* get acceleration in op thread

* std::atomic last_sag_acc_z

* cleanup
old-commit-hash: c1f3c3b2df70d7f3fb24f165c2edcf01a1adcde9
2020-12-14 16:54:49 -08:00
Dean Lee 890df06246 refactor imgproc/utils (#2766)
* refactor imgproc/utils

* const

* space

* return value
old-commit-hash: 554ea8f54a699950a9226e1d0808cc41ca4859f0
2020-12-14 15:33:40 -08:00
George Hotz 2cedc8715e Set camerad CL priority to 4 (#2747)
* priority 2 get

* add to files_common

* cl_ext_qcom

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: cb238fd2ee22bcc6c02c3556f96439b3e08d9415
2020-12-14 13:59:48 -08:00
Dean Lee 0066e93b34 covert rgb_to_yuv.c to rgb_to_yuv.cc (#2757)
old-commit-hash: 3d63b3d4149efb1e597d8d97790fddd28abdbde0
2020-12-12 16:52:15 -08:00
Dean Lee 9be81a6f99 clutil refactor (#2733)
* cleaup clutil.h

* clutil.c -> clutil.cc

* std::hash

* try simplify functions

* using namespace group help functions

* continue

* add function get_platform_info

* continue

* remove caching

* struct CLContext

* std::cout & CL_ERR_TO_STR

* remove CLU_NO_CACHE

* Revert "struct CLContext"

This reverts commit 882e413f227e4c1ba4bb83f956cc67739a189221.

* cl_get_error_string : remove undefied error codes

* replace all printf with std::cout

* util::read_file

* cleanup

* revert CL_ERR_TO_STR

* simplify

* add macro CL_ERR_TO_STR

* cl_get_error_string: fix undeclared errors

* log_size should not +1

* use std::stirng log

* apply review
old-commit-hash: 3c08d0f1f7e7c9f376fd69fd46067c6f6ff59d39
2020-12-11 13:05:32 +01:00
Willem Melching df97d4db04 Add thumbnails to camera_frame_stream
old-commit-hash: 7b998a7c21b6a15fa474df5a2c5a0bbd8a6f930c
2020-12-11 13:02:45 +01:00
Dean Lee fc07703c8f camerad: fix memory leak in create_thumbnail (#2743)
* fix memory leak in create_thumbnail

* free memory returned from jpeg_mem_dest

* OMG
old-commit-hash: f0d240a7e3d1a91a3d0bac1cc9050c531105d87d
2020-12-11 13:02:16 +01:00
Dean Lee 3f999c44a9 destroy rgb_to_yuv_state (#2702)
old-commit-hash: 1e9e31d6e1167e309660aad49986524d445b19d3
2020-12-10 19:39:46 -08:00