drm/vc4: Add support for the transposer IP
Subsystems (6)
v3 cover drm/vc4: Add support for the transposer IP
Hello,
This is the third version of this series adding writeback support to the VC4 display engine.
This version is based on drm-misc-next and include a bunch of modifications to the core that I had to add to make it work on VC4.
Not much has changed in this v3, just a few minor fixes/cleanup/rework and the addition of one patch to make commit->atomic_commit() optional. See the changelog in each patch you want more details.
Regards,
Boris
Boris Brezillon (9):
drm/atomic: Avoid connector to writeback_connector casts drm/connector: Pass a drm_connector_state to ->atomic_commit() drm/connector: Make ->atomic_commit() optional
drm/vc4: Use wait_for_flip_done() instead of wait_for_vblanks() drm/crtc: Add a generic infrastructure to fake VBLANK events drm/atomic: Call fake_vblank() from the generic commit_tail() helpers drm/vc4: Call drm_atomic_helper_fake_vblank() in the commit path drm/vc4: Add support for the transposer block
ARM: dts: bcm283x: Add Transposer block
.../devicetree/bindings/display/brcm,bcm-vc4.txt | 6 + arch/arm/boot/dts/bcm283x.dtsi | 6 + drivers/gpu/drm/drm_atomic.c | 4 +- drivers/gpu/drm/drm_atomic_helper.c | 47 +- drivers/gpu/drm/vc4/Makefile | 1 + drivers/gpu/drm/vc4/vc4_crtc.c | 138 ++++-- drivers/gpu/drm/vc4/vc4_debugfs.c | 1 + drivers/gpu/drm/vc4/vc4_drv.c | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 7 + drivers/gpu/drm/vc4/vc4_kms.c | 11 +- drivers/gpu/drm/vc4/vc4_txp.c | 477 +++++++++++++++++++++ include/drm/drm_atomic_helper.h | 1 + include/drm/drm_crtc.h | 23 + include/drm/drm_modeset_helper_vtables.h | 6 +- include/drm/drm_writeback.h | 6 + 15 files changed, 699 insertions(+), 36 deletions(-) create mode 100644 drivers/gpu/drm/vc4/vc4_txp.c
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 1/9 drm/atomic: Avoid connector to writeback_connector casts
Use container_of() instead of type casting so that it keeps working even if base is moved inside the drm_writeback_connector struct.
---
Changes in v3:
- Add Daniel's and Liviu's R-b
--- drivers/gpu/drm/drm_atomic.c | 4 +++- include/drm/drm_writeback.h | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic.c +3 -1
@@ -2423,6 +2423,7 @@ static int prepare_signaling(struct drm_device *dev, }for_each_new_connector_in_state (state, conn, conn_state, i) { +struct drm_writeback_connector *wb_conn;struct drm_writeback_job *job;struct drm_out_fence_state *f;struct dma_fence *fence;
@@ -2446,7 +2447,8 @@ static int prepare_signaling(struct drm_device *dev, f[*num_fences].out_fence_ptr = fence_ptr; *fence_state = f; - fence =drm_writeback_get_out_fence ((struct drm_writeback_connector *)conn); + wb_conn =drm_connector_to_writeback (conn); + fence =drm_writeback_get_out_fence (wb_conn);if (!fence)return -ENOMEM ;
include/drm/drm_writeback.h +6 -0
@@ -110,6 +110,12 @@ struct drm_writeback_job {struct dma_fence *out_fence; }; +static inline struct drm_writeback_connector * +drm_connector_to_writeback (struct drm_connector *connector) +{ + return container_of(connector, struct drm_writeback_connector, base); +} + int drm_writeback_connector_init(struct drm_device *dev, struct drm_writeback_connector *wb_connector, const struct drm_connector_funcs *con_funcs,
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 2/9 drm/connector: Pass a drm_connector_state to ->atomic_commit()
In reply to Boris BrezillonOther atomic hooks are passed state objects, let's change this one to be consistent.
---
Changes in v3:
- Add Liviu's A-b and Daniel's R-b
Changes in v2:
- New patch
--- drivers/gpu/drm/drm_atomic_helper.c | 2 +- include/drm/drm_modeset_helper_vtables.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_atomic_helper.c +1 -1
@@ -1187,7 +1187,7 @@ static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,if (new_conn_state->writeback_job && new_conn_state->writeback_job->fb) {WARN_ON (connector->connector_type !=DRM_MODE_CONNECTOR_WRITEBACK ); - funcs->atomic_commit (connector, new_conn_state->writeback_job); + funcs->atomic_commit (connector, new_conn_state); } } }
include/drm/drm_modeset_helper_vtables.h +3 -1
@@ -980,11 +980,13 @@ struct drm_connector_helper_funcs {* * This hook is to be used by drivers implementing writeback connectors * that need a point when to commit the writeback job to the hardware. +* The writeback_job to commit is available in +* &drm_connector_state.writeback_job. * * This callback is used by the atomic modeset helpers. */ void (*atomic_commit)(struct drm_connector *connector, -struct drm_writeback_job *writeback_job); +struct drm_connector_state *state); };/**
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 3/9 drm/connector: Make ->atomic_commit() optional
In reply to Boris BrezillonNot all writeback connector implementations might want to commit things from the connector driver. Some, like the malidp driver, commit things from their main commit_tail() function, and would rather not have to implement a dummy hook for drm_connector_helper_funcs.atomic_commit().
Make this function optional and reflect this fact in the doc.
---
Changes in v3:
- New patch
--- drivers/gpu/drm/drm_atomic_helper.c | 2 ++ include/drm/drm_modeset_helper_vtables.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/gpu/drm/drm_atomic_helper.c +2 -0
@@ -1184,6 +1184,8 @@ static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,const struct drm_connector_helper_funcs *funcs; funcs = connector->helper_private; +if (!funcs->funcs->atomic_commit) +continue ;if (new_conn_state->writeback_job && new_conn_state->writeback_job->fb) {WARN_ON (connector->connector_type !=DRM_MODE_CONNECTOR_WRITEBACK );
include/drm/drm_modeset_helper_vtables.h +2 -0
@@ -983,6 +983,8 @@ struct drm_connector_helper_funcs {* The writeback_job to commit is available in * &drm_connector_state.writeback_job. * +* This hook is optional. +* * This callback is used by the atomic modeset helpers. */ void (*atomic_commit)(struct drm_connector *connector,
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 3/9] drm/connector: Make ->atomic_commit() optional
Quoted 8 lines · Boris Brezillon
Not all writeback connector implementations might want to commit things from the connector driver. Some, like the malidp driver, commit things from their main
commit_tail()function, and would rather not have to implement a dummy hook fordrm_connector_helper_funcs.atomic_commit().Make this function optional and reflect this fact in the doc.
Signed-off-by Boris Brezillon <[email protected]>
Thanks!
Liviu
Quoted 41 lines
---
Changes in v3:
- New patch--- drivers/gpu/drm/drm_atomic_helper.c | 2 ++ include/drm/drm_modeset_helper_vtables.h | 2 ++ 2 files changed, 4 insertions(+)drivers/gpu/drm/drm_atomic_helper.c +2
-0@@ -1184,6 +1184,8 @@ static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,const struct drm_connector_helper_funcs *funcs; funcs = connector->helper_private; +if (!funcs->funcs->atomic_commit) +continue ;if (new_conn_state->writeback_job && new_conn_state->writeback_job->fb) {WARN_ON (connector->connector_type !=DRM_MODE_CONNECTOR_WRITEBACK );include/drm/drm_modeset_helper_vtables.h +2
-0@@ -983,6 +983,8 @@ struct drm_connector_helper_funcs {* The writeback_job to commit is available in * &drm_connector_state.writeback_job. * +* This hook is optional. +* * This callback is used by the atomic modeset helpers. */ void (*atomic_commit)(struct drm_connector *connector,Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develkbuild test robot
build botRe: [PATCH v3 3/9] drm/connector: Make ->atomic_commit() optional
In reply to Boris BrezillonI love your patch! Perhaps something to improve:
Hi Boris,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20180702]
[cannot apply to drm/drm-next anholt/for-next robh/for-next v4.18-rc3 v4.18-rc2 v4.18-rc1 v4.18-rc3] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Boris-Brezillon/drm-vc4-Add-support-for-the-transposer-IP/20180702-211805
config: x86_64-randconfig-x010-201826 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 All warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:10:0,
from include/linux/list.h:9,
from include/linux/agp_backend.h:33,
from include/drm/drmP.h:35,
from drivers/gpu/drm/drm_atomic_helper.c:28:
drivers/gpu/drm/drm_atomic_helper.c: In function 'drm_atomic_helper_commit_writebacks':
drivers/gpu/drm/drm_atomic_helper.c:1187:13: error: 'const struct drm_connector_helper_funcs' has no member named 'funcs'
if (!funcs->funcs->atomic_commit)
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/gpu/drm/drm_atomic_helper.c:1187:3: note: in expansion of macro 'if'
if (!funcs->funcs->atomic_commit)
^~
drivers/gpu/drm/drm_atomic_helper.c:1187:13: error: 'const struct drm_connector_helper_funcs' has no member named 'funcs'
if (!funcs->funcs->atomic_commit)
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/gpu/drm/drm_atomic_helper.c:1187:3: note: in expansion of macro 'if'
if (!funcs->funcs->atomic_commit)
^~
drivers/gpu/drm/drm_atomic_helper.c:1187:13: error: 'const struct drm_connector_helper_funcs' has no member named 'funcs'
if (!funcs->funcs->atomic_commit)
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
>> drivers/gpu/drm/drm_atomic_helper.c:1187:3: note: in expansion of macro 'if'
if (!funcs->funcs->atomic_commit)
^~vim +/if +1187 drivers/gpu/drm/drm_atomic_helper.c
1175
1176 static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,
1177 struct drm_atomic_state *old_state)
1178 {
1179 struct drm_connector *connector;
1180 struct drm_connector_state *new_conn_state;
1181 int i;
1182
1183 for_each_new_connector_in_state(old_state, connector, new_conn_state, i) {
1184 const struct drm_connector_helper_funcs *funcs;
1185
1186 funcs = connector->helper_private;
> 1187 if (!funcs->funcs->atomic_commit)
1188 continue;
1189
1190 if (new_conn_state->writeback_job && new_conn_state->writeback_job->fb) {
1191 WARN_ON(connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK);
1192 funcs->atomic_commit(connector, new_conn_state);
1193 }
1194 }
1195 }
1196
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH v3 3/9] drm/connector: Make ->atomic_commit() optional
In reply to Boris BrezillonI love your patch! Yet something to improve:
Hi Boris,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20180702]
[cannot apply to drm/drm-next anholt/for-next robh/for-next v4.18-rc3 v4.18-rc2 v4.18-rc1 v4.18-rc3] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Boris-Brezillon/drm-vc4-Add-support-for-the-transposer-IP/20180702-211805
config: x86_64-randconfig-x015-201826 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 All errors (new ones prefixed by >>):
drivers/gpu//drm/drm_atomic_helper.c: In function 'drm_atomic_helper_commit_writebacks':
>> drivers/gpu//drm/drm_atomic_helper.c:1187:13: error: 'const struct drm_connector_helper_funcs' has no member named 'funcs'
if (!funcs->funcs->atomic_commit)
^~vim +1187 drivers/gpu//drm/drm_atomic_helper.c
1175
1176 static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,
1177 struct drm_atomic_state *old_state)
1178 {
1179 struct drm_connector *connector;
1180 struct drm_connector_state *new_conn_state;
1181 int i;
1182
1183 for_each_new_connector_in_state(old_state, connector, new_conn_state, i) {
1184 const struct drm_connector_helper_funcs *funcs;
1185
1186 funcs = connector->helper_private;
> 1187 if (!funcs->funcs->atomic_commit)
1188 continue;
1189
1190 if (new_conn_state->writeback_job && new_conn_state->writeback_job->fb) {
1191 WARN_ON(connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK);
1192 funcs->atomic_commit(connector, new_conn_state);
1193 }
1194 }
1195 }
1196
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 3/9] drm/connector: Make ->atomic_commit() optional
Quoted 24 lines · On Mon, 2 Jul 2018 23:30:05 +0800 kbuild test robot <[email protected]> wrote:
Hi Boris,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20180702]
[cannot apply to drm/drm-next anholt/for-next robh/for-next v4.18-rc3 v4.18-rc2 v4.18-rc1 v4.18-rc3] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]url: https://github.com/0day-ci/linux/commits/Boris-Brezillon/drm-vc4-Add-support-for-the-transposer-IP/20180702-211805
config: x86_64-randconfig-x015-201826 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:# save the attached .config to linux build tree make ARCH=x86_64All errors (new ones prefixed by >>):
drivers/gpu//drm/drm_atomic_helper.c: In function '
drm_atomic_helper_commit_writebacks':Quoted 1 line
Quoted 1 line
drivers/gpu//drm/drm_atomic_helper.c:1187:13: error: 'const struct
drm_connector_helper_funcs' has no member named 'funcs'if (!funcs->funcs->atomic_commit) ^~vim +1187 drivers/gpu//drm/drm_atomic_helper.c
Quoted 13 lines
1175
1176 static void drm_atomic_helper_commit_writebacks(structdrm_device*dev,
1177 structdrm_atomic_state*old_state)
1178 {
1179 structdrm_connector*connector;
1180 structdrm_connector_state*new_conn_state;
1181 int i;
1182
1183for_each_new_connector_in_state(old_state, connector, new_conn_state, i){
1184 const structdrm_connector_helper_funcs*funcs;
1185
1186 funcs =connector->helper_private;Quoted 1 line
1187 if (!funcs->funcs->atomic_commit)
Oh, shame on me! :-)
I'll send a v4 with this build failure fixed, and this time I'll compile-test at least. :-)
Quoted 10 lines
1188 continue;
1189
1190 if (new_conn_state->writeback_job && new_conn_state->writeback_job->fb) {
1191 WARN_ON(connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK);
1192 funcs->atomic_commit(connector, new_conn_state);
1193 }
1194 }
1195 }
1196 Quoted 3 lines
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 4/9 drm/vc4: Use wait_for_flip_done() instead of wait_for_vblanks()
In reply to Boris Brezillondrm_atomic_helper_wait_for_vblanks() assumes the CRTC will continuously generate VBLANK events and the vblank counter will keep increasing. While this work for a regular pipeline, it doesn't when you have the CRTC is feeding the transposer block, because this block works in oneshot mode, and, by the time we reach drm_atomic_helper_wait_for_vblanks() the only VBLANK event might have already been sent and the VBLANK counter will stay unchanged, thus triggering a timeout.
Luckily, we can replace the drm_atomic_helper_wait_for_vblanks() call by drm_atomic_helper_wait_for_flip_done() because the only thing we want to check when calling drm_atomic_helper_wait_for_vblanks() from vc4_atomic_complete_commit() is that new FBs are in use and the old ones can be safely released.
---
Changes in v3:
- Add Eric's and Liviu's R-b
Changes in v2:
- None
--- drivers/gpu/drm/vc4/vc4_kms.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/vc4/vc4_kms.c +1 -10
@@ -153,18 +153,9 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state)drm_atomic_helper_commit_modeset_enables (dev, state); -/* Make sure that drm_atomic_helper_wait_for_vblanks() -* actually waits for vblank. If we're doing a full atomic -* modeset (as opposed to a vc4_update_plane() short circuit), -* then we need to wait for scanout to be done with our -* display lists before we free it and potentially reallocate -* and overwrite the dlist memory with a new modeset. -*/ - state->legacy_cursor_update = false; -drm_atomic_helper_commit_hw_done (state); -drm_atomic_helper_wait_for_vblanks (dev, state); +drm_atomic_helper_wait_for_flip_done (dev, state);drm_atomic_helper_cleanup_planes (dev, state);
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 5/9 drm/crtc: Add a generic infrastructure to fake VBLANK events
In reply to Boris BrezillonIn some cases CRTCs are active but are not able to generating events, at least not at every frame at it's expected to.
This is typically the case when the CRTC is feeding a writeback connector that has no job queued. In this situation the CRTC is usually stopped until a new job is queued, and this can lead to timeouts when part of the pipeline is updated but no new jobs are queued to the active writeback connector.
In order to solve that, we add a ->no_vblank flag to drm_crtc_state and ask the CRTC drivers to set it to true when they know they're not able to generate VBLANK events. The core drm_atomic_helper_fake_vblank() helper can then be used to fake VBLANKs at commit time.
---
Changes in v3:
- Use inline doc for @no_vblank
- Fix drm_atomic_helper_fake_vblank() to only check new_crtc_state->no_vblank
- Add R-b tags
Changes in v2:
- New patch
--- drivers/gpu/drm/drm_atomic_helper.c | 39 +++++++++++++++++++++++++++++++++++++ include/drm/drm_atomic_helper.h | 1 + include/drm/drm_crtc.h | 23 ++++++++++++++++++++++ 3 files changed, 63 insertions(+)
drivers/gpu/drm/drm_atomic_helper.c +39 -0
@@ -2053,6 +2053,45 @@ void drm_atomic_helper_wait_for_dependencies(struct drm_atomic_state *old_state) }EXPORT_SYMBOL (drm_atomic_helper_wait_for_dependencies); +/** +* drm_atomic_helper_fake_vblank - fake VBLANK events if needed +* @old_state: atomic state object with old state structures +* +* This function walks all CRTCs and fake VBLANK events on those with +* &drm_crtc_state.no_vblank set to true and &drm_crtc_state.event != NULL. +* The primary use of this function is writeback connectors working in oneshot +* mode and faking VBLANK events. In this case they only fake the VBLANK event +* when a job is queued, and any change to the pipeline that does not touch the +* connector is leading to timeouts when calling +* drm_atomic_helper_wait_for_vblanks() or +* drm_atomic_helper_wait_for_flip_done(). +* +* This is part of the atomic helper support for nonblocking commits, see +* drm_atomic_helper_setup_commit() for an overview. +*/ +void drm_atomic_helper_fake_vblank (struct drm_atomic_state *old_state) +{ +struct drm_crtc_state *new_crtc_state; +struct drm_crtc *crtc; +int i; + +for_each_new_crtc_in_state (old_state, crtc, new_crtc_state, i) { +unsigned long flags; + +if (!new_crtc_state->no_vblank) +continue ; + +spin_lock_irqsave (&old_state->dev->event_lock, flags); +if (new_crtc_state->event) { +drm_crtc_send_vblank_event (crtc, + new_crtc_state->event); + new_crtc_state->event =NULL ; + } +spin_unlock_irqrestore (&old_state->dev->event_lock, flags); + } +} +EXPORT_SYMBOL (drm_atomic_helper_fake_vblank); +/** * drm_atomic_helper_commit_hw_done - setup possible nonblocking commit * @old_state: atomic state object with old state structures
include/drm/drm_atomic_helper.h +1 -0
@@ -100,6 +100,7 @@ int __must_check drm_atomic_helper_swap_state(struct drm_atomic_state *state,int drm_atomic_helper_setup_commit (struct drm_atomic_state *state,bool nonblock);void drm_atomic_helper_wait_for_dependencies (struct drm_atomic_state *state); +void drm_atomic_helper_fake_vblank (struct drm_atomic_state *state);void drm_atomic_helper_commit_hw_done (struct drm_atomic_state *state);void drm_atomic_helper_commit_cleanup_done (struct drm_atomic_state *state);
include/drm/drm_crtc.h +23 -0
@@ -119,6 +119,29 @@ struct drm_crtc_state { bool zpos_changed : 1; bool color_mgmt_changed : 1; +/** +* @no_vblank: +* +* Reflects the ability of a CRTC to send VBLANK events. This state +* usually depends on the pipeline configuration, and the main usuage +* is CRTCs feeding a writeback connector operating in oneshot mode. +* In this case the VBLANK event is only generated when a job is queued +* to the writeback connector, and we want the core to fake VBLANK +* events when this part of the pipeline hasn't changed but others had +* or when the CRTC and connectors are being disabled. +* +* __drm_atomic_helper_crtc_duplicate_state() will not reset the value +* from the current state, the CRTC driver is then responsible for +* updating this field when needed. +* +* Note that the combination of &drm_crtc_state.event == NULL and +* &drm_crtc_state.no_blank == true is valid and usually used when the +* writeback connector attached to the CRTC has a new job queued. In +* this case the driver will send the VBLANK event on its own when the +* writeback job is complete. +*/ + bool no_vblank : 1; +/* attached planes bitmask: * WARNING: transitional helpers do not maintain plane_mask so * drivers not converted over to atomic helpers should not rely
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 6/9 drm/atomic: Call fake_vblank() from the generic commit_tail() helpers
In reply to Boris BrezillonNow that we have a way to fake VBLANK events when requested by the CRTC hook it up to the generic commit_tail() helpers.
---
Changes in v3:
- Add R-b tags
Changes in v2:
- New patch
--- drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/drm_atomic_helper.c +4 -0
@@ -1450,6 +1450,8 @@ void drm_atomic_helper_commit_tail(struct drm_atomic_state *old_state)drm_atomic_helper_commit_modeset_enables (dev, old_state); +drm_atomic_helper_fake_vblank (old_state); +drm_atomic_helper_commit_hw_done (old_state);drm_atomic_helper_wait_for_vblanks (dev, old_state);
@@ -1479,6 +1481,8 @@ void drm_atomic_helper_commit_tail_rpm(struct drm_atomic_state *old_state)drm_atomic_helper_commit_planes (dev, old_state,DRM_PLANE_COMMIT_ACTIVE_ONLY ); +drm_atomic_helper_fake_vblank (old_state); +drm_atomic_helper_commit_hw_done (old_state);drm_atomic_helper_wait_for_vblanks (dev, old_state);
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 7/9 drm/vc4: Call drm_atomic_helper_fake_vblank() in the commit path
In reply to Boris BrezillonMimic what is done in drm_atomic_commit_tail() and call drm_atomic_helper_fake_vblank() so that VBLANK events are faked when the drm_crtc_state.no_vblank is true. Will be needed when we'll add support for the transposer block.
---
Changes in v3:
- Add Eric's R-b
Changes in v2:
- New patch
--- drivers/gpu/drm/vc4/vc4_kms.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/vc4/vc4_kms.c +2 -0
@@ -153,6 +153,8 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state)drm_atomic_helper_commit_modeset_enables (dev, state); +drm_atomic_helper_fake_vblank (state); +drm_atomic_helper_commit_hw_done (state);drm_atomic_helper_wait_for_flip_done (dev, state);
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 8/9 drm/vc4: Add support for the transposer block
In reply to Boris BrezillonFrom: Boris Brezillon <[email protected]>
The transposer block is providing support for mem-to-mem composition, which is exposed as a drm_writeback connector in DRM.
Add a driver to support this feature.
---
Changes in v3:
- Add Eric's R-b
- Fix the code updating ->no_blank so that it does not reset it to false when the CRTC is being disabled
- Use a table of txp formats instead of having a big switch-case block
- Fix typos in some comments
- Unconditionally update the DSP3 mux val
- Make sure we don't hang the system when TXP_BUSY is not cleared
Changes in v2:
- Rebased on top of drm-misc-next
--- .../devicetree/bindings/display/brcm,bcm-vc4.txt | 6 + drivers/gpu/drm/vc4/Makefile | 1 + drivers/gpu/drm/vc4/vc4_crtc.c | 138 ++++-- drivers/gpu/drm/vc4/vc4_debugfs.c | 1 + drivers/gpu/drm/vc4/vc4_drv.c | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 7 + drivers/gpu/drm/vc4/vc4_txp.c | 477 +++++++++++++++++++++ 7 files changed, 607 insertions(+), 24 deletions(-) create mode 100644 drivers/gpu/drm/vc4/vc4_txp.c
Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt +6 -0
@@ -74,6 +74,12 @@ Required properties for DSI: The 3 clocks output from the DSI analog PHY: dsi[01]_byte, dsi[01]_ddr2, and dsi[01]_ddr +Required properties for the TXP (writeback) block: +- compatible: Should be "brcm,bcm2835-txp" +- reg: Physical base address and length of the TXP block's registers +- interrupts: The interrupt number + See bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt + [1] Documentation/devicetree/bindings/media/video-interfaces.txt Example:
drivers/gpu/drm/vc4/Makefile +1 -0
@@ -19,6 +19,7 @@ vc4-y := \ vc4_plane.o \ vc4_render_cl.o \ vc4_trace_points.o \ + vc4_txp.o \ vc4_v3d.o \ vc4_validate.o \ vc4_validate_shaders.o
drivers/gpu/drm/vc4/vc4_crtc.c +114 -24
243 lines not on this page · raw message
drivers/gpu/drm/vc4/vc4_debugfs.c +1 -0
@@ -21,6 +21,7 @@ static const struct drm_info_list vc4_debugfs_list[] = { {"dsi1_regs", vc4_dsi_debugfs_regs, 0, (void *)(uintptr_t)1}, {"hdmi_regs", vc4_hdmi_debugfs_regs, 0}, {"vec_regs", vc4_vec_debugfs_regs, 0}, + {"txp_regs", vc4_txp_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
@@ -344,6 +344,7 @@ static struct platform_driver *const component_drivers[] = { &vc4_vec_driver, &vc4_dpi_driver, &vc4_dsi_driver, + &vc4_txp_driver, &vc4_hvs_driver, &vc4_crtc_driver, &vc4_v3d_driver,
drivers/gpu/drm/vc4/vc4_drv.h +7 -0
@@ -73,6 +73,7 @@ struct vc4_dev {struct vc4_dpi *dpi;struct vc4_dsi *dsi1;struct vc4_vec *vec; +struct vc4_txp *txp;struct vc4_hang_state *hang_state;
@@ -698,6 +699,8 @@ bool vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, bool in_vblank_irq, int *vpos, int *hpos, ktime_t *stime, ktime_t *etime, const struct drm_display_mode *mode); +void vc4_crtc_handle_vblank (struct vc4_crtc *crtc); +void vc4_crtc_txp_armed (struct drm_crtc_state *state);/* vc4_debugfs.c */ int vc4_debugfs_init (struct drm_minor *minor);
@@ -745,6 +748,10 @@ int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused);extern struct platform_driver vc4_vec_driver;int vc4_vec_debugfs_regs (struct seq_file *m,void *unused); +/* vc4_txp.c */ +extern struct platform_driver vc4_txp_driver; +int vc4_txp_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_txp.c new file +477 -0
477 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 8/9] drm/vc4: Add support for the transposer block
Quoted 11 lines · Boris Brezillon
From: Boris Brezillon <[email protected]>
The transposer block is providing support for mem-to-mem composition, which is exposed as a
drm_writebackconnector in DRM.Add a driver to support this feature.
Signed-off-by Boris Brezillon <[email protected]>---
Changes in v3:
- Add Eric's R-b
I don't see it, but the cleanups all look good to me so go ahead and add it :)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 8/9] drm/vc4: Add support for the transposer block
Quoted 9 lines · On Mon, 02 Jul 2018 11:52:58 -0700 Eric Anholt <[email protected]> wrote:
Quoted 7 lines · Boris Brezillon
From: Boris Brezillon <[email protected]>
The transposer block is providing support for mem-to-mem composition, which is exposed as a
drm_writebackconnector in DRM.Add a driver to support this feature.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Boris Brezillon <[email protected]>---
Changes in v3:
- Add Eric's R-bI don't see it, but the cleanups all look good to me so go ahead and add it :)
One more reason to send a v4 ;-).
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 9/9 ARM: dts: bcm283x: Add Transposer block
In reply to Boris BrezillonFrom: Boris Brezillon <[email protected]>
The transposer block is allowing one to write the result of the VC4 composition back to memory instead of displaying it on a screen.
---
Changes in v3:
- Add R-b tags
Changes in v2:
- None
--- arch/arm/boot/dts/bcm283x.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/bcm283x.dtsi +6 -0
@@ -66,6 +66,12 @@ clock-frequency = <1000000>; }; + txp@7e004000 { + compatible = "brcm,bcm2835-txp"; + reg = <0x7e004000 0x20>; + interrupts = <1 11>; + }; + dma: dma@7e007000 { compatible = "brcm,bcm2835-dma"; reg = <0x7e007000 0xf00>;
Signature · 6 lines
2.14.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 9/9] ARM: dts: bcm283x: Add Transposer block
Quoted 8 lines · Boris Brezillon
From: Boris Brezillon <[email protected]>
The transposer block is allowing one to write the result of the VC4 composition back to memory instead of displaying it on a screen.
Signed-off-by Boris Brezillon <[email protected]>Reviewed-by Liviu Dudau <[email protected]>Reviewed-by Eric Anholt <[email protected]>
I've pulled this one to bcm2835-dt-next. The drm-misc-next commits will be up to you.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel