Skip to content

Commit

Permalink
drm: sti: add HQVDP plane
Browse files Browse the repository at this point in the history
High Quality Video Data Plane is hardware IP dedicated
to video rendering. Compare to GPD (graphic planes) it
have better scaler capabilities.

HQVDP use VID layer to push data into hardware compositor
without going into DDR. From data flow point of view HQVDP
and VID are nested so HQVPD update/disable VID.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
  • Loading branch information
Benjamin Gaignard committed Dec 11, 2014
1 parent 96006a7 commit 4fdbc67
Show file tree
Hide file tree
Showing 12 changed files with 1,513 additions and 7 deletions.
26 changes: 26 additions & 0 deletions Documentation/devicetree/bindings/gpu/st,stih4xx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ sti-hda:
- clock-names: names of the clocks listed in clocks property in the same
order.

sti-hqvdp:
must be a child of sti-display-subsystem
Required properties:
- compatible: "st,stih<chip>-hqvdp"
- reg: Physical base address of the IP registers and length of memory mapped region.
- clocks: from common clock binding: handle hardware IP needed clocks, the
number of clocks may depend of the SoC type.
See ../clocks/clock-bindings.txt for details.
- clock-names: names of the clocks listed in clocks property in the same
order.
- resets: resets to be used by the device
See ../reset/reset.txt for details.
- reset-names: names of the resets listed in resets property in the same
order.
- st,vtg: phandle on vtg main device node.

Example:

/ {
Expand Down Expand Up @@ -183,6 +199,16 @@ Example:
clocks = <&clockgen_c_vcc CLK_S_PIX_HD>, <&clockgen_c_vcc CLK_S_HDDAC>;
};
};

sti-hqvdp@9c000000 {
compatible = "st,stih407-hqvdp";
reg = <0x9C00000 0x100000>;
clock-names = "hqvdp", "pix_main";
clocks = <&clk_s_c0_flexgen CLK_MAIN_DISP>, <&clk_s_d2_flexgen CLK_PIX_MAIN_DISP>;
reset-names = "hqvdp";
resets = <&softreset STIH407_HDQVDP_SOFTRESET>;
st,vtg = <&vtg_main>;
};
};
...
};
1 change: 1 addition & 0 deletions drivers/gpu/drm/sti/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config DRM_STI
select DRM_KMS_HELPER
select DRM_GEM_CMA_HELPER
select DRM_KMS_CMA_HELPER
select FW_LOADER_USER_HELPER_FALLBACK
help
Choose this option to enable DRM on STM stiH41x chipset

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/sti/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ obj-$(CONFIG_DRM_STI) = \
sti_hda.o \
sti_tvout.o \
sticompositor.o \
sti_drm_drv.o
sti_hqvdp.o \
sti_drm_drv.o
1 change: 1 addition & 0 deletions drivers/gpu/drm/sti/sti_compositor.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ static int sti_compositor_bind(struct device *dev, struct device *master,
plane++;
break;
case STI_BCK:
case STI_VDP:
break;
}

Expand Down
6 changes: 4 additions & 2 deletions drivers/gpu/drm/sti/sti_drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ sti_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
w = crtc->primary->fb->width - x;
h = crtc->primary->fb->height - y;

return sti_layer_prepare(layer, crtc->primary->fb, &crtc->mode,
return sti_layer_prepare(layer, crtc,
crtc->primary->fb, &crtc->mode,
mixer->id, 0, 0, w, h, x, y, w, h);
}

Expand All @@ -175,7 +176,8 @@ static int sti_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
w = crtc->primary->fb->width - crtc->x;
h = crtc->primary->fb->height - crtc->y;

ret = sti_layer_prepare(layer, crtc->primary->fb, &crtc->mode,
ret = sti_layer_prepare(layer, crtc,
crtc->primary->fb, &crtc->mode,
mixer->id, 0, 0, w, h,
crtc->x, crtc->y, w, h);
if (ret) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/sti/sti_drm_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ sti_drm_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
}

/* src_x are in 16.16 format. */
res = sti_layer_prepare(layer, fb, &crtc->mode, mixer->id,
res = sti_layer_prepare(layer, crtc, fb,
&crtc->mode, mixer->id,
crtc_x, crtc_y, crtc_w, crtc_h,
src_x >> 16, src_y >> 16,
src_w >> 16, src_h >> 16);
Expand Down
Loading

0 comments on commit 4fdbc67

Please sign in to comment.