Re: [PATCH v3 22/23] camss: Use optimal clock frequency rates

2017-07-21 Thread Todor Tomov
Hello,

On 19.07.2017 18:59, kbuild test robot wrote:
> Hi Todor,
> 
> [auto build test ERROR on linuxtv-media/master]
> [also build test ERROR on v4.13-rc1]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Todor-Tomov/Qualcomm-8x16-Camera-Subsystem-driver/20170718-055348
> base:   git://linuxtv.org/media_tree.git master
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386 
> 
> All errors (new ones prefixed by >>):
> 
>ERROR: "__udivdi3" [fs/ufs/ufs.ko] undefined!
>>> ERROR: "__udivdi3" [drivers/media/platform/qcom/camss-8x16/qcom-camss.ko] 
>>> undefined!
>ERROR: "__divdi3" [drivers/media/platform/qcom/camss-8x16/qcom-camss.ko] 
> undefined!

Just FYI,
I'll switch to using the proper division functions/macros so this error
will be fixed in the next version of the patchset.

> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation
> 

-- 
Best regards,
Todor Tomov


Re: [PATCH v3 22/23] camss: Use optimal clock frequency rates

2017-07-20 Thread Sakari Ailus
Hi Todor,

On Mon, Jul 17, 2017 at 01:33:48PM +0300, Todor Tomov wrote:
> Use standard V4L2 control to get pixel clock rate from a sensor
> linked in the media controller pipeline. Then calculate clock
> rates on CSIPHY, CSID and VFE to use the lowest possible.
> 
> If the currnet pixel clock rate of the sensor cannot be read then
> use the highest possible. This case covers also the CSID test
> generator usage.
> 
> If VFE is already powered on by another pipeline, check that the
> current VFE clock rate is high enough for the new pipeline.
> If not return busy error code as VFE clock rate cannot be changed
> while VFE is running.
> 
> Signed-off-by: Todor Tomov 
> ---
>  .../media/platform/qcom/camss-8x16/camss-csid.c| 324 
> ++---
>  .../media/platform/qcom/camss-8x16/camss-csid.h|   2 +-
>  .../media/platform/qcom/camss-8x16/camss-csiphy.c  | 112 +--
>  .../media/platform/qcom/camss-8x16/camss-csiphy.h  |   2 +-
>  .../media/platform/qcom/camss-8x16/camss-ispif.c   |  23 +-
>  .../media/platform/qcom/camss-8x16/camss-ispif.h   |   4 +-
>  drivers/media/platform/qcom/camss-8x16/camss-vfe.c | 289 +++---
>  drivers/media/platform/qcom/camss-8x16/camss-vfe.h |   2 +-
>  drivers/media/platform/qcom/camss-8x16/camss.c |  51 +++-
>  drivers/media/platform/qcom/camss-8x16/camss.h |  17 +-
>  10 files changed, 634 insertions(+), 192 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/camss-8x16/camss-csid.c 
> b/drivers/media/platform/qcom/camss-8x16/camss-csid.c
> index 2bf3415..5c0e359 100644
> --- a/drivers/media/platform/qcom/camss-8x16/camss-csid.c
> +++ b/drivers/media/platform/qcom/camss-8x16/camss-csid.c
> @@ -68,122 +68,224 @@ static const struct {
>   u8 data_type;
>   u8 decode_format;
>   u8 uncompr_bpp;
> + u8 spp; /* bus samples per pixel */
>  } csid_input_fmts[] = {
>   {
>   MEDIA_BUS_FMT_UYVY8_2X8,
>   MEDIA_BUS_FMT_UYVY8_2X8,
>   DATA_TYPE_YUV422_8BIT,
>   DECODE_FORMAT_UNCOMPRESSED_8_BIT,
> - 16
> + 8,
> + 2

If your original patch had added the comma on the previous line, this would
be simply adding a line per array entry.

>   },
>   {
>   MEDIA_BUS_FMT_VYUY8_2X8,
>   MEDIA_BUS_FMT_VYUY8_2X8,
>   DATA_TYPE_YUV422_8BIT,
>   DECODE_FORMAT_UNCOMPRESSED_8_BIT,
> - 16
> + 8,
> + 2
>   },
>   {
>   MEDIA_BUS_FMT_YUYV8_2X8,
>   MEDIA_BUS_FMT_YUYV8_2X8,
>   DATA_TYPE_YUV422_8BIT,
>   DECODE_FORMAT_UNCOMPRESSED_8_BIT,
> - 16
> + 8,
> + 2
>   },
>   {
>   MEDIA_BUS_FMT_YVYU8_2X8,
>   MEDIA_BUS_FMT_YVYU8_2X8,
>   DATA_TYPE_YUV422_8BIT,
>   DECODE_FORMAT_UNCOMPRESSED_8_BIT,
> - 16
> + 8,
> + 2
>   },
>   {
>   MEDIA_BUS_FMT_SBGGR8_1X8,
>   MEDIA_BUS_FMT_SBGGR8_1X8,
>   DATA_TYPE_RAW_8BIT,
>   DECODE_FORMAT_UNCOMPRESSED_8_BIT,
> - 8
> + 8,
> + 1
>   },
>   {
>   MEDIA_BUS_FMT_SGBRG8_1X8,
>   MEDIA_BUS_FMT_SGBRG8_1X8,
>   DATA_TYPE_RAW_8BIT,
>   DECODE_FORMAT_UNCOMPRESSED_8_BIT,
> - 8
> + 8,
> + 1
>   },
>   {
>   MEDIA_BUS_FMT_SGRBG8_1X8,
>   MEDIA_BUS_FMT_SGRBG8_1X8,
>   DATA_TYPE_RAW_8BIT,
>   DECODE_FORMAT_UNCOMPRESSED_8_BIT,
> - 8
> + 8,
> + 1
>   },
>   {
>   MEDIA_BUS_FMT_SRGGB8_1X8,
>   MEDIA_BUS_FMT_SRGGB8_1X8,
>   DATA_TYPE_RAW_8BIT,
>   DECODE_FORMAT_UNCOMPRESSED_8_BIT,
> - 8
> + 8,
> + 1
>   },
>   {
>   MEDIA_BUS_FMT_SBGGR10_1X10,
>   MEDIA_BUS_FMT_SBGGR10_1X10,
>   DATA_TYPE_RAW_10BIT,
>   DECODE_FORMAT_UNCOMPRESSED_10_BIT,
> - 10
> + 10,
> + 1
>   },
>   {
>   MEDIA_BUS_FMT_SGBRG10_1X10,
>   MEDIA_BUS_FMT_SGBRG10_1X10,
>   DATA_TYPE_RAW_10BIT,
>   DECODE_FORMAT_UNCOMPRESSED_10_BIT,
> - 10
> + 10,
> + 1
>   },
>   {
>   MEDIA_BUS_FMT_SGRBG10_1X10,
>   MEDIA_BUS_FMT_SGRBG10_1X10,
>   DATA_TYPE_RAW_10BIT,
>   DECODE_FORMAT_UNCOMPRESSED_10_BIT,
> - 10
> + 10,
> + 1
>   },
>   {
>   MEDIA_BUS_FMT_SRGGB10_1X10,
>   MEDIA_BUS_FMT_SRGGB10_1X10,
>   DATA_TYPE_RAW_10BIT,
>   DECODE_FORMAT_UNCOMPRESSED_10_BIT,
> - 10
> + 10,
> +   

Re: [PATCH v3 22/23] camss: Use optimal clock frequency rates

2017-07-19 Thread kbuild test robot
Hi Todor,

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.13-rc1]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Todor-Tomov/Qualcomm-8x16-Camera-Subsystem-driver/20170718-055348
base:   git://linuxtv.org/media_tree.git master
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

   ERROR: "__udivdi3" [fs/ufs/ufs.ko] undefined!
>> ERROR: "__udivdi3" [drivers/media/platform/qcom/camss-8x16/qcom-camss.ko] 
>> undefined!
   ERROR: "__divdi3" [drivers/media/platform/qcom/camss-8x16/qcom-camss.ko] 
undefined!

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[PATCH v3 22/23] camss: Use optimal clock frequency rates

2017-07-17 Thread Todor Tomov
Use standard V4L2 control to get pixel clock rate from a sensor
linked in the media controller pipeline. Then calculate clock
rates on CSIPHY, CSID and VFE to use the lowest possible.

If the currnet pixel clock rate of the sensor cannot be read then
use the highest possible. This case covers also the CSID test
generator usage.

If VFE is already powered on by another pipeline, check that the
current VFE clock rate is high enough for the new pipeline.
If not return busy error code as VFE clock rate cannot be changed
while VFE is running.

Signed-off-by: Todor Tomov 
---
 .../media/platform/qcom/camss-8x16/camss-csid.c| 324 ++---
 .../media/platform/qcom/camss-8x16/camss-csid.h|   2 +-
 .../media/platform/qcom/camss-8x16/camss-csiphy.c  | 112 +--
 .../media/platform/qcom/camss-8x16/camss-csiphy.h  |   2 +-
 .../media/platform/qcom/camss-8x16/camss-ispif.c   |  23 +-
 .../media/platform/qcom/camss-8x16/camss-ispif.h   |   4 +-
 drivers/media/platform/qcom/camss-8x16/camss-vfe.c | 289 +++---
 drivers/media/platform/qcom/camss-8x16/camss-vfe.h |   2 +-
 drivers/media/platform/qcom/camss-8x16/camss.c |  51 +++-
 drivers/media/platform/qcom/camss-8x16/camss.h |  17 +-
 10 files changed, 634 insertions(+), 192 deletions(-)

diff --git a/drivers/media/platform/qcom/camss-8x16/camss-csid.c 
b/drivers/media/platform/qcom/camss-8x16/camss-csid.c
index 2bf3415..5c0e359 100644
--- a/drivers/media/platform/qcom/camss-8x16/camss-csid.c
+++ b/drivers/media/platform/qcom/camss-8x16/camss-csid.c
@@ -68,122 +68,224 @@ static const struct {
u8 data_type;
u8 decode_format;
u8 uncompr_bpp;
+   u8 spp; /* bus samples per pixel */
 } csid_input_fmts[] = {
{
MEDIA_BUS_FMT_UYVY8_2X8,
MEDIA_BUS_FMT_UYVY8_2X8,
DATA_TYPE_YUV422_8BIT,
DECODE_FORMAT_UNCOMPRESSED_8_BIT,
-   16
+   8,
+   2
},
{
MEDIA_BUS_FMT_VYUY8_2X8,
MEDIA_BUS_FMT_VYUY8_2X8,
DATA_TYPE_YUV422_8BIT,
DECODE_FORMAT_UNCOMPRESSED_8_BIT,
-   16
+   8,
+   2
},
{
MEDIA_BUS_FMT_YUYV8_2X8,
MEDIA_BUS_FMT_YUYV8_2X8,
DATA_TYPE_YUV422_8BIT,
DECODE_FORMAT_UNCOMPRESSED_8_BIT,
-   16
+   8,
+   2
},
{
MEDIA_BUS_FMT_YVYU8_2X8,
MEDIA_BUS_FMT_YVYU8_2X8,
DATA_TYPE_YUV422_8BIT,
DECODE_FORMAT_UNCOMPRESSED_8_BIT,
-   16
+   8,
+   2
},
{
MEDIA_BUS_FMT_SBGGR8_1X8,
MEDIA_BUS_FMT_SBGGR8_1X8,
DATA_TYPE_RAW_8BIT,
DECODE_FORMAT_UNCOMPRESSED_8_BIT,
-   8
+   8,
+   1
},
{
MEDIA_BUS_FMT_SGBRG8_1X8,
MEDIA_BUS_FMT_SGBRG8_1X8,
DATA_TYPE_RAW_8BIT,
DECODE_FORMAT_UNCOMPRESSED_8_BIT,
-   8
+   8,
+   1
},
{
MEDIA_BUS_FMT_SGRBG8_1X8,
MEDIA_BUS_FMT_SGRBG8_1X8,
DATA_TYPE_RAW_8BIT,
DECODE_FORMAT_UNCOMPRESSED_8_BIT,
-   8
+   8,
+   1
},
{
MEDIA_BUS_FMT_SRGGB8_1X8,
MEDIA_BUS_FMT_SRGGB8_1X8,
DATA_TYPE_RAW_8BIT,
DECODE_FORMAT_UNCOMPRESSED_8_BIT,
-   8
+   8,
+   1
},
{
MEDIA_BUS_FMT_SBGGR10_1X10,
MEDIA_BUS_FMT_SBGGR10_1X10,
DATA_TYPE_RAW_10BIT,
DECODE_FORMAT_UNCOMPRESSED_10_BIT,
-   10
+   10,
+   1
},
{
MEDIA_BUS_FMT_SGBRG10_1X10,
MEDIA_BUS_FMT_SGBRG10_1X10,
DATA_TYPE_RAW_10BIT,
DECODE_FORMAT_UNCOMPRESSED_10_BIT,
-   10
+   10,
+   1
},
{
MEDIA_BUS_FMT_SGRBG10_1X10,
MEDIA_BUS_FMT_SGRBG10_1X10,
DATA_TYPE_RAW_10BIT,
DECODE_FORMAT_UNCOMPRESSED_10_BIT,
-   10
+   10,
+   1
},
{
MEDIA_BUS_FMT_SRGGB10_1X10,
MEDIA_BUS_FMT_SRGGB10_1X10,
DATA_TYPE_RAW_10BIT,
DECODE_FORMAT_UNCOMPRESSED_10_BIT,
-   10
+   10,
+   1
},
{
MEDIA_BUS_FMT_SBGGR12_1X12,
MEDIA_BUS_FMT_SBGGR12_1X12,
DATA_TYPE_RAW_12BIT,
DECODE_FORMAT_UNCOMPRESSED_12_BIT,
-   12
+   12,
+   1