media: rkisp1: uapi: change hist_bins array type from __u16 to __u32
Subsystems (3)
PATCH 1/1 media: rkisp1: uapi: change hist_bins array type from __u16 to __u32
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to __u32.
---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"
include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
include/uapi/linux/rkisp1-config.h +3 -2
@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part. * * The histogram values divided into 16 bins for V10/V11 and 32 bins * for V12/V13. It is configured within the struct rkisp1_cif_isp_hst_config.
@@ -909,7 +910,7 @@ struct rkisp1_cif_isp_af_stat {* RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two. */ struct rkisp1_cif_isp_hist_stat { -__u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; +__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; };/**
Signature · 7 lines
2.17.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Quoted 17 lines · Dafna Hirschfeld
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to
__u32.Signed-off-by Dafna Hirschfeld <[email protected]>---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)include/uapi/linux/rkisp1-config.h +0
-0
include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 899
Quoted 6 lines
include/uapi/linux/rkisp1-config.h +2
-1@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part.
So bits 0-3 are the fractional part and bits 4-19 contain the integer part? What goes where should be defined!
Looking at rkisp1_stats_get_hst_meas() I see this:
for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX; i++)
pbuf->params.hist.hist_bins[i] =
(u8)rkisp1_read(rkisp1,
RKISP1_CIF_ISP_HIST_BIN_0 + i * 4);Here this is cast to a u8, so how does this work?
There is something fishy here...
Regards,
Hans
include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 916
Quoted 13 lines
include/uapi/linux/rkisp1-config.h +1
-1* * The histogram values divided into 16 bins for V10/V11 and 32 bins * for V12/V13. It is configured within the struct rkisp1_cif_isp_hst_config. @@ -909,7 +910,7 @@ struct rkisp1_cif_isp_af_stat {* RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two. */ struct rkisp1_cif_isp_hist_stat { -__u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; +__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; };/**
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Am 19.01.21 um 16:00 schrieb Hans Verkuil:
Quoted 13 lines · Dafna Hirschfeld
Quoted 12 lines
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to
__u32.Signed-off-by Dafna Hirschfeld <[email protected]>---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Quoted 14 lines
include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 899
Quoted 11 lines
include/uapi/linux/rkisp1-config.h +2
-1@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part. So bits 0-3 are the fractional part and bits 4-19 contain the integer part? What goes where should be defined!
Actually I don't know, I just copied the docs in the datasheet. I can try figure it out. I can meanwhile send a patch without the doc until we are sure. Is that OK?
Quoted 9 lines
Looking at
rkisp1_stats_get_hst_meas()I see this:for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX; i++) pbuf->params.hist.hist_bins[i] = (u8)rkisp1_read(rkisp1, RKISP1_CIF_ISP_HIST_BIN_0 + i * 4);Here this is cast to a u8, so how does this work?
This seems to be a bug. I see that this cast is introduced in v12 of the patch "media: staging: rkisp1: add capture device for statistics".
This cast does not exist in any of the downstream versions.
Thanks,
Dafna
Quoted 18 lines
There is something fishy here...
Regards,
Hans
Quoted 11 lines
include/uapi/linux/rkisp1-config.h +1
-1* * The histogram values divided into 16 bins for V10/V11 and 32 bins * for V12/V13. It is configured within the struct rkisp1_cif_isp_hst_config. @@ -909,7 +910,7 @@ struct rkisp1_cif_isp_af_stat {* RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two. */ struct rkisp1_cif_isp_hist_stat { -__u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; +__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; };
Quoted 3 lines
include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 916
Quoted 2 lines
include/uapi/linux/rkisp1-config.h +0
-0/**
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Quoted 31 lines · Dafna Hirschfeld
Am 19.01.21 um 16:00 schrieb Hans Verkuil:
Quoted 13 lines · Dafna Hirschfeld
Quoted 12 lines
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to
__u32.Signed-off-by Dafna Hirschfeld <[email protected]>---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)Quoted 14 lines
include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 899
Quoted 11 lines
include/uapi/linux/rkisp1-config.h +2
-1@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part. So bits 0-3 are the fractional part and bits 4-19 contain the integer part? What goes where should be defined!
Quoted 3 lines
Actually I don't know, I just copied the docs in the datasheet. I can try figure it out. I can meanwhile send a patch without the doc until we are sure. Is that OK?
No, this should be documented properly.
Is this the only fractional type that is used in the rkisp1 uapi or are there others? (Just checking).
Quoted 9 lines
Quoted 9 lines
Looking at
rkisp1_stats_get_hst_meas()I see this:for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX; i++) pbuf->params.hist.hist_bins[i] = (u8)rkisp1_read(rkisp1, RKISP1_CIF_ISP_HIST_BIN_0 + i * 4);
Quoted 5 lines
Quoted 1 line
Here this is cast to a u8, so how does this work?
This seems to be a bug. I see that this cast is introduced in v12 of the patch "media: staging: rkisp1: add capture device for statistics".
This cast does not exist in any of the downstream versions.
Clearly something that needs to be fixed as well.
Regards,
Hans
Quoted 25 lines
Thanks,
DafnaQuoted 21 lines
There is something fishy here...
Regards,
Hans
Quoted 13 lines
include/uapi/linux/rkisp1-config.h +1
-1* * The histogram values divided into 16 bins for V10/V11 and 32 bins * for V12/V13. It is configured within the struct rkisp1_cif_isp_hst_config. @@ -909,7 +910,7 @@ struct rkisp1_cif_isp_af_stat {* RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two. */ struct rkisp1_cif_isp_hist_stat { -__u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; +__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; };/**
Am 19.01.21 um 17:32 schrieb Hans Verkuil:
Quoted 32 lines · Dafna Hirschfeld
Quoted 31 lines
Am 19.01.21 um 16:00 schrieb Hans Verkuil:
Quoted 27 lines · Dafna Hirschfeld
Quoted 17 lines
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to
__u32.Signed-off-by Dafna Hirschfeld <[email protected]>---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)include/uapi/linux/rkisp1-config.h +0
-0include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 899
Quoted 6 lines
include/uapi/linux/rkisp1-config.h +2
-1@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part. So bits 0-3 are the fractional part and bits 4-19 contain the integer part? What goes where should be defined!
Quoted 5 lines
Quoted 3 lines
Actually I don't know, I just copied the docs in the datasheet. I can try figure it out. I can meanwhile send a patch without the doc until we are sure. Is that OK?
No, this should be documented properly.
I see that indeed bits 0-3 are the fractional part.
The measurements are taken over 25 sub-windows and it is possible to give a weight to each window. If I set all weights to 1 then I expect to get an integer value and indeed in that case I see that the last 4 bits are always 0. If I set the weights to other than 1 I get the last 4 bits not only 0.
The UAPI is generally not very good documented mainly because there is currently no open source userspace that uses it.
Quoted 3 lines
Is this the only fractional type that is used in the rkisp1 uapi or are there others? (Just checking).
There are other places as well.
I see that there are some values in rkisp1_cif_isp_lsc_config that are fractional and not documented.
The two other fractional types in the uapi are already documented.
I can add a patch that extends the documentation of all the fields in the uapi using the datasheet. But I think such a patch can be added after de-staging.
Thanks,
Dafna
Quoted 16 lines
Quoted 10 lines
Quoted 10 lines
Looking at
rkisp1_stats_get_hst_meas()I see this:for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX; i++) pbuf->params.hist.hist_bins[i] = (u8)rkisp1_read(rkisp1, RKISP1_CIF_ISP_HIST_BIN_0 + i * 4);Quoted 5 lines
Quoted 1 line
Here this is cast to a u8, so how does this work?
This seems to be a bug. I see that this cast is introduced in v12 of the patch "media: staging: rkisp1: add capture device for statistics".
This cast does not exist in any of the downstream versions.
Quoted 32 lines
Clearly something that needs to be fixed as well.
Regards,
Hans
Quoted 25 lines
Thanks,
DafnaQuoted 21 lines
There is something fishy here...
Regards,
Hans
Quoted 13 lines
include/uapi/linux/rkisp1-config.h +1
-1* * The histogram values divided into 16 bins for V10/V11 and 32 bins * for V12/V13. It is configured within the struct rkisp1_cif_isp_hst_config. @@ -909,7 +910,7 @@ struct rkisp1_cif_isp_af_stat {* RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two. */ struct rkisp1_cif_isp_hist_stat { -__u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; +__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; };/**
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Quoted 54 lines · Dafna Hirschfeld
Am 19.01.21 um 17:32 schrieb Hans Verkuil:
Quoted 32 lines · Dafna Hirschfeld
Quoted 31 lines
Am 19.01.21 um 16:00 schrieb Hans Verkuil:
Quoted 27 lines · Dafna Hirschfeld
Quoted 17 lines
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to
__u32.Signed-off-by Dafna Hirschfeld <[email protected]>---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)include/uapi/linux/rkisp1-config.h +0
-0include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 899
Quoted 6 lines
include/uapi/linux/rkisp1-config.h +2
-1@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part. So bits 0-3 are the fractional part and bits 4-19 contain the integer part? What goes where should be defined!
Quoted 5 lines
Quoted 3 lines
Actually I don't know, I just copied the docs in the datasheet. I can try figure it out. I can meanwhile send a patch without the doc until we are sure. Is that OK?
No, this should be documented properly.
I see that indeed bits 0-3 are the fractional part.
The measurements are taken over 25 sub-windows and it is possible to give a weight to each window. If I set all weights to 1 then I expect to get an integer value and indeed in that case I see that the last 4 bits are always 0. If I set the weights to other than 1 I get the last 4 bits not only 0.The UAPI is generally not very good documented mainly because there is currently no open source userspace that uses it.
Quoted 3 lines
Is this the only fractional type that is used in the rkisp1 uapi or are there others? (Just checking).
Quoted 7 lines
There are other places as well.
I see that there are some values inrkisp1_cif_isp_lsc_configthat are fractional and not documented.
The two other fractional types in the uapi are already documented.I can add a patch that extends the documentation of all the fields in the uapi using the datasheet. But I think such a patch can be added after de-staging.
You need to make changes anyway in the uAPI for 5.11 (including fixing the bad u8 cast), so let's do this right.
Regards,
Hans
Quoted 53 lines
Thanks,
DafnaQuoted 48 lines
Quoted 10 lines
Quoted 10 lines
Looking at
rkisp1_stats_get_hst_meas()I see this:for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX; i++) pbuf->params.hist.hist_bins[i] = (u8)rkisp1_read(rkisp1, RKISP1_CIF_ISP_HIST_BIN_0 + i * 4);Quoted 5 lines
Quoted 1 line
Here this is cast to a u8, so how does this work?
This seems to be a bug. I see that this cast is introduced in v12 of the patch "media: staging: rkisp1: add capture device for statistics".
This cast does not exist in any of the downstream versions.Clearly something that needs to be fixed as well.
Regards,
Hans
Quoted 25 lines
Thanks,
DafnaQuoted 21 lines
There is something fishy here...
Regards,
Hans
Quoted 13 lines
include/uapi/linux/rkisp1-config.h +1
-1* * The histogram values divided into 16 bins for V10/V11 and 32 bins * for V12/V13. It is configured within the struct rkisp1_cif_isp_hst_config. @@ -909,7 +910,7 @@ struct rkisp1_cif_isp_af_stat {* RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two. */ struct rkisp1_cif_isp_hist_stat { -__u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; +__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; };/**
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Am 20.01.21 um 10:58 schrieb Hans Verkuil:
Quoted 63 lines · Dafna Hirschfeld
Quoted 54 lines
Am 19.01.21 um 17:32 schrieb Hans Verkuil:
Quoted 32 lines · Dafna Hirschfeld
Quoted 31 lines
Am 19.01.21 um 16:00 schrieb Hans Verkuil:
Quoted 27 lines · Dafna Hirschfeld
Quoted 17 lines
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to
__u32.Signed-off-by Dafna Hirschfeld <[email protected]>---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)include/uapi/linux/rkisp1-config.h +0
-0include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 899
Quoted 6 lines
include/uapi/linux/rkisp1-config.h +2
-1@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part. So bits 0-3 are the fractional part and bits 4-19 contain the integer part? What goes where should be defined!
Quoted 5 lines
Quoted 3 lines
Actually I don't know, I just copied the docs in the datasheet. I can try figure it out. I can meanwhile send a patch without the doc until we are sure. Is that OK?
No, this should be documented properly.
I see that indeed bits 0-3 are the fractional part.
The measurements are taken over 25 sub-windows and it is possible to give a weight to each window. If I set all weights to 1 then I expect to get an integer value and indeed in that case I see that the last 4 bits are always 0. If I set the weights to other than 1 I get the last 4 bits not only 0.The UAPI is generally not very good documented mainly because there is currently no open source userspace that uses it.
Quoted 3 lines
Is this the only fractional type that is used in the rkisp1 uapi or are there others? (Just checking).
Quoted 7 lines
There are other places as well.
I see that there are some values inrkisp1_cif_isp_lsc_configthat are fractional and not documented.
The two other fractional types in the uapi are already documented.I can add a patch that extends the documentation of all the fields in the uapi using the datasheet. But I think such a patch can be added after de-staging.
Quoted 6 lines
You need to make changes anyway in the uAPI for 5.11 (including fixing the bad u8 cast), so let's do this right.
Regards,
Hans
So just to make sure I understood correctly, in addition to Heiko Stuebner's patchset. I should a add another patchset that includes:
1. changing the hist_bins type to __u32,
2. removing the u8 cast in rkisp1-stats.c
3. documenting all the fields in the uapi
I don't know what is the policy for fixes among the kernel management, I am worried that if we are too late or the changes are too big they might reject it.
Also, documenting thoroughly can only be done if there is userspace app or at least unit tests that test each component since the datasheet lack some details as in this case.
Thanks,
Dafna
Quoted 50 lines
Quoted 50 lines
Thanks,
DafnaQuoted 44 lines
Quoted 10 lines
Quoted 10 lines
Looking at
rkisp1_stats_get_hst_meas()I see this:for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX; i++) pbuf->params.hist.hist_bins[i] = (u8)rkisp1_read(rkisp1, RKISP1_CIF_ISP_HIST_BIN_0 + i * 4);Quoted 5 lines
Quoted 1 line
Here this is cast to a u8, so how does this work?
This seems to be a bug. I see that this cast is introduced in v12 of the patch "media: staging: rkisp1: add capture device for statistics".
This cast does not exist in any of the downstream versions.Clearly something that needs to be fixed as well.
Regards,
Hans
Quoted 22 lines
Thanks,
DafnaQuoted 18 lines
There is something fishy here...
Regards,
Hans
Quoted 11 lines
include/uapi/linux/rkisp1-config.h +1
-1* * The histogram values divided into 16 bins for V10/V11 and 32 bins * for V12/V13. It is configured within the struct rkisp1_cif_isp_hst_config. @@ -909,7 +910,7 @@ struct rkisp1_cif_isp_af_stat {* RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two. */ struct rkisp1_cif_isp_hist_stat { -__u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; +__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX ]; };
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 916
Quoted 2 lines
include/uapi/linux/rkisp1-config.h +0
-0/**
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Quoted 71 lines · Dafna Hirschfeld
Am 20.01.21 um 10:58 schrieb Hans Verkuil:
Quoted 68 lines · Dafna Hirschfeld
Quoted 54 lines
Am 19.01.21 um 17:32 schrieb Hans Verkuil:
Quoted 32 lines · Dafna Hirschfeld
Quoted 31 lines
Am 19.01.21 um 16:00 schrieb Hans Verkuil:
Quoted 27 lines · Dafna Hirschfeld
Quoted 17 lines
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to
__u32.Signed-off-by Dafna Hirschfeld <[email protected]>---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)include/uapi/linux/rkisp1-config.h +0
-0include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 899
Quoted 6 lines
include/uapi/linux/rkisp1-config.h +2
-1@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part. So bits 0-3 are the fractional part and bits 4-19 contain the integer part? What goes where should be defined!
Quoted 5 lines
Quoted 3 lines
Actually I don't know, I just copied the docs in the datasheet. I can try figure it out. I can meanwhile send a patch without the doc until we are sure. Is that OK?
No, this should be documented properly.
I see that indeed bits 0-3 are the fractional part.
The measurements are taken over 25 sub-windows and it is possible to give a weight to each window. If I set all weights to 1 then I expect to get an integer value and indeed in that case I see that the last 4 bits are always 0. If I set the weights to other than 1 I get the last 4 bits not only 0.The UAPI is generally not very good documented mainly because there is currently no open source userspace that uses it.
Quoted 3 lines
Is this the only fractional type that is used in the rkisp1 uapi or are there others? (Just checking).
Quoted 7 lines
There are other places as well.
I see that there are some values inrkisp1_cif_isp_lsc_configthat are fractional and not documented.
The two other fractional types in the uapi are already documented.I can add a patch that extends the documentation of all the fields in the uapi using the datasheet. But I think such a patch can be added after de-staging.
You need to make changes anyway in the uAPI for 5.11 (including fixing the bad u8 cast), so let's do this right.
Regards,
Quoted 8 lines
Quoted 1 line
Hans
So just to make sure I understood correctly, in addition to Heiko Stuebner's patchset. I should a add another patchset that includes:
1. changing the
hist_binstype to__u32,
2. removing the u8 cast inrkisp1-stats.c
3. documenting all the fields in the uapi
Well, documenting the fractional types at least. Or are you talking about other fields as well?
Quoted 3 lines
I don't know what is the policy for fixes among the kernel management, I am worried that if we are too late or the changes are too big they might reject it.
rc4 was released last weekend, so if it is possible to post these fixes today/tomorrow then there is enough time. I'd like to post a PR for these and other fixes ideally no later than Friday.
The documentation patch can slip to 5.12 if really necessary, but I would prefer to have that as part of the 5.11 fixes as well.
Quoted 3 lines
Also, documenting thoroughly can only be done if there is userspace app or at least unit tests that test each component since the datasheet lack some details as in this case.
Do what you can. If some things need more time, then it is OK to postpone that part to 5.12.
Regards,
Hans
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Am 20.01.21 um 11:49 schrieb Hans Verkuil:
Quoted 99 lines · Dafna Hirschfeld
Quoted 71 lines
Am 20.01.21 um 10:58 schrieb Hans Verkuil:
Quoted 68 lines · Dafna Hirschfeld
Quoted 54 lines
Am 19.01.21 um 17:32 schrieb Hans Verkuil:
Quoted 32 lines · Dafna Hirschfeld
Quoted 31 lines
Am 19.01.21 um 16:00 schrieb Hans Verkuil:
Quoted 27 lines · Dafna Hirschfeld
Quoted 17 lines
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to
__u32.Signed-off-by Dafna Hirschfeld <[email protected]>---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)include/uapi/linux/rkisp1-config.h +0
-0include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 899
Quoted 6 lines
include/uapi/linux/rkisp1-config.h +2
-1@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part. So bits 0-3 are the fractional part and bits 4-19 contain the integer part? What goes where should be defined!
Quoted 5 lines
Quoted 3 lines
Actually I don't know, I just copied the docs in the datasheet. I can try figure it out. I can meanwhile send a patch without the doc until we are sure. Is that OK?
No, this should be documented properly.
I see that indeed bits 0-3 are the fractional part.
The measurements are taken over 25 sub-windows and it is possible to give a weight to each window. If I set all weights to 1 then I expect to get an integer value and indeed in that case I see that the last 4 bits are always 0. If I set the weights to other than 1 I get the last 4 bits not only 0.The UAPI is generally not very good documented mainly because there is currently no open source userspace that uses it.
Quoted 3 lines
Is this the only fractional type that is used in the rkisp1 uapi or are there others? (Just checking).
Quoted 7 lines
There are other places as well.
I see that there are some values inrkisp1_cif_isp_lsc_configthat are fractional and not documented.
The two other fractional types in the uapi are already documented.I can add a patch that extends the documentation of all the fields in the uapi using the datasheet. But I think such a patch can be added after de-staging.
You need to make changes anyway in the uAPI for 5.11 (including fixing the bad u8 cast), so let's do this right.
Regards,
Quoted 8 lines
Quoted 1 line
Hans
So just to make sure I understood correctly, in addition to Heiko Stuebner's patchset. I should a add another patchset that includes:
1. changing the
hist_binstype to__u32,
2. removing the u8 cast inrkisp1-stats.c
3. documenting all the fields in the uapiWell, documenting the fractional types at least. Or are you talking about other fields as well?
Quoted 3 lines
I don't know what is the policy for fixes among the kernel management, I am worried that if we are too late or the changes are too big they might reject it.
rc4 was released last weekend, so if it is possible to post these fixes today/tomorrow then there is enough time. I'd like to post a PR for these and other fixes ideally no later than Friday.
The documentation patch can slip to 5.12 if really necessary, but I would prefer to have that as part of the 5.11 fixes as well.
Quoted 3 lines
Also, documenting thoroughly can only be done if there is userspace app or at least unit tests that test each component since the datasheet lack some details as in this case.
Quoted 6 lines
Do what you can. If some things need more time, then it is OK to postpone that part to 5.12.
Regards,
Hans
Hi, so there is one issue in Heiko's patch, in 2/4 which changes the array size to 25, the code in rkisp1-params.c should also change to iterate it only 25 times.
I talked to Heiko, and we said that I'll send a v7 of his patchset that includes in addition to his patches my patches and also that fix to patch 2/4.
Is that fine or should we keep it in two separated patches?
Thanks,
Dafna
Quoted 1 line
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Quoted 107 lines · Dafna Hirschfeld
Am 20.01.21 um 11:49 schrieb Hans Verkuil:
Quoted 104 lines · Dafna Hirschfeld
Quoted 71 lines
Am 20.01.21 um 10:58 schrieb Hans Verkuil:
Quoted 68 lines · Dafna Hirschfeld
Quoted 54 lines
Am 19.01.21 um 17:32 schrieb Hans Verkuil:
Quoted 32 lines · Dafna Hirschfeld
Quoted 31 lines
Am 19.01.21 um 16:00 schrieb Hans Verkuil:
Quoted 27 lines · Dafna Hirschfeld
Quoted 17 lines
Each entry in the array is a 20 bits value composed of 16 bits unsigned integer and 4 bits fractional part. So the type should change to
__u32.Signed-off-by Dafna Hirschfeld <[email protected]>---
This patch is applied on top of v6 of the patchset "Fix the rkisp1 userspace API for later IP versions"include/uapi/linux/rkisp1-config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)include/uapi/linux/rkisp1-config.h +0
-0include/uapi/linux/rkisp1-config.h struct rkisp1_cif_isp_af_stat { · line 899
Quoted 6 lines
include/uapi/linux/rkisp1-config.h +2
-1@@ -895,7 +895,8 @@ struct rkisp1_cif_isp_af_stat {/** * struct rkisp1_cif_isp_hist_stat - statistics histogram data * -* @hist_bins: measured bin counters +* @hist_bins: measured bin counters. Each bin is a 20 bits value +* composed of a 16-bit unsigned integer and 4 bits fractional part. So bits 0-3 are the fractional part and bits 4-19 contain the integer part? What goes where should be defined!
Quoted 5 lines
Quoted 3 lines
Actually I don't know, I just copied the docs in the datasheet. I can try figure it out. I can meanwhile send a patch without the doc until we are sure. Is that OK?
No, this should be documented properly.
I see that indeed bits 0-3 are the fractional part.
The measurements are taken over 25 sub-windows and it is possible to give a weight to each window. If I set all weights to 1 then I expect to get an integer value and indeed in that case I see that the last 4 bits are always 0. If I set the weights to other than 1 I get the last 4 bits not only 0.The UAPI is generally not very good documented mainly because there is currently no open source userspace that uses it.
Quoted 3 lines
Is this the only fractional type that is used in the rkisp1 uapi or are there others? (Just checking).
Quoted 7 lines
There are other places as well.
I see that there are some values inrkisp1_cif_isp_lsc_configthat are fractional and not documented.
The two other fractional types in the uapi are already documented.I can add a patch that extends the documentation of all the fields in the uapi using the datasheet. But I think such a patch can be added after de-staging.
You need to make changes anyway in the uAPI for 5.11 (including fixing the bad u8 cast), so let's do this right.
Regards,
Quoted 8 lines
Quoted 1 line
Hans
So just to make sure I understood correctly, in addition to Heiko Stuebner's patchset. I should a add another patchset that includes:
1. changing the
hist_binstype to__u32,
2. removing the u8 cast inrkisp1-stats.c
3. documenting all the fields in the uapiWell, documenting the fractional types at least. Or are you talking about other fields as well?
Quoted 3 lines
I don't know what is the policy for fixes among the kernel management, I am worried that if we are too late or the changes are too big they might reject it.
rc4 was released last weekend, so if it is possible to post these fixes today/tomorrow then there is enough time. I'd like to post a PR for these and other fixes ideally no later than Friday.
The documentation patch can slip to 5.12 if really necessary, but I would prefer to have that as part of the 5.11 fixes as well.
Quoted 3 lines
Also, documenting thoroughly can only be done if there is userspace app or at least unit tests that test each component since the datasheet lack some details as in this case.
Do what you can. If some things need more time, then it is OK to postpone that part to 5.12.
Regards,
Quoted 7 lines
Quoted 1 line
Hans
Hi, so there is one issue in Heiko's patch, in 2/4 which changes the array size to 25, the code in
rkisp1-params.cshould also change to iterate it only 25 times.
I talked to Heiko, and we said that I'll send a v7 of his patchset that includes in addition to his patches my patches and also that fix to patch 2/4.
Is that fine or should we keep it in two separated patches?
That's fine. Easier, actually.
Regards,
Hans
Quoted 5 lines
Thanks,
DafnaQuoted 1 line
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip