drm/stm: ltdc: add clut mode support
Subsystems (4)
PATCH 1/1 drm/stm: ltdc: add clut mode support
Add the 8-bit clut mode support at crtc level. Useful for low memory footprint user interfaces but also for 8-bit old games (including color shifting visual effects). Tested with fbdev FBIOPUTCMAP & drm DRM_IOCTL_MODE_SETGAMMA ioctls.
--- drivers/gpu/drm/stm/ltdc.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
drivers/gpu/drm/stm/ltdc.c +30 -0
@@ -174,6 +174,8 @@#define LXCFBLNR_CFBLN GENMASK(10, 0)/* Color Frame Buffer Line Number */ +#define CLUT_SIZE 256 +#define CONSTA_MAX 0xFF/* CONSTant Alpha MAX= 1.0 */ #define BF1_PAXCA 0x600/* Pixel Alpha x Constant Alpha */ #define BF1_CA 0x400/* Constant Alpha */
@@ -362,6 +364,28 @@ static irqreturn_t ltdc_irq(int irq, void *arg)* DRM_CRTC */ +static void ltdc_crtc_update_clut (struct drm_crtc *crtc) +{ +struct ltdc_device *ldev =crtc_to_ltdc (crtc); +struct drm_color_lut *lut; +u32 val; +int i; + +if (!crtc || !crtc->state) +return ; + +if (!crtc->state->color_mgmt_changed || !crtc->state->gamma_lut) +return ; + + lut = (struct drm_color_lut *)crtc->state->gamma_lut->data; + +for (i =0 ; i <CLUT_SIZE ; i++, lut++) { + val = ((lut->red <<8 ) &0xff0000 ) | (lut->green &0xff00 ) | + (lut->blue >>8 ) | (i <<24 ); +reg_write (ldev->regs,LTDC_L1CLUTWR , val); + } +} +static void ltdc_crtc_atomic_enable (struct drm_crtc *crtc,struct drm_crtc_state *old_state) {
@@ -485,6 +509,8 @@ static void ltdc_crtc_atomic_flush(struct drm_crtc *crtc,DRM_DEBUG_ATOMIC ("\n" ); +ltdc_crtc_update_clut (crtc); +/* Commit shadow registers = update planes at next vblank */ reg_set (ldev->regs,LTDC_SRCR ,SRCR_VBR );
@@ -532,6 +558,7 @@ void ltdc_crtc_disable_vblank(struct drm_device *ddev, unsigned int pipe) .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, + .gamma_set = drm_atomic_helper_legacy_gamma_set, };/*
@@ -764,6 +791,9 @@ static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc)drm_crtc_helper_add (crtc, <dc_crtc_helper_funcs); +drm_mode_crtc_set_gamma_size (crtc,CLUT_SIZE ); +drm_crtc_enable_color_mgmt (crtc,0 , false,CLUT_SIZE ); +DRM_DEBUG_DRIVER ("CRTC:%d created\n" , crtc->base.id);/* Add planes. Note : the first layer is used by primary plane */
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
+ Peter
Hi Peter,
CLUT support on STM32 has been removed thanks to your clean up patch named "drm: stm: remove dead code and pointless local lut storage"
(https://patchwork.freedesktop.org/patch/166898/)
This below patch puts back the clut mode support using the new drm gamma api.
May I ask you please a short review on this patch?
Many thanks,
Philippe :-)
Quoted 72 lines · Philippe Cornu
Add the 8-bit clut mode support at crtc level. Useful for low memory footprint user interfaces but also for 8-bit old games (including color shifting visual effects). Tested with fbdev FBIOPUTCMAP & drm
DRM_IOCTL_MODE_SETGAMMAioctls.Signed-off-by Philippe Cornu <[email protected]>--- drivers/gpu/drm/stm/ltdc.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)drivers/gpu/drm/stm/ltdc.c +27
-0@@ -174,6 +174,8 @@#define LXCFBLNR_CFBLN GENMASK(10, 0)/* Color Frame Buffer Line Number */ +#define CLUT_SIZE 256 +#define CONSTA_MAX 0xFF/* CONSTant Alpha MAX= 1.0 */ #define BF1_PAXCA 0x600/* Pixel Alpha x Constant Alpha */ #define BF1_CA 0x400/* Constant Alpha */ @@ -362,6 +364,28 @@ static irqreturn_t ltdc_irq(int irq, void *arg)* DRM_CRTC */ +static void ltdc_crtc_update_clut (struct drm_crtc *crtc) +{ +struct ltdc_device *ldev =crtc_to_ltdc (crtc); +struct drm_color_lut *lut; +u32 val; +int i; + +if (!crtc || !crtc->state) +return ; + +if (!crtc->state->color_mgmt_changed || !crtc->state->gamma_lut) +return ; + + lut = (struct drm_color_lut *)crtc->state->gamma_lut->data; + +for (i =0 ; i <CLUT_SIZE ; i++, lut++) { + val = ((lut->red <<8 ) &0xff0000 ) | (lut->green &0xff00 ) | + (lut->blue >>8 ) | (i <<24 ); +reg_write (ldev->regs,LTDC_L1CLUTWR , val); + } +} +static void ltdc_crtc_atomic_enable (struct drm_crtc *crtc,struct drm_crtc_state *old_state) {@@ -485,6 +509,8 @@ static void ltdc_crtc_atomic_flush(struct drm_crtc *crtc,DRM_DEBUG_ATOMIC ("\n" ); +ltdc_crtc_update_clut (crtc); +/* Commit shadow registers = update planes at next vblank */ reg_set (ldev->regs,LTDC_SRCR ,SRCR_VBR );@@ -532,6 +558,7 @@ void ltdc_crtc_disable_vblank(struct drm_device *ddev, unsigned int pipe) .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, + .gamma_set = drm_atomic_helper_legacy_gamma_set, };/*
drivers/gpu/drm/stm/ltdc.c static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc) · line 799
Quoted 9 lines
drivers/gpu/drm/stm/ltdc.c +3
-0@@ -764,6 +791,9 @@ static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc)drm_crtc_helper_add (crtc, <dc_crtc_helper_funcs); +drm_mode_crtc_set_gamma_size (crtc,CLUT_SIZE ); +drm_crtc_enable_color_mgmt (crtc,0 , false,CLUT_SIZE ); +DRM_DEBUG_DRIVER ("CRTC:%d created\n" , crtc->base.id);/* Add planes. Note : the first layer is used by primary plane */
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Philippe CORNU
+ Peter
Hi Peter,
CLUT support on STM32 has been removed thanks to your clean up patch
Support is a bit strong for what I thought was a dead function, or are you saying that it used to work before my series? Really sorry if that is the case!
Anyway, the function I removed seemed to indicate that the hardware could handle a separate clut for each layer, but your new version does not. Why is that?
Cheers,
peda
Quoted 93 lines
named "drm: stm: remove dead code and pointless local lut storage"
(https://patchwork.freedesktop.org/patch/166898/)This below patch puts back the clut mode support using the new drm gamma api.
May I ask you please a short review on this patch?
Many thanks,
Philippe :-)Quoted 80 lines · Philippe Cornu
Add the 8-bit clut mode support at crtc level. Useful for low memory footprint user interfaces but also for 8-bit old games (including color shifting visual effects). Tested with fbdev FBIOPUTCMAP & drm
DRM_IOCTL_MODE_SETGAMMAioctls.Signed-off-by Philippe Cornu <[email protected]>--- drivers/gpu/drm/stm/ltdc.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)drivers/gpu/drm/stm/ltdc.c +30
-0@@ -174,6 +174,8 @@#define LXCFBLNR_CFBLN GENMASK(10, 0)/* Color Frame Buffer Line Number */ +#define CLUT_SIZE 256 +#define CONSTA_MAX 0xFF/* CONSTant Alpha MAX= 1.0 */ #define BF1_PAXCA 0x600/* Pixel Alpha x Constant Alpha */ #define BF1_CA 0x400/* Constant Alpha */ @@ -362,6 +364,28 @@ static irqreturn_t ltdc_irq(int irq, void *arg)* DRM_CRTC */ +static void ltdc_crtc_update_clut (struct drm_crtc *crtc) +{ +struct ltdc_device *ldev =crtc_to_ltdc (crtc); +struct drm_color_lut *lut; +u32 val; +int i; + +if (!crtc || !crtc->state) +return ; + +if (!crtc->state->color_mgmt_changed || !crtc->state->gamma_lut) +return ; + + lut = (struct drm_color_lut *)crtc->state->gamma_lut->data; + +for (i =0 ; i <CLUT_SIZE ; i++, lut++) { + val = ((lut->red <<8 ) &0xff0000 ) | (lut->green &0xff00 ) | + (lut->blue >>8 ) | (i <<24 ); +reg_write (ldev->regs,LTDC_L1CLUTWR , val); + } +} +static void ltdc_crtc_atomic_enable (struct drm_crtc *crtc,struct drm_crtc_state *old_state) {@@ -485,6 +509,8 @@ static void ltdc_crtc_atomic_flush(struct drm_crtc *crtc,DRM_DEBUG_ATOMIC ("\n" ); +ltdc_crtc_update_clut (crtc); +/* Commit shadow registers = update planes at next vblank */ reg_set (ldev->regs,LTDC_SRCR ,SRCR_VBR );@@ -532,6 +558,7 @@ void ltdc_crtc_disable_vblank(struct drm_device *ddev, unsigned int pipe) .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, + .gamma_set = drm_atomic_helper_legacy_gamma_set, };/* @@ -764,6 +791,9 @@ static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc)drm_crtc_helper_add (crtc, <dc_crtc_helper_funcs); +drm_mode_crtc_set_gamma_size (crtc,CLUT_SIZE ); +drm_crtc_enable_color_mgmt (crtc,0 , false,CLUT_SIZE ); +DRM_DEBUG_DRIVER ("CRTC:%d created\n" , crtc->base.id);/* Add planes. Note : the first layer is used by primary plane */
Hi Peter,
Quoted 10 lines · Peter Rosin
Quoted 5 lines · Philippe CORNU
+ Peter
Hi Peter,
CLUT support on STM32 has been removed thanks to your clean up patch
Support is a bit strong for what I thought was a dead function, or are you saying that it used to work before my series? Really sorry if that is the case!
As I wrote in the previous related thread
(https://lists.freedesktop.org/archives/dri-devel/2017-June/145070.html),
STM32 chipsets supports 8-bit CLUT mode but this driver version does not support it "yet"...
So, no worry regarding your clean up, I gave you an "acked-by" for that : )
Quoted 4 lines
Anyway, the function I removed seemed to indicate that the hardware could handle a separate clut for each layer, but your new version does not. Why is that?
Yes I confirm the clut support is available for each layer... but I thought the gamma_lut was only at the crtc level, not at layer level... Maybe I am wrong.
Moreover, small test applications I used play only with clut at crtc level...
Anyway, could you please help me to "find" a per-layer clut implementation because when I read "crtc->state->gamma_lut->data" it looks like gamma_lut is per crtc, not per plane...? or maybe I have to add extra properties for that...
Many thanks,
Philippe :-)
Quoted 89 lines
Cheers,
pedaQuoted 85 lines
named "drm: stm: remove dead code and pointless local lut storage"
(https://patchwork.freedesktop.org/patch/166898/)This below patch puts back the clut mode support using the new drm gamma api.
May I ask you please a short review on this patch?
Many thanks,
Philippe :-)Quoted 72 lines · Philippe Cornu
Add the 8-bit clut mode support at crtc level. Useful for low memory footprint user interfaces but also for 8-bit old games (including color shifting visual effects). Tested with fbdev FBIOPUTCMAP & drm
DRM_IOCTL_MODE_SETGAMMAioctls.Signed-off-by Philippe Cornu <[email protected]>--- drivers/gpu/drm/stm/ltdc.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)drivers/gpu/drm/stm/ltdc.c +27
-0@@ -174,6 +174,8 @@#define LXCFBLNR_CFBLN GENMASK(10, 0)/* Color Frame Buffer Line Number */ +#define CLUT_SIZE 256 +#define CONSTA_MAX 0xFF/* CONSTant Alpha MAX= 1.0 */ #define BF1_PAXCA 0x600/* Pixel Alpha x Constant Alpha */ #define BF1_CA 0x400/* Constant Alpha */ @@ -362,6 +364,28 @@ static irqreturn_t ltdc_irq(int irq, void *arg)* DRM_CRTC */ +static void ltdc_crtc_update_clut (struct drm_crtc *crtc) +{ +struct ltdc_device *ldev =crtc_to_ltdc (crtc); +struct drm_color_lut *lut; +u32 val; +int i; + +if (!crtc || !crtc->state) +return ; + +if (!crtc->state->color_mgmt_changed || !crtc->state->gamma_lut) +return ; + + lut = (struct drm_color_lut *)crtc->state->gamma_lut->data; + +for (i =0 ; i <CLUT_SIZE ; i++, lut++) { + val = ((lut->red <<8 ) &0xff0000 ) | (lut->green &0xff00 ) | + (lut->blue >>8 ) | (i <<24 ); +reg_write (ldev->regs,LTDC_L1CLUTWR , val); + } +} +static void ltdc_crtc_atomic_enable (struct drm_crtc *crtc,struct drm_crtc_state *old_state) {@@ -485,6 +509,8 @@ static void ltdc_crtc_atomic_flush(struct drm_crtc *crtc,DRM_DEBUG_ATOMIC ("\n" ); +ltdc_crtc_update_clut (crtc); +/* Commit shadow registers = update planes at next vblank */ reg_set (ldev->regs,LTDC_SRCR ,SRCR_VBR );@@ -532,6 +558,7 @@ void ltdc_crtc_disable_vblank(struct drm_device *ddev, unsigned int pipe) .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, + .gamma_set = drm_atomic_helper_legacy_gamma_set, };/* @@ -764,6 +791,9 @@ static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc)
Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/stm/ltdc.c static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc) · line 799
Quoted 8 lines
drivers/gpu/drm/stm/ltdc.c +3
-0drm_crtc_helper_add (crtc, <dc_crtc_helper_funcs); +drm_mode_crtc_set_gamma_size (crtc,CLUT_SIZE ); +drm_crtc_enable_color_mgmt (crtc,0 , false,CLUT_SIZE ); +DRM_DEBUG_DRIVER ("CRTC:%d created\n" , crtc->base.id);/* Add planes. Note : the first layer is used by primary plane */
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 14 lines · Philippe CORNU
Hi Peter,
Quoted 10 lines · Peter Rosin
Quoted 5 lines · Philippe CORNU
+ Peter
Hi Peter,
CLUT support on STM32 has been removed thanks to your clean up patch
Support is a bit strong for what I thought was a dead function, or are you saying that it used to work before my series? Really sorry if that is the case!
Quoted 6 lines
As I wrote in the previous related thread
(https://lists.freedesktop.org/archives/dri-devel/2017-June/145070.html),
STM32 chipsets supports 8-bit CLUT mode but this driver version does not support it "yet"...So, no worry regarding your clean up, I gave you an "acked-by" for that : )
Ok, good. Thanks for clearing that up!
Quoted 11 lines
Quoted 4 lines
Anyway, the function I removed seemed to indicate that the hardware could handle a separate clut for each layer, but your new version does not. Why is that?
Yes I confirm the clut support is available for each layer... but I thought the
gamma_lutwas only at the crtc level, not at layer level... Maybe I am wrong.
Moreover, small test applications I used play only with clut at crtc level...
Quoted 4 lines
Anyway, could you please help me to "find" a per-layer clut implementation because when I read "
crtc->state->gamma_lut->data" it looks likegamma_lutis per crtc, not per plane...? or maybe I have to add extra properties for that...
I wasn't clear enough. Yes, there is to my knowledge only one clut, not one per plane. What I noticed was that the function I removed seemed to touch clut registers for multiple layers, but your new function appears to only touch registers for one layer. So, I wondered if the "one and only" clut needed to be copied to the registers for the other layers, or if the old dead code was simply confused. Clearer?
Cheers.
Peter
Hi Peter,
Quoted 40 lines · Peter Rosin
Quoted 14 lines · Philippe CORNU
Hi Peter,
Quoted 10 lines · Peter Rosin
Quoted 5 lines · Philippe CORNU
+ Peter
Hi Peter,
CLUT support on STM32 has been removed thanks to your clean up patch
Support is a bit strong for what I thought was a dead function, or are you saying that it used to work before my series? Really sorry if that is the case!
Quoted 6 lines
As I wrote in the previous related thread
(https://lists.freedesktop.org/archives/dri-devel/2017-June/145070.html),
STM32 chipsets supports 8-bit CLUT mode but this driver version does not support it "yet"...So, no worry regarding your clean up, I gave you an "acked-by" for that : )
Ok, good. Thanks for clearing that up!
Quoted 11 lines
Quoted 4 lines
Anyway, the function I removed seemed to indicate that the hardware could handle a separate clut for each layer, but your new version does not. Why is that?
Yes I confirm the clut support is available for each layer... but I thought the
gamma_lutwas only at the crtc level, not at layer level... Maybe I am wrong.
Moreover, small test applications I used play only with clut at crtc level...Quoted 4 lines
Anyway, could you please help me to "find" a per-layer clut implementation because when I read "
crtc->state->gamma_lut->data" it looks likegamma_lutis per crtc, not per plane...? or maybe I have to add extra properties for that...
Quoted 8 lines
I wasn't clear enough. Yes, there is to my knowledge only one clut, not one per plane. What I noticed was that the function I removed seemed to touch clut registers for multiple layers, but your new function appears to only touch registers for one layer. So, I wondered if the "one and only" clut needed to be copied to the registers for the other layers, or if the old dead code was simply confused. Clearer?
The old code was a generic helper function (ie. for all layers) but used only for the 1st layer. So, we could say that "old dead code was simply confused" :-)
When I put back the clut support in this patch, I decided to update only the 1st layer (because there is no API for handling it on other layers). I also decided to not re-use the former generic helper function as the update loop is pretty small.
This patch offers the clut mode feature for fbdev (only one plane in fbdev) and for drm (single plane for many use cases, 2nd plane being used mostly for video...)
If tomorrow the API offers clut support per plane, the update loop will be moved to the plane update function, means the generic helper function will not be require anymore too.
Many thanks
Philippe :)
Quoted 3 lines
Cheers.
Peter
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Peter,
Quoted 63 lines · Philippe CORNU
Hi Peter,
Quoted 42 lines · Peter Rosin
Quoted 14 lines · Philippe CORNU
Hi Peter,
Quoted 10 lines · Peter Rosin
Quoted 5 lines · Philippe CORNU
+ Peter
Hi Peter,
CLUT support on STM32 has been removed thanks to your clean up patch
Support is a bit strong for what I thought was a dead function, or are you saying that it used to work before my series? Really sorry if that is the case!
Quoted 8 lines
As I wrote in the previous related thread
(https://lists.freedesktop.org/archives/dri-devel/2017-June/145070.html),STM32 chipsets supports 8-bit CLUT mode but this driver version does not support it "yet"...
So, no worry regarding your clean up, I gave you an "acked-by" for that : )
Ok, good. Thanks for clearing that up!
Quoted 11 lines
Quoted 4 lines
Anyway, the function I removed seemed to indicate that the hardware could handle a separate clut for each layer, but your new version does not. Why is that?
Yes I confirm the clut support is available for each layer... but I thought the
gamma_lutwas only at the crtc level, not at layer level... Maybe I am wrong.
Moreover, small test applications I used play only with clut at crtc level...Quoted 4 lines
Anyway, could you please help me to "find" a per-layer clut implementation because when I read "
crtc->state->gamma_lut->data" it looks likegamma_lutis per crtc, not per plane...? or maybe I have to add extra properties for that...Quoted 8 lines
I wasn't clear enough. Yes, there is to my knowledge only one clut, not one per plane. What I noticed was that the function I removed seemed to touch clut registers for multiple layers, but your new function appears to only touch registers for one layer. So, I wondered if the "one and only" clut needed to be copied to the registers for the other layers, or if the old dead code was simply confused. Clearer?
The old code was a generic helper function (ie. for all layers) but used only for the 1st layer. So, we could say that "old dead code was simply confused" :-)
When I put back the clut support in this patch, I decided to update only the 1st layer (because there is no API for handling it on other layers). I also decided to not re-use the former generic helper function as the update loop is pretty small.
Quoted 7 lines
This patch offers the clut mode feature for fbdev (only one plane in fbdev) and for drm (single plane for many use cases, 2nd plane being used mostly for video...)
If tomorrow the API offers clut support per plane, the update loop will be moved to the plane update function, means the generic helper function will not be require anymore too.
From the explanations above, do you think the patch is "acceptable" or
should I change it somehow?
What is your opinion?
Many thanks,
Philippe :-)
Quoted 7 lines
Many thanks
Philippe :)Quoted 3 lines
Cheers.
Peter
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 70 lines · Philippe CORNU
Hi Peter,
Quoted 67 lines · Philippe CORNU
Hi Peter,
Quoted 42 lines · Peter Rosin
Quoted 14 lines · Philippe CORNU
Hi Peter,
Quoted 10 lines · Peter Rosin
Quoted 5 lines · Philippe CORNU
+ Peter
Hi Peter,
CLUT support on STM32 has been removed thanks to your clean up patch
Support is a bit strong for what I thought was a dead function, or are you saying that it used to work before my series? Really sorry if that is the case!
Quoted 8 lines
As I wrote in the previous related thread
(https://lists.freedesktop.org/archives/dri-devel/2017-June/145070.html),STM32 chipsets supports 8-bit CLUT mode but this driver version does not support it "yet"...
So, no worry regarding your clean up, I gave you an "acked-by" for that : )
Ok, good. Thanks for clearing that up!
Quoted 11 lines
Quoted 4 lines
Anyway, the function I removed seemed to indicate that the hardware could handle a separate clut for each layer, but your new version does not. Why is that?
Yes I confirm the clut support is available for each layer... but I thought the
gamma_lutwas only at the crtc level, not at layer level... Maybe I am wrong.
Moreover, small test applications I used play only with clut at crtc level...Quoted 4 lines
Anyway, could you please help me to "find" a per-layer clut implementation because when I read "
crtc->state->gamma_lut->data" it looks likegamma_lutis per crtc, not per plane...? or maybe I have to add extra properties for that...Quoted 8 lines
I wasn't clear enough. Yes, there is to my knowledge only one clut, not one per plane. What I noticed was that the function I removed seemed to touch clut registers for multiple layers, but your new function appears to only touch registers for one layer. So, I wondered if the "one and only" clut needed to be copied to the registers for the other layers, or if the old dead code was simply confused. Clearer?
The old code was a generic helper function (ie. for all layers) but used only for the 1st layer. So, we could say that "old dead code was simply confused" :-)
When I put back the clut support in this patch, I decided to update only the 1st layer (because there is no API for handling it on other layers). I also decided to not re-use the former generic helper function as the update loop is pretty small.
This patch offers the clut mode feature for fbdev (only one plane in fbdev) and for drm (single plane for many use cases, 2nd plane being used mostly for video...)
Quoted 7 lines
Quoted 3 lines
If tomorrow the API offers clut support per plane, the update loop will be moved to the plane update function, means the generic helper function will not be require anymore too.
From the explanations above, do you think the patch is "acceptable" or
should I change it somehow?
What is your opinion?
Oops, sorry about forgetting to respond. Since I don't know how the hw behaves with respect to the clut registers for the other layers, I'm just not qualified to say if you should feed the one-and-only clut to all layers or if it is sufficient to only feed it to the first plane.
I don't even know what the expected outcome is if you use clut modes on other planes? Since there is no API for setting up plane-specific cluts, the easy out seems to be to just reuse the one-and-only clut for all planes. Otherwise, there is no way at all to change the clut of the other planes. No?
Other than that, when I added clut-support for atmel-hlcdc, I updated the hw registers as part of drm_plane_helper_funcs.atomic_update (as requested by Boris Brezillon) while you do it in drm_crtc_helper_funcs.atomic_flush. I don't know which is the better place to do it, but since the hw presumably(?) do have clut registers for each plane (as indicated by the code I removed), the plane-helper .atomic_update seems like a better fit (at least from here). And maybe it doesn't matter, but what do I know?
For the record, I know very little about the subsystem. I'm probably wrong in oh so many ways...
Cheers,
Peter
Hi all,
Do you think the patch is "acceptable" or should I change it somehow? Any opinion is welcomed : )
Many thanks,
Philippe :-)
Quoted 75 lines · Philippe CORNU
Hi Peter,
Quoted 64 lines · Philippe CORNU
Hi Peter,
Quoted 43 lines · Peter Rosin
Quoted 17 lines · Philippe CORNU
Hi Peter,
Quoted 10 lines · Peter Rosin
Quoted 5 lines · Philippe CORNU
+ Peter
Hi Peter,
CLUT support on STM32 has been removed thanks to your clean up patch
Support is a bit strong for what I thought was a dead function, or are you saying that it used to work before my series? Really sorry if that is the case!
As I wrote in the previous related thread
(https://lists.freedesktop.org/archives/dri-devel/2017-June/145070.html),Quoted 6 lines
STM32 chipsets supports 8-bit CLUT mode but this driver version does not
support it "yet"...So, no worry regarding your clean up, I gave you an "acked-by" for that : )
Ok, good. Thanks for clearing that up!
Quoted 11 lines
Quoted 4 lines
Anyway, the function I removed seemed to indicate that the hardware could handle a separate clut for each layer, but your new version does not. Why is that?
Yes I confirm the clut support is available for each layer... but I thought the
gamma_lutwas only at the crtc level, not at layer level... Maybe I am wrong.
Moreover, small test applications I used play only with clut at crtc level...Quoted 4 lines
Anyway, could you please help me to "find" a per-layer clut implementation because when I read "
crtc->state->gamma_lut->data" it looks likegamma_lutis per crtc, not per plane...? or maybe I have to add extra properties for that...Quoted 8 lines
I wasn't clear enough. Yes, there is to my knowledge only one clut, not one per plane. What I noticed was that the function I removed seemed to touch clut registers for multiple layers, but your new function appears to only touch registers for one layer. So, I wondered if the "one and only" clut needed to be copied to the registers for the other layers, or if the old dead code was simply confused. Clearer?
The old code was a generic helper function (ie. for all layers) but used only for the 1st layer. So, we could say that "old dead code was simply confused" :-)
When I put back the clut support in this patch, I decided to update only the 1st layer (because there is no API for handling it on other layers). I also decided to not re-use the former generic helper function as the update loop is pretty small.
Quoted 7 lines
This patch offers the clut mode feature for fbdev (only one plane in fbdev) and for drm (single plane for many use cases, 2nd plane being used mostly for video...)
If tomorrow the API offers clut support per plane, the update loop will be moved to the plane update function, means the generic helper function will not be require anymore too.
Quoted 13 lines
From the explanations above, do you think the patch is "acceptable" or
should I change it somehow?
What is your opinion?
Many thanks,
Philippe :-)Quoted 7 lines
Many thanks
Philippe :)Quoted 3 lines
Cheers.
Peter
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Philippe CORNU
Hi all,
Do you think the patch is "acceptable" or should I change it somehow? Any opinion is welcomed : )
Maybe you should try Daniel Vetter? He was very helpful (thanks) when I worked on the clut changes...
Cheers,
Peter
2018-01-09 12:56 GMT+01:00 Peter Rosin <[email protected]>:
Quoted 8 lines · Philippe CORNU
Quoted 4 lines
Hi all,
Do you think the patch is "acceptable" or should I change it somehow? Any opinion is welcomed : )
Maybe you should try Daniel Vetter? He was very helpful (thanks) when I worked on the clut changes...
Since it only impact stm driver, I have applied it on drm-misc-next.
Regards,
Benjamin
Quoted 3 lines
Cheers,
Peter