drm/sti: cleanup and minor fixes
Subsystems (3)
cover drm/sti: cleanup and minor fixes
Those patches bring some cleaness on some functions and comments.
Bich Hemon (2):
drm/sti: awg_utils code cleanup
drm/sti: GDP planes only support RGB formats
Fabien Dessenne (1):
drm/sti: clarify the skip frame/field message
Vincent Abriou (1):
drm/sti: update VTG timing programming
drivers/gpu/drm/sti/sti_awg_utils.c | 33 +++--- drivers/gpu/drm/sti/sti_gdp.c | 17 ---- drivers/gpu/drm/sti/sti_hqvdp.c | 4 +- drivers/gpu/drm/sti/sti_tvout.c | 59 +++++------ drivers/gpu/drm/sti/sti_vtg.c | 197 +++++++++++++++++++++++++----------- drivers/gpu/drm/sti/sti_vtg.h | 5 + 6 files changed, 187 insertions(+), 128 deletions(-)
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/4 drm/sti: update VTG timing programming
This update eases to understand the VTG programming. It also sets a VTG output id for each supported connectors.
--- drivers/gpu/drm/sti/sti_tvout.c | 59 ++++++------ drivers/gpu/drm/sti/sti_vtg.c | 197 ++++++++++++++++++++++++++++------------ drivers/gpu/drm/sti/sti_vtg.h | 5 + 3 files changed, 173 insertions(+), 88 deletions(-)
drivers/gpu/drm/sti/sti_tvout.c +30 -29
@@ -17,6 +17,7 @@#include <drm/drm_crtc_helper.h> #include "sti_crtc.h" +#include "sti_vtg.h" /* glue registers */ #define TVO_CSC_MAIN_M0 0x000
@@ -85,19 +86,7 @@#define TVO_VIP_SEL_INPUT_BYPASSED 1#define TVO_SYNC_MAIN_VTG_SET_REF 0x00 -#define TVO_SYNC_MAIN_VTG_SET_1 0x01 -#define TVO_SYNC_MAIN_VTG_SET_2 0x02 -#define TVO_SYNC_MAIN_VTG_SET_3 0x03 -#define TVO_SYNC_MAIN_VTG_SET_4 0x04 -#define TVO_SYNC_MAIN_VTG_SET_5 0x05 -#define TVO_SYNC_MAIN_VTG_SET_6 0x06#define TVO_SYNC_AUX_VTG_SET_REF 0x10 -#define TVO_SYNC_AUX_VTG_SET_1 0x11 -#define TVO_SYNC_AUX_VTG_SET_2 0x12 -#define TVO_SYNC_AUX_VTG_SET_3 0x13 -#define TVO_SYNC_AUX_VTG_SET_4 0x14 -#define TVO_SYNC_AUX_VTG_SET_5 0x15 -#define TVO_SYNC_AUX_VTG_SET_6 0x16#define TVO_SYNC_HD_DCS_SHIFT 8
@@ -280,24 +269,26 @@ static void tvout_dvo_start(struct sti_tvout *tvout, bool main_path)struct device_node *node = tvout->dev->of_node;bool sel_input_logic_inverted = false;u32 tvo_in_vid_format; -int val; +int val, tmp;dev_dbg (tvout->dev,"%s\n" , __func__);if (main_path) {DRM_DEBUG_DRIVER ("main vip for DVO\n" ); -/* Select the input sync for dvo = VTG set 4 */ - val =TVO_SYNC_MAIN_VTG_SET_4 <<TVO_SYNC_DVO_PAD_VSYNC_SHIFT ; - val |=TVO_SYNC_MAIN_VTG_SET_4 <<TVO_SYNC_DVO_PAD_HSYNC_SHIFT ; - val |=TVO_SYNC_MAIN_VTG_SET_4 ; +/* Select the input sync for dvo */ + tmp =TVO_SYNC_MAIN_VTG_SET_REF |VTG_SYNC_ID_DVO ; + val = tmp <<TVO_SYNC_DVO_PAD_VSYNC_SHIFT ; + val |= tmp <<TVO_SYNC_DVO_PAD_HSYNC_SHIFT ; + val |= tmp;tvout_write (tvout, val,TVO_DVO_SYNC_SEL ); tvo_in_vid_format =TVO_MAIN_IN_VID_FORMAT ; }else {DRM_DEBUG_DRIVER ("aux vip for DVO\n" ); -/* Select the input sync for dvo = VTG set 4 */ - val =TVO_SYNC_AUX_VTG_SET_4 <<TVO_SYNC_DVO_PAD_VSYNC_SHIFT ; - val |=TVO_SYNC_AUX_VTG_SET_4 <<TVO_SYNC_DVO_PAD_HSYNC_SHIFT ; - val |=TVO_SYNC_AUX_VTG_SET_4 ; +/* Select the input sync for dvo */ + tmp =TVO_SYNC_AUX_VTG_SET_REF |VTG_SYNC_ID_DVO ; + val = tmp <<TVO_SYNC_DVO_PAD_VSYNC_SHIFT ; + val |= tmp <<TVO_SYNC_DVO_PAD_HSYNC_SHIFT ; + val |= tmp;tvout_write (tvout, val,TVO_DVO_SYNC_SEL ); tvo_in_vid_format =TVO_AUX_IN_VID_FORMAT ; }
@@ -345,13 +336,17 @@ static void tvout_hdmi_start(struct sti_tvout *tvout, bool main_path)if (main_path) {DRM_DEBUG_DRIVER ("main vip for hdmi\n" ); -/* select the input sync for hdmi = VTG set 1 */ -tvout_write (tvout,TVO_SYNC_MAIN_VTG_SET_1 ,TVO_HDMI_SYNC_SEL ); +/* select the input sync for hdmi */ +tvout_write (tvout, +TVO_SYNC_MAIN_VTG_SET_REF |VTG_SYNC_ID_HDMI , +TVO_HDMI_SYNC_SEL ); tvo_in_vid_format =TVO_MAIN_IN_VID_FORMAT ; }else {DRM_DEBUG_DRIVER ("aux vip for hdmi\n" ); -/* select the input sync for hdmi = VTG set 1 */ -tvout_write (tvout,TVO_SYNC_AUX_VTG_SET_1 ,TVO_HDMI_SYNC_SEL ); +/* select the input sync for hdmi */ +tvout_write (tvout, +TVO_SYNC_AUX_VTG_SET_REF |VTG_SYNC_ID_HDMI , +TVO_HDMI_SYNC_SEL ); tvo_in_vid_format =TVO_AUX_IN_VID_FORMAT ; }
@@ -397,13 +392,19 @@ static void tvout_hda_start(struct sti_tvout *tvout, bool main_path)dev_dbg (tvout->dev,"%s\n" , __func__);if (main_path) { - val =TVO_SYNC_MAIN_VTG_SET_2 <<TVO_SYNC_HD_DCS_SHIFT ; - val |=TVO_SYNC_MAIN_VTG_SET_3 ; +DRM_DEBUG_DRIVER ("main vip for HDF\n" ); +/* Select the input sync for HD analog and HD DCS */ + val =TVO_SYNC_MAIN_VTG_SET_REF |VTG_SYNC_ID_HDDCS ; + val = val <<TVO_SYNC_HD_DCS_SHIFT ; + val |=TVO_SYNC_MAIN_VTG_SET_REF |VTG_SYNC_ID_HDF ;tvout_write (tvout, val,TVO_HD_SYNC_SEL ); tvo_in_vid_format =TVO_MAIN_IN_VID_FORMAT ; }else { - val =TVO_SYNC_AUX_VTG_SET_2 <<TVO_SYNC_HD_DCS_SHIFT ; - val |=TVO_SYNC_AUX_VTG_SET_3 ; +DRM_DEBUG_DRIVER ("aux vip for HDF\n" ); +/* Select the input sync for HD analog and HD DCS */ + val =TVO_SYNC_AUX_VTG_SET_REF |VTG_SYNC_ID_HDDCS ; + val = val <<TVO_SYNC_HD_DCS_SHIFT ; + val |=TVO_SYNC_AUX_VTG_SET_REF |VTG_SYNC_ID_HDF ;tvout_write (tvout, val,TVO_HD_SYNC_SEL ); tvo_in_vid_format =TVO_AUX_IN_VID_FORMAT ; }
drivers/gpu/drm/sti/sti_vtg.c +138 -59
242 lines not on this page · raw message
drivers/gpu/drm/sti/sti_vtg.h +5 -0
@@ -10,6 +10,11 @@#define VTG_TOP_FIELD_EVENT 1#define VTG_BOTTOM_FIELD_EVENT 2 +#define VTG_SYNC_ID_HDMI 1 +#define VTG_SYNC_ID_HDDCS 2 +#define VTG_SYNC_ID_HDF 3 +#define VTG_SYNC_ID_DVO 4 +struct sti_vtg ;struct drm_display_mode ;struct notifier_block ;
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/4 drm/sti: awg_utils code cleanup
In reply to Vincent AbriouFrom: Bich Hemon <[email protected]>
data_en is a local variable that doesn't need to be set as awg_generate_instr can be called directly with the requested value.
--- drivers/gpu/drm/sti/sti_awg_utils.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-)
drivers/gpu/drm/sti/sti_awg_utils.c +12 -21
@@ -34,6 +34,8 @@ static int awg_generate_instr(enum opcode opcode,/* skip, repeat and replay arg should not exceed 1023. * If user wants to exceed this value, the instruction should be * duplicate and arg should be adjust for each duplicated instruction. +* +* mux_sel is used in case of SAV/EAV synchronization. */ while (arg_tmp >0 ) {
@@ -115,63 +117,52 @@ int sti_awg_generate_code_data_enable_mode( struct awg_timing *timing) {long int val; -long int data_en;int ret =0 ;if (timing->trailing_lines >0 ) {/* skip trailing lines */ val = timing->blanking_level; - data_en =0 ; - ret |=awg_generate_instr (RPLSET , val,0 , data_en, fwparams); + ret |=awg_generate_instr (RPLSET , val,0 ,0 , fwparams); val = timing->trailing_lines -1 ; - data_en =0 ; - ret |=awg_generate_instr (REPLAY , val,0 , data_en, fwparams); + ret |=awg_generate_instr (REPLAY , val,0 ,0 , fwparams); }if (timing->trailing_pixels >0 ) {/* skip trailing pixel */ val = timing->blanking_level; - data_en =0 ; - ret |=awg_generate_instr (RPLSET , val,0 , data_en, fwparams); + ret |=awg_generate_instr (RPLSET , val,0 ,0 , fwparams); val = timing->trailing_pixels -1 ; - data_en =0 ; - ret |=awg_generate_instr (SKIP , val,0 , data_en, fwparams); + ret |=awg_generate_instr (SKIP , val,0 ,0 , fwparams); }/* set DE signal high */ val = timing->blanking_level; - data_en =1 ; ret |=awg_generate_instr ((timing->trailing_pixels >0 ) ?SET :RPLSET , - val,0 , data_en, fwparams); + val,0 ,1 , fwparams);if (timing->blanking_pixels >0 ) {/* skip the number of active pixel */ val = timing->active_pixels -1 ; - data_en =1 ; - ret |=awg_generate_instr (SKIP , val,0 , data_en, fwparams); + ret |=awg_generate_instr (SKIP , val,0 ,1 , fwparams);/* set DE signal low */ val = timing->blanking_level; - data_en =0 ; - ret |=awg_generate_instr (SET , val,0 , data_en, fwparams); + ret |=awg_generate_instr (SET , val,0 ,0 , fwparams); }/* replay the sequence as many active lines defined */ val = timing->active_lines -1 ; - data_en =0 ; - ret |=awg_generate_instr (REPLAY , val,0 , data_en, fwparams); + ret |=awg_generate_instr (REPLAY , val,0 ,0 , fwparams);if (timing->blanking_lines >0 ) {/* skip blanking lines */ val = timing->blanking_level; - data_en =0 ; - ret |=awg_generate_instr (RPLSET , val,0 , data_en, fwparams); + ret |=awg_generate_instr (RPLSET , val,0 ,0 , fwparams); val = timing->blanking_lines -1 ; - data_en =0 ; - ret |=awg_generate_instr (REPLAY , val,0 , data_en, fwparams); + ret |=awg_generate_instr (REPLAY , val,0 ,0 , fwparams); }return ret;
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/4 drm/sti: clarify the skip frame/field message
In reply to Vincent AbriouFrom: Fabien Dessenne <[email protected]>
When a frame or a field is skipped, output a Warning message instead of an Error message.
--- drivers/gpu/drm/sti/sti_hqvdp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/sti/sti_hqvdp.c +2 -2
@@ -580,7 +580,7 @@ int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data) btm_cmd_offset =sti_hqvdp_get_free_cmd (hqvdp); top_cmd_offest =sti_hqvdp_get_curr_cmd (hqvdp);if ((btm_cmd_offset ==-1 ) || (top_cmd_offest ==-1 )) { -DRM_ERROR ("Cannot get cmds, skip btm field\n" ); +DRM_DEBUG_DRIVER ("Warning: no cmd, will skip field\n" );return -EBUSY ; }
@@ -810,7 +810,7 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane, cmd_offset =sti_hqvdp_get_free_cmd (hqvdp);if (cmd_offset ==-1 ) { -DRM_ERROR ("No available hqvdp_cmd now\n" ); +DRM_DEBUG_DRIVER ("Warning: no cmd, will skip frame\n" );return ; } cmd = hqvdp->hqvdp_cmd + cmd_offset;
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/4 drm/sti: GDP planes only support RGB formats
In reply to Vincent AbriouFrom: Bich Hemon <[email protected]>
Only RGB formats supported by GDP planes
--- drivers/gpu/drm/sti/sti_gdp.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/gpu/drm/sti/sti_gdp.c +0 -17
@@ -32,10 +32,6 @@#define GDP_ABGR8888 (GDP_ARGB8888 | BIGNOTLITTLE | ALPHASWITCH)#define GDP_ARGB1555 0x06#define GDP_ARGB4444 0x07 -#define GDP_CLUT8 0x0B -#define GDP_YCBR888 0x10 -#define GDP_YCBR422R 0x12 -#define GDP_AYCBR8888 0x15#define GAM_GDP_CTL_OFFSET 0x00#define GAM_GDP_AGC_OFFSET 0x04
@@ -123,10 +119,6 @@ static const uint32_t gdp_supported_formats[] = {DRM_FORMAT_ARGB1555 ,DRM_FORMAT_RGB565 , DRM_FORMAT_RGB888, -DRM_FORMAT_AYUV , -DRM_FORMAT_YUV444 , -DRM_FORMAT_VYUY , - DRM_FORMAT_C8, };static int sti_gdp_fourcc2format (int fourcc)
@@ -148,14 +140,6 @@ static int sti_gdp_fourcc2format(int fourcc)return GDP_RGB565 ;case DRM_FORMAT_RGB888 :return GDP_RGB888 ; -case DRM_FORMAT_AYUV : -return GDP_AYCBR8888 ; -case DRM_FORMAT_YUV444 : -return GDP_YCBR888 ; -case DRM_FORMAT_VYUY : -return GDP_YCBR422R ; -case DRM_FORMAT_C8 : -return GDP_CLUT8 ; }return -1 ; }
@@ -165,7 +149,6 @@ static int sti_gdp_get_alpharange(int format)switch (format) {case GDP_ARGB8565 :case GDP_ARGB8888 : -case GDP_AYCBR8888 :case GDP_ABGR8888 :return GAM_GDP_ALPHARANGE_255 ; }
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel