drm/vc4: VEC (SDTV) output support
Subsystems (6)
cover drm/vc4: VEC (SDTV) output support
Here's a series from Boris for enabling SDTV output on VC4. There are two other patches to the clk subsystem necessary to get it working, which I'm in the process of reviewing.
I've tested it on composite input of a monitor I had laying around, and it's basically working. Booting with the firmware bringing up SDTV, I get an image "fine" (to the extent that SDTV is ever fine). If I boot with firmware bringing up HDMI and switch to VEC later, then the image is gray, but the clock got set to 106Mhz instead of 108 so this is probably not a DRM bug.
This series was entirely written by Boris, but I've got the permission to send it out so it's being routed through me.
Boris Brezillon (6):
drm/vc4: Fix ->clock_select setting for the VEC encoder
drm: Add TV connector states to drm_connector_state drm/vc4: Add support for the VEC (Video Encoder) IP drm/vc4: Document VEC DT binding
ARM: bcm/dt: Add VEC node in bcm283x.dtsi
ARM: bcm/dt: Enable the VEC IP on all RaspberryPi boards
.../devicetree/bindings/display/brcm,bcm-vc4.txt | 14 + arch/arm/boot/dts/bcm2835-rpi.dtsi | 5 + arch/arm/boot/dts/bcm283x.dtsi | 8 + drivers/gpu/drm/drm_atomic.c | 50 ++ drivers/gpu/drm/vc4/Makefile | 1 + drivers/gpu/drm/vc4/vc4_crtc.c | 38 +- drivers/gpu/drm/vc4/vc4_debugfs.c | 1 + drivers/gpu/drm/vc4/vc4_drv.c | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 6 + drivers/gpu/drm/vc4/vc4_regs.h | 3 +- drivers/gpu/drm/vc4/vc4_vec.c | 657 +++++++++++++++++++++ include/drm/drm_connector.h | 32 + 12 files changed, 800 insertions(+), 16 deletions(-) create mode 100644 drivers/gpu/drm/vc4/vc4_vec.c
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/6 drm/vc4: Fix ->clock_select setting for the VEC encoder
From: Boris Brezillon <[email protected]>
PV_CONTROL_CLK_SELECT_VEC is actually 2 and not 0. Fix the definition and rework the vc4_set_crtc_possible_masks() to cover the full range of the PV_CONTROL_CLK_SELECT field.
--- drivers/gpu/drm/vc4/vc4_crtc.c | 38 +++++++++++++++++++++++--------------- drivers/gpu/drm/vc4/vc4_drv.h | 1 + drivers/gpu/drm/vc4/vc4_regs.h | 3 ++- 3 files changed, 26 insertions(+), 16 deletions(-)
drivers/gpu/drm/vc4/vc4_crtc.c +23 -15
@@ -83,8 +83,7 @@ struct vc4_crtc_data {/* Which channel of the HVS this pixelvalve sources from. */ int hvs_channel; -enum vc4_encoder_type encoder0_type; -enum vc4_encoder_type encoder1_type; +enum vc4_encoder_type encoder_types[4 ]; };#define CRTC_WRITE (offset, val) writel(val, vc4_crtc->regs + (offset))
@@ -859,20 +858,26 @@ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = {static const struct vc4_crtc_data pv0_data = { .hvs_channel =0 , - .encoder0_type =VC4_ENCODER_TYPE_DSI0 , - .encoder1_type =VC4_ENCODER_TYPE_DPI , + .encoder_types = { + [PV_CONTROL_CLK_SELECT_DSI ] =VC4_ENCODER_TYPE_DSI0 , + [PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI ] =VC4_ENCODER_TYPE_DPI , + }, };static const struct vc4_crtc_data pv1_data = { .hvs_channel =2 , - .encoder0_type =VC4_ENCODER_TYPE_DSI1 , - .encoder1_type =VC4_ENCODER_TYPE_SMI , + .encoder_types = { + [PV_CONTROL_CLK_SELECT_DSI ] =VC4_ENCODER_TYPE_DSI1 , + [PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI ] =VC4_ENCODER_TYPE_SMI , + }, };static const struct vc4_crtc_data pv2_data = { .hvs_channel =1 , - .encoder0_type =VC4_ENCODER_TYPE_VEC , - .encoder1_type =VC4_ENCODER_TYPE_HDMI , + .encoder_types = { + [PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI ] =VC4_ENCODER_TYPE_HDMI , + [PV_CONTROL_CLK_SELECT_VEC ] =VC4_ENCODER_TYPE_VEC , + }, };static const struct of_device_id vc4_crtc_dt_match[] = {
@@ -886,17 +891,20 @@ static void vc4_set_crtc_possible_masks(struct drm_device *drm, struct drm_crtc *crtc) {struct vc4_crtc *vc4_crtc =to_vc4_crtc (crtc); +const struct vc4_crtc_data *crtc_data = vc4_crtc->data; +const enum vc4_encoder_type *encoder_types = crtc_data->encoder_types;struct drm_encoder *encoder;drm_for_each_encoder (encoder, drm) {struct vc4_encoder *vc4_encoder =to_vc4_encoder (encoder); - -if (vc4_encoder->type == vc4_crtc->data->encoder0_type) { - vc4_encoder->clock_select =0 ; - encoder->possible_crtcs |=drm_crtc_mask (crtc); - }else if (vc4_encoder->type == vc4_crtc->data->encoder1_type) { - vc4_encoder->clock_select =1 ; - encoder->possible_crtcs |=drm_crtc_mask (crtc); +int i; + +for (i =0 ; i <ARRAY_SIZE (crtc_data->encoder_types); i++) { +if (vc4_encoder->type == encoder_types[i]) { + vc4_encoder->clock_select = i; + encoder->possible_crtcs |=drm_crtc_mask (crtc); +break ; + } } } }
drivers/gpu/drm/vc4/vc4_drv.h +1 -0
@@ -194,6 +194,7 @@ to_vc4_plane(struct drm_plane *plane) }enum vc4_encoder_type { +VC4_ENCODER_TYPE_NONE ,VC4_ENCODER_TYPE_HDMI ,VC4_ENCODER_TYPE_VEC ,VC4_ENCODER_TYPE_DSI0 ,
drivers/gpu/drm/vc4/vc4_regs.h +2 -1
@@ -177,8 +177,9 @@# define PV_CONTROL_WAIT_HSTART BIT(12)# define PV_CONTROL_PIXEL_REP_MASK VC4_MASK(5, 4)# define PV_CONTROL_PIXEL_REP_SHIFT 4 -# define PV_CONTROL_CLK_SELECT_DSI_VEC 0 +# define PV_CONTROL_CLK_SELECT_DSI 0# define PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI 1 +# define PV_CONTROL_CLK_SELECT_VEC 2# define PV_CONTROL_CLK_SELECT_MASK VC4_MASK(3, 2)# define PV_CONTROL_CLK_SELECT_SHIFT 2# define PV_CONTROL_FIFO_CLR BIT(1)
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/6 drm: Add TV connector states to drm_connector_state
In reply to Eric AnholtFrom: Boris Brezillon <[email protected]>
Some generic TV connector properties are exposed in drm_mode_config, but they are currently handled independently in each DRM encoder driver.
Extend the drm_connector_state to store TV related states, and modify the drm_atomic_connector_{set,get}_property() helpers to fill the connector state accordingly.
Each driver is then responsible for checking and applying the new config in its ->atomic_mode_{check,set}() operations.
--- drivers/gpu/drm/drm_atomic.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 32 ++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+)
drivers/gpu/drm/drm_atomic.c +50 -0
@@ -986,12 +986,38 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,* now?) atomic writes to DPMS property: */ return -EINVAL ; + }else if (property == config->tv_select_subconnector_property) { + state->tv.subconnector = val; + }else if (property == config->tv_left_margin_property) { + state->tv.margins.left = val; + }else if (property == config->tv_right_margin_property) { + state->tv.margins.right = val; + }else if (property == config->tv_top_margin_property) { + state->tv.margins.bottom = val; + }else if (property == config->tv_bottom_margin_property) { + state->tv.margins.right = val; + }else if (property == config->tv_mode_property) { + state->tv.mode = val; + }else if (property == config->tv_brightness_property) { + state->tv.brightness = val; + }else if (property == config->tv_contrast_property) { + state->tv.contrast = val; + }else if (property == config->tv_flicker_reduction_property) { + state->tv.flicker_reduction = val; + }else if (property == config->tv_overscan_property) { + state->tv.overscan = val; + }else if (property == config->tv_saturation_property) { + state->tv.saturation = val; + }else if (property == config->tv_hue_property) { + state->tv.hue = val; }else if (connector->funcs->atomic_set_property) {return connector->funcs->atomic_set_property (connector, state, property, val); }else {return -EINVAL ; } + +return 0 ; }EXPORT_SYMBOL (drm_atomic_connector_set_property);
@@ -1022,6 +1048,30 @@ drm_atomic_connector_get_property(struct drm_connector *connector, *val = (state->crtc) ? state->crtc->base.id :0 ; }else if (property == config->dpms_property) { *val = connector->dpms; + }else if (property == config->tv_select_subconnector_property) { + *val = state->tv.subconnector; + }else if (property == config->tv_left_margin_property) { + *val = state->tv.margins.left; + }else if (property == config->tv_right_margin_property) { + *val = state->tv.margins.right; + }else if (property == config->tv_top_margin_property) { + *val = state->tv.margins.bottom; + }else if (property == config->tv_bottom_margin_property) { + *val = state->tv.margins.right; + }else if (property == config->tv_mode_property) { + *val = state->tv.mode; + }else if (property == config->tv_brightness_property) { + *val = state->tv.brightness; + }else if (property == config->tv_contrast_property) { + *val = state->tv.contrast; + }else if (property == config->tv_flicker_reduction_property) { + *val = state->tv.flicker_reduction; + }else if (property == config->tv_overscan_property) { + *val = state->tv.overscan; + }else if (property == config->tv_saturation_property) { + *val = state->tv.saturation; + }else if (property == config->tv_hue_property) { + *val = state->tv.hue; }else if (connector->funcs->atomic_get_property) {return connector->funcs->atomic_get_property (connector, state, property, val);
include/drm/drm_connector.h +32 -0
@@ -194,10 +194,40 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info, unsigned int num_formats);/** +* struct drm_tv_connector_state - TV connector related states +* @subconnector: selected subconnector +* @margins: left/right/top/bottom margins +* @mode: TV mode +* @brightness: brightness in percent +* @contrast: contrast in percent +* @flicker_reduction: flicker reduction in percent +* @overscan: overscan in percent +* @saturation: saturation in percent +* @hue: hue in percent +*/ +struct drm_tv_connector_state { +int subconnector; +struct { +int left; +int right; +int top; +int bottom; + } margins; +int mode; +int brightness; +int contrast; +int flicker_reduction; +int overscan; +int saturation; +int hue; +}; + +/** * struct drm_connector_state - mutable connector state * @connector: backpointer to the connector * @best_encoder: can be used by helpers and drivers to select the encoder * @state: backpointer to global drm_atomic_state +* @tv: TV connector state */ struct drm_connector_state {struct drm_connector *connector;
@@ -213,6 +243,8 @@ struct drm_connector_state {struct drm_encoder *best_encoder;struct drm_atomic_state *state; + +struct drm_tv_connector_state tv; };/**
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/6] drm: Add TV connector states to drm_connector_state
Quoted 25 lines · Eric Anholt
From: Boris Brezillon <[email protected]>
Some generic TV connector properties are exposed in
drm_mode_config, but they are currently handled independently in each DRM encoder driver.Extend the
drm_connector_stateto store TV related states, and modify the drm_atomic_connector_{set,get}_property() helpers to fill the connector state accordingly.Each driver is then responsible for checking and applying the new config in its ->atomic_mode_{check,set}() operations.
Signed-off-by Boris Brezillon <[email protected]>Signed-off-by Eric Anholt <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 32 ++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+)drivers/gpu/drm/drm_atomic.c +0
-0@@ -986,12 +986,38 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,* now?) atomic writes to DPMS property:
drivers/gpu/drm/drm_atomic.c int drm_atomic_connector_set_property(struct drm_connector *connector, · line 996
Quoted 10 lines
drivers/gpu/drm/drm_atomic.c +8
-0*/ return -EINVAL ; + }else if (property == config->tv_select_subconnector_property) { + state->tv.subconnector = val; + }else if (property == config->tv_left_margin_property) { + state->tv.margins.left = val; + }else if (property == config->tv_right_margin_property) { + state->tv.margins.right = val; + }else if (property == config->tv_top_margin_property) { + state->tv.margins.bottom = val;
s/bottom/top/
drivers/gpu/drm/drm_atomic.c int drm_atomic_connector_set_property(struct drm_connector *connector, · line 998
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +2
-0+ }else if (property == config->tv_bottom_margin_property) { + state->tv.margins.right = val;
s/right/bottom/
Quoted 27 lines
drivers/gpu/drm/drm_atomic.c +16
-0+ }else if (property == config->tv_mode_property) { + state->tv.mode = val; + }else if (property == config->tv_brightness_property) { + state->tv.brightness = val; + }else if (property == config->tv_contrast_property) { + state->tv.contrast = val; + }else if (property == config->tv_flicker_reduction_property) { + state->tv.flicker_reduction = val; + }else if (property == config->tv_overscan_property) { + state->tv.overscan = val; + }else if (property == config->tv_saturation_property) { + state->tv.saturation = val; + }else if (property == config->tv_hue_property) { + state->tv.hue = val; }else if (connector->funcs->atomic_set_property) {return connector->funcs->atomic_set_property (connector, state, property, val); }else {return -EINVAL ; } + +return 0 ; }EXPORT_SYMBOL (drm_atomic_connector_set_property);@@ -1022,6 +1048,30 @@ drm_atomic_connector_get_property(struct drm_connector *connector, *val = (state->crtc) ? state->crtc->base.id :0 ;
drivers/gpu/drm/drm_atomic.c drm_atomic_connector_get_property(struct drm_connector *connector, · line 1058
Quoted 10 lines
drivers/gpu/drm/drm_atomic.c +8
-0}else if (property == config->dpms_property) { *val = connector->dpms; + }else if (property == config->tv_select_subconnector_property) { + *val = state->tv.subconnector; + }else if (property == config->tv_left_margin_property) { + *val = state->tv.margins.left; + }else if (property == config->tv_right_margin_property) { + *val = state->tv.margins.right; + }else if (property == config->tv_top_margin_property) { + *val = state->tv.margins.bottom;
s/bottom/top/
drivers/gpu/drm/drm_atomic.c drm_atomic_connector_get_property(struct drm_connector *connector, · line 1060
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +2
-0+ }else if (property == config->tv_bottom_margin_property) { + *val = state->tv.margins.right;
s/right/bottom/
Quoted 28 lines
drivers/gpu/drm/drm_atomic.c +14
-0+ }else if (property == config->tv_mode_property) { + *val = state->tv.mode; + }else if (property == config->tv_brightness_property) { + *val = state->tv.brightness; + }else if (property == config->tv_contrast_property) { + *val = state->tv.contrast; + }else if (property == config->tv_flicker_reduction_property) { + *val = state->tv.flicker_reduction; + }else if (property == config->tv_overscan_property) { + *val = state->tv.overscan; + }else if (property == config->tv_saturation_property) { + *val = state->tv.saturation; + }else if (property == config->tv_hue_property) { + *val = state->tv.hue; }else if (connector->funcs->atomic_get_property) {return connector->funcs->atomic_get_property (connector, state, property, val);include/drm/drm_connector.h +3
-0@@ -194,10 +194,40 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info, unsigned int num_formats);/** +* struct drm_tv_connector_state - TV connector related states +* @subconnector: selected subconnector +* @margins: left/right/top/bottom margins
include/drm/drm_connector.h int drm_display_info_set_bus_formats(struct drm_display_info *info, · line 209
Quoted 10 lines
include/drm/drm_connector.h +10
-0+* @mode: TV mode +* @brightness: brightness in percent +* @contrast: contrast in percent +* @flicker_reduction: flicker reduction in percent +* @overscan: overscan in percent +* @saturation: saturation in percent +* @hue: hue in percent +*/ +struct drm_tv_connector_state { +int subconnector;
I think an explicit enum for the possible values would be nice. Slightly annoying/fragile since it needs to match the uabi ones, but we I think there's a slight preference to explicit enums internally.
include/drm/drm_connector.h int drm_display_info_set_bus_formats(struct drm_display_info *info, · line 222
Quoted 13 lines
include/drm/drm_connector.h +13
-0+struct { +int left; +int right; +int top; +int bottom; + } margins; +int mode; +int brightness; +int contrast; +int flicker_reduction; +int overscan; +int saturation; +int hue;
All the above properties are unsigned when exposed to userspace. I think for consistency would be good to make them match on the kernel side too.
With the above issues addressed:
And since no one else seems to work on an atomic TV encoder feel free to just stash into the next vc4 pull request.
-Daniel
Quoted 27 lines
include/drm/drm_connector.h +6
-0+}; + +/** * struct drm_connector_state - mutable connector state * @connector: backpointer to the connector * @best_encoder: can be used by helpers and drivers to select the encoder * @state: backpointer to global drm_atomic_state +* @tv: TV connector state */ struct drm_connector_state {struct drm_connector *connector;@@ -213,6 +243,8 @@ struct drm_connector_state {struct drm_encoder *best_encoder;struct drm_atomic_state *state; + +struct drm_tv_connector_state tv; };/** Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/6] drm: Add TV connector states to drm_connector_state
Hi Daniel,
Quoted 83 lines · On Tue, 29 Nov 2016 21:14:10 +0100 Daniel Vetter <[email protected]> wrote:
Quoted 25 lines · Eric Anholt
From: Boris Brezillon <[email protected]>
Some generic TV connector properties are exposed in
drm_mode_config, but they are currently handled independently in each DRM encoder driver.Extend the
drm_connector_stateto store TV related states, and modify the drm_atomic_connector_{set,get}_property() helpers to fill the connector state accordingly.Each driver is then responsible for checking and applying the new config in its ->atomic_mode_{check,set}() operations.
Signed-off-by Boris Brezillon <[email protected]>Signed-off-by Eric Anholt <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 32 ++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+)drivers/gpu/drm/drm_atomic.c +0
-0@@ -986,12 +986,38 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,* now?) atomic writes to DPMS property: drivers/gpu/drm/drm_atomic.c int drm_atomic_connector_set_property(struct drm_connector *connector, · line 996
Quoted 10 lines
drivers/gpu/drm/drm_atomic.c +8
-0*/ return -EINVAL ; + }else if (property == config->tv_select_subconnector_property) { + state->tv.subconnector = val; + }else if (property == config->tv_left_margin_property) { + state->tv.margins.left = val; + }else if (property == config->tv_right_margin_property) { + state->tv.margins.right = val; + }else if (property == config->tv_top_margin_property) { + state->tv.margins.bottom = val;s/bottom/top/
drivers/gpu/drm/drm_atomic.c int drm_atomic_connector_set_property(struct drm_connector *connector, · line 998
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +2
-0+ }else if (property == config->tv_bottom_margin_property) { + state->tv.margins.right = val;s/right/bottom/
Quoted 27 lines
drivers/gpu/drm/drm_atomic.c +16
-0+ }else if (property == config->tv_mode_property) { + state->tv.mode = val; + }else if (property == config->tv_brightness_property) { + state->tv.brightness = val; + }else if (property == config->tv_contrast_property) { + state->tv.contrast = val; + }else if (property == config->tv_flicker_reduction_property) { + state->tv.flicker_reduction = val; + }else if (property == config->tv_overscan_property) { + state->tv.overscan = val; + }else if (property == config->tv_saturation_property) { + state->tv.saturation = val; + }else if (property == config->tv_hue_property) { + state->tv.hue = val; }else if (connector->funcs->atomic_set_property) {return connector->funcs->atomic_set_property (connector, state, property, val); }else {return -EINVAL ; } + +return 0 ; }EXPORT_SYMBOL (drm_atomic_connector_set_property);@@ -1022,6 +1048,30 @@ drm_atomic_connector_get_property(struct drm_connector *connector, *val = (state->crtc) ? state->crtc->base.id :0 ;drivers/gpu/drm/drm_atomic.c drm_atomic_connector_get_property(struct drm_connector *connector, · line 1058
Quoted 10 lines
drivers/gpu/drm/drm_atomic.c +8
-0}else if (property == config->dpms_property) { *val = connector->dpms; + }else if (property == config->tv_select_subconnector_property) { + *val = state->tv.subconnector; + }else if (property == config->tv_left_margin_property) { + *val = state->tv.margins.left; + }else if (property == config->tv_right_margin_property) { + *val = state->tv.margins.right; + }else if (property == config->tv_top_margin_property) { + *val = state->tv.margins.bottom;s/bottom/top/
Quoted 4 lines
drivers/gpu/drm/drm_atomic.c drm_atomic_connector_get_property(struct drm_connector *connector, · line 1060
Quoted 2 lines
drivers/gpu/drm/drm_atomic.c +2
-0+ }else if (property == config->tv_bottom_margin_property) { + *val = state->tv.margins.right;s/right/bottom/
Oops. I'll fix those typos.
Quoted 35 lines
Quoted 35 lines
drivers/gpu/drm/drm_atomic.c +14
-0+ }else if (property == config->tv_mode_property) { + *val = state->tv.mode; + }else if (property == config->tv_brightness_property) { + *val = state->tv.brightness; + }else if (property == config->tv_contrast_property) { + *val = state->tv.contrast; + }else if (property == config->tv_flicker_reduction_property) { + *val = state->tv.flicker_reduction; + }else if (property == config->tv_overscan_property) { + *val = state->tv.overscan; + }else if (property == config->tv_saturation_property) { + *val = state->tv.saturation; + }else if (property == config->tv_hue_property) { + *val = state->tv.hue; }else if (connector->funcs->atomic_get_property) {return connector->funcs->atomic_get_property (connector, state, property, val);include/drm/drm_connector.h +9
-0@@ -194,10 +194,40 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info, unsigned int num_formats);/** +* struct drm_tv_connector_state - TV connector related states +* @subconnector: selected subconnector +* @margins: left/right/top/bottom margins +* @mode: TV mode +* @brightness: brightness in percent +* @contrast: contrast in percent +* @flicker_reduction: flicker reduction in percent +* @overscan: overscan in percent +* @saturation: saturation in percent
Quoted 8 lines
include/drm/drm_connector.h int drm_display_info_set_bus_formats(struct drm_display_info *info, · line 209
Quoted 4 lines
include/drm/drm_connector.h +4
-0+* @hue: hue in percent +*/ +struct drm_tv_connector_state { +int subconnector;I think an explicit enum for the possible values would be nice. Slightly annoying/fragile since it needs to match the uabi ones, but we I think there's a slight preference to explicit enums internally.
Okay.
Quoted 17 lines
Quoted 4 lines
include/drm/drm_connector.h +3
-0+struct { +int left; +int right;include/drm/drm_connector.h int drm_display_info_set_bus_formats(struct drm_display_info *info, · line 222
Quoted 10 lines
include/drm/drm_connector.h +10
-0+int top; +int bottom; + } margins; +int mode; +int brightness; +int contrast; +int flicker_reduction; +int overscan; +int saturation; +int hue;All the above properties are unsigned when exposed to userspace. I think for consistency would be good to make them match on the kernel side too.
Sure.
Quoted 7 lines
With the above issues addressed:
Reviewed-by Daniel Vetter <[email protected]>And since no one else seems to work on an atomic TV encoder feel free to just stash into the next vc4 pull request.
Thanks for the review.
Boris
PATCH 3/6 drm/vc4: Add support for the VEC (Video Encoder) IP
In reply to Eric AnholtFrom: Boris Brezillon <[email protected]>
The VEC IP is a TV DAC, providing support for PAL and NTSC standards.
--- drivers/gpu/drm/vc4/Makefile | 1 + drivers/gpu/drm/vc4/vc4_debugfs.c | 1 + drivers/gpu/drm/vc4/vc4_drv.c | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 5 + drivers/gpu/drm/vc4/vc4_vec.c | 657 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 665 insertions(+) create mode 100644 drivers/gpu/drm/vc4/vc4_vec.c
drivers/gpu/drm/vc4/Makefile +1 -0
@@ -11,6 +11,7 @@ vc4-y := \ vc4_kms.o \ vc4_gem.o \ vc4_hdmi.o \ + vc4_vec.o \ vc4_hvs.o \ vc4_irq.o \ vc4_plane.o \
drivers/gpu/drm/vc4/vc4_debugfs.c +1 -0
@@ -19,6 +19,7 @@ static const struct drm_info_list vc4_debugfs_list[] = { {"bo_stats", vc4_bo_stats_debugfs, 0}, {"dpi_regs", vc4_dpi_debugfs_regs, 0}, {"hdmi_regs", vc4_hdmi_debugfs_regs, 0}, + {"vec_regs", vc4_vec_debugfs_regs, 0}, {"hvs_regs", vc4_hvs_debugfs_regs, 0}, {"crtc0_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)0}, {"crtc1_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)1},
drivers/gpu/drm/vc4/vc4_drv.c +1 -0
@@ -294,6 +294,7 @@ static const struct component_master_ops vc4_drm_ops = {static struct platform_driver *const component_drivers[] = { &vc4_hdmi_driver, + &vc4_vec_driver, &vc4_dpi_driver, &vc4_hvs_driver, &vc4_crtc_driver,
drivers/gpu/drm/vc4/vc4_drv.h +5 -0
@@ -17,6 +17,7 @@ struct vc4_dev {struct vc4_crtc *crtc[3 ];struct vc4_v3d *v3d;struct vc4_dpi *dpi; +struct vc4_vec *vec;struct drm_fbdev_cma *fbdev;
@@ -486,6 +487,10 @@ int vc4_queue_seqno_cb(struct drm_device *dev,extern struct platform_driver vc4_hdmi_driver;int vc4_hdmi_debugfs_regs (struct seq_file *m,void *unused); +/* vc4_hdmi.c */ +extern struct platform_driver vc4_vec_driver; +int vc4_vec_debugfs_regs (struct seq_file *m,void *unused); +/* vc4_irq.c */ irqreturn_t vc4_irq (int irq,void *arg);void vc4_irq_preinstall (struct drm_device *dev);
drivers/gpu/drm/vc4/vc4_vec.c new file +657 -0
657 lines not on this page · raw message
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/6 drm/vc4: Document VEC DT binding
In reply to Eric AnholtFrom: Boris Brezillon <[email protected]>
Document the DT binding for the VEC (Video EnCoder) IP.
--- Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt +14 -0
@@ -43,6 +43,13 @@ Required properties for DPI: - port: Port node with a single endpoint connecting to the panel device, as defined in [1] +Required properties for VEC: +- compatible: Should be "brcm,bcm2835-vec" +- reg: Physical base address and length of the registers +- clocks: The core clock the unit runs on +- interrupts: The interrupt number + See bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt + Required properties for V3D: - compatible: Should be "brcm,bcm2835-v3d" - reg: Physical base address and length of the V3D's registers
@@ -92,6 +99,13 @@ dpi: dpi@7e208000 { }; }; +vec: vec@7e806000 { + compatible = "brcm,bcm2835-vec"; + reg = <0x7e806000 0x1000>; + clocks = <&clocks BCM2835_CLOCK_VEC>; + interrupts = <2 27>; +}; + v3d: v3d@7ec00000 { compatible = "brcm,bcm2835-v3d"; reg = <0x7ec00000 0x1000>;
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/6 ARM: bcm/dt: Add VEC node in bcm283x.dtsi
In reply to Eric AnholtFrom: Boris Brezillon <[email protected]>
Add the VEC (Video EnCoder) node definition in bcm283x.dtsi.
--- arch/arm/boot/dts/bcm283x.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/bcm283x.dtsi +8 -0
@@ -266,6 +266,14 @@ status = "disabled"; }; + vec: vec@7e806000 { + compatible = "brcm,bcm2835-vec"; + reg = <0x7e806000 0x1000>; + clocks = <&clocks BCM2835_CLOCK_VEC>; + interrupts = <2 27>; + status = "disabled"; + }; + pixelvalve@7e807000 { compatible = "brcm,bcm2835-pixelvalve2"; reg = <0x7e807000 0x100>;
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 6/6 ARM: bcm/dt: Enable the VEC IP on all RaspberryPi boards
In reply to Eric AnholtFrom: Boris Brezillon <[email protected]>
Enable the VEC IP on all RaspberryPi boards.
--- arch/arm/boot/dts/bcm2835-rpi.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/boot/dts/bcm2835-rpi.dtsi +5 -0
@@ -84,3 +84,8 @@ power-domains = <&power RPI_POWER_DOMAIN_HDMI>; status = "okay"; }; + +&vec { + power-domains = <&power RPI_POWER_DOMAIN_VEC>; + status = "okay"; +};
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel