* [PATCH 1/2] drm: disconnect plane from fb/crtc when disabled
@ 2011-12-14 2:19 Rob Clark
2011-12-14 2:19 ` [PATCH 2/2] drm: add support for private planes Rob Clark
0 siblings, 1 reply; 4+ messages in thread
From: Rob Clark @ 2011-12-14 2:19 UTC (permalink / raw)
To: dri-devel; +Cc: Rob Clark, patches
From: Rob Clark <rob@ti.com>
Since plane->fb and plane->crtc are set in drm_mode_setplane()
after update_plane(), They should be cleared after disable().
Signed-off-by: Rob Clark <rob@ti.com>
---
drivers/gpu/drm/drm_crtc.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index e2c9386..6dad421 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -348,6 +348,9 @@ void drm_framebuffer_cleanup(struct drm_framebuffer *fb)
ret = plane->funcs->disable_plane(plane);
if (ret)
DRM_ERROR("failed to disable plane with busy fb\n");
+ /* disconnect the plane from the fb and crtc: */
+ plane->fb = NULL;
+ plane->crtc = NULL;
}
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] drm: add support for private planes
2011-12-14 2:19 [PATCH 1/2] drm: disconnect plane from fb/crtc when disabled Rob Clark
@ 2011-12-14 2:19 ` Rob Clark
2012-01-05 4:55 ` Rob Clark
0 siblings, 1 reply; 4+ messages in thread
From: Rob Clark @ 2011-12-14 2:19 UTC (permalink / raw)
To: dri-devel; +Cc: Rob Clark, patches
From: Rob Clark <rob@ti.com>
In cases where the scanout hw is sufficiently similar between "overlay"
and traditional crtc layers, it might be convenient to allow the driver
to create internal drm_plane helper objects used by the drm_crtc
implementation, rather than duplicate code between the plane and crtc.
A private plane is not exposed to userspace.
Signed-off-by: Rob Clark <rob@ti.com>
---
drivers/gpu/drm/drm_crtc.c | 22 +++++++++++++++++-----
include/drm/drm_crtc.h | 3 ++-
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 6dad421..d73746e 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -557,7 +557,8 @@ EXPORT_SYMBOL(drm_encoder_cleanup);
int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
unsigned long possible_crtcs,
const struct drm_plane_funcs *funcs,
- uint32_t *formats, uint32_t format_count)
+ const uint32_t *formats, uint32_t format_count,
+ bool priv)
{
mutex_lock(&dev->mode_config.mutex);
@@ -576,8 +577,16 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
plane->format_count = format_count;
plane->possible_crtcs = possible_crtcs;
- list_add_tail(&plane->head, &dev->mode_config.plane_list);
- dev->mode_config.num_plane++;
+ /* private planes are not exposed to userspace, but depending on
+ * display hardware, might be convenient to allow sharing programming
+ * for the scanout engine with the crtc implementation.
+ */
+ if (!priv) {
+ list_add_tail(&plane->head, &dev->mode_config.plane_list);
+ dev->mode_config.num_plane++;
+ } else {
+ INIT_LIST_HEAD(&plane->head);
+ }
mutex_unlock(&dev->mode_config.mutex);
@@ -592,8 +601,11 @@ void drm_plane_cleanup(struct drm_plane *plane)
mutex_lock(&dev->mode_config.mutex);
kfree(plane->format_types);
drm_mode_object_put(dev, &plane->base);
- list_del(&plane->head);
- dev->mode_config.num_plane--;
+ /* if not added to a list, it must be a private plane */
+ if (!list_empty(&plane->head)) {
+ list_del(&plane->head);
+ dev->mode_config.num_plane--;
+ }
mutex_unlock(&dev->mode_config.mutex);
}
EXPORT_SYMBOL(drm_plane_cleanup);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index dd55727..1354ef5 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -828,7 +828,8 @@ extern int drm_plane_init(struct drm_device *dev,
struct drm_plane *plane,
unsigned long possible_crtcs,
const struct drm_plane_funcs *funcs,
- uint32_t *formats, uint32_t format_count);
+ const uint32_t *formats, uint32_t format_count,
+ bool private);
extern void drm_plane_cleanup(struct drm_plane *plane);
extern void drm_encoder_cleanup(struct drm_encoder *encoder);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] drm: add support for private planes
2011-12-14 2:19 ` [PATCH 2/2] drm: add support for private planes Rob Clark
@ 2012-01-05 4:55 ` Rob Clark
2012-01-05 15:58 ` Jesse Barnes
0 siblings, 1 reply; 4+ messages in thread
From: Rob Clark @ 2012-01-05 4:55 UTC (permalink / raw)
To: dri-devel; +Cc: Rob Clark, patches
note: looks like I need to rebase this patch after exynos drm driver
was pulled to drm-next.. if there are some other consumers that are
waiting to be pulled, let me know and I'll just rebase on top of that.
(Either way, it would be a trivial merge conflict.. just add FALSE as
additional arg to drm_plane_init())
BR,
-R
On Tue, Dec 13, 2011 at 8:19 PM, Rob Clark <rob.clark@linaro.org> wrote:
> From: Rob Clark <rob@ti.com>
>
> In cases where the scanout hw is sufficiently similar between "overlay"
> and traditional crtc layers, it might be convenient to allow the driver
> to create internal drm_plane helper objects used by the drm_crtc
> implementation, rather than duplicate code between the plane and crtc.
> A private plane is not exposed to userspace.
>
> Signed-off-by: Rob Clark <rob@ti.com>
> ---
> drivers/gpu/drm/drm_crtc.c | 22 +++++++++++++++++-----
> include/drm/drm_crtc.h | 3 ++-
> 2 files changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 6dad421..d73746e 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -557,7 +557,8 @@ EXPORT_SYMBOL(drm_encoder_cleanup);
> int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
> unsigned long possible_crtcs,
> const struct drm_plane_funcs *funcs,
> - uint32_t *formats, uint32_t format_count)
> + const uint32_t *formats, uint32_t format_count,
> + bool priv)
> {
> mutex_lock(&dev->mode_config.mutex);
>
> @@ -576,8 +577,16 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
> plane->format_count = format_count;
> plane->possible_crtcs = possible_crtcs;
>
> - list_add_tail(&plane->head, &dev->mode_config.plane_list);
> - dev->mode_config.num_plane++;
> + /* private planes are not exposed to userspace, but depending on
> + * display hardware, might be convenient to allow sharing programming
> + * for the scanout engine with the crtc implementation.
> + */
> + if (!priv) {
> + list_add_tail(&plane->head, &dev->mode_config.plane_list);
> + dev->mode_config.num_plane++;
> + } else {
> + INIT_LIST_HEAD(&plane->head);
> + }
>
> mutex_unlock(&dev->mode_config.mutex);
>
> @@ -592,8 +601,11 @@ void drm_plane_cleanup(struct drm_plane *plane)
> mutex_lock(&dev->mode_config.mutex);
> kfree(plane->format_types);
> drm_mode_object_put(dev, &plane->base);
> - list_del(&plane->head);
> - dev->mode_config.num_plane--;
> + /* if not added to a list, it must be a private plane */
> + if (!list_empty(&plane->head)) {
> + list_del(&plane->head);
> + dev->mode_config.num_plane--;
> + }
> mutex_unlock(&dev->mode_config.mutex);
> }
> EXPORT_SYMBOL(drm_plane_cleanup);
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index dd55727..1354ef5 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -828,7 +828,8 @@ extern int drm_plane_init(struct drm_device *dev,
> struct drm_plane *plane,
> unsigned long possible_crtcs,
> const struct drm_plane_funcs *funcs,
> - uint32_t *formats, uint32_t format_count);
> + const uint32_t *formats, uint32_t format_count,
> + bool private);
> extern void drm_plane_cleanup(struct drm_plane *plane);
>
> extern void drm_encoder_cleanup(struct drm_encoder *encoder);
> --
> 1.7.5.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] drm: add support for private planes
2012-01-05 4:55 ` Rob Clark
@ 2012-01-05 15:58 ` Jesse Barnes
0 siblings, 0 replies; 4+ messages in thread
From: Jesse Barnes @ 2012-01-05 15:58 UTC (permalink / raw)
To: Rob Clark; +Cc: dri-devel, patches
[-- Attachment #1.1: Type: text/plain, Size: 4186 bytes --]
Ok no problem. I think Keith just queued up the i915 bits, but I don't
think they've made their way to Dave yet.
Jesse
On Wed, 4 Jan 2012 22:55:31 -0600
Rob Clark <rob@ti.com> wrote:
> note: looks like I need to rebase this patch after exynos drm driver
> was pulled to drm-next.. if there are some other consumers that are
> waiting to be pulled, let me know and I'll just rebase on top of that.
> (Either way, it would be a trivial merge conflict.. just add FALSE as
> additional arg to drm_plane_init())
>
> BR,
> -R
>
> On Tue, Dec 13, 2011 at 8:19 PM, Rob Clark <rob.clark@linaro.org> wrote:
> > From: Rob Clark <rob@ti.com>
> >
> > In cases where the scanout hw is sufficiently similar between "overlay"
> > and traditional crtc layers, it might be convenient to allow the driver
> > to create internal drm_plane helper objects used by the drm_crtc
> > implementation, rather than duplicate code between the plane and crtc.
> > A private plane is not exposed to userspace.
> >
> > Signed-off-by: Rob Clark <rob@ti.com>
> > ---
> > drivers/gpu/drm/drm_crtc.c | 22 +++++++++++++++++-----
> > include/drm/drm_crtc.h | 3 ++-
> > 2 files changed, 19 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > index 6dad421..d73746e 100644
> > --- a/drivers/gpu/drm/drm_crtc.c
> > +++ b/drivers/gpu/drm/drm_crtc.c
> > @@ -557,7 +557,8 @@ EXPORT_SYMBOL(drm_encoder_cleanup);
> > int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
> > unsigned long possible_crtcs,
> > const struct drm_plane_funcs *funcs,
> > - uint32_t *formats, uint32_t format_count)
> > + const uint32_t *formats, uint32_t format_count,
> > + bool priv)
> > {
> > mutex_lock(&dev->mode_config.mutex);
> >
> > @@ -576,8 +577,16 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
> > plane->format_count = format_count;
> > plane->possible_crtcs = possible_crtcs;
> >
> > - list_add_tail(&plane->head, &dev->mode_config.plane_list);
> > - dev->mode_config.num_plane++;
> > + /* private planes are not exposed to userspace, but depending on
> > + * display hardware, might be convenient to allow sharing programming
> > + * for the scanout engine with the crtc implementation.
> > + */
> > + if (!priv) {
> > + list_add_tail(&plane->head, &dev->mode_config.plane_list);
> > + dev->mode_config.num_plane++;
> > + } else {
> > + INIT_LIST_HEAD(&plane->head);
> > + }
> >
> > mutex_unlock(&dev->mode_config.mutex);
> >
> > @@ -592,8 +601,11 @@ void drm_plane_cleanup(struct drm_plane *plane)
> > mutex_lock(&dev->mode_config.mutex);
> > kfree(plane->format_types);
> > drm_mode_object_put(dev, &plane->base);
> > - list_del(&plane->head);
> > - dev->mode_config.num_plane--;
> > + /* if not added to a list, it must be a private plane */
> > + if (!list_empty(&plane->head)) {
> > + list_del(&plane->head);
> > + dev->mode_config.num_plane--;
> > + }
> > mutex_unlock(&dev->mode_config.mutex);
> > }
> > EXPORT_SYMBOL(drm_plane_cleanup);
> > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> > index dd55727..1354ef5 100644
> > --- a/include/drm/drm_crtc.h
> > +++ b/include/drm/drm_crtc.h
> > @@ -828,7 +828,8 @@ extern int drm_plane_init(struct drm_device *dev,
> > struct drm_plane *plane,
> > unsigned long possible_crtcs,
> > const struct drm_plane_funcs *funcs,
> > - uint32_t *formats, uint32_t format_count);
> > + const uint32_t *formats, uint32_t format_count,
> > + bool private);
> > extern void drm_plane_cleanup(struct drm_plane *plane);
> >
> > extern void drm_encoder_cleanup(struct drm_encoder *encoder);
> > --
> > 1.7.5.4
> >
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-01-05 15:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-14 2:19 [PATCH 1/2] drm: disconnect plane from fb/crtc when disabled Rob Clark
2011-12-14 2:19 ` [PATCH 2/2] drm: add support for private planes Rob Clark
2012-01-05 4:55 ` Rob Clark
2012-01-05 15:58 ` Jesse Barnes
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.