All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Jyri Sarha <jsarha@ti.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>,
	laurent.pinchart@ideasonboard.com,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH RFC 00/11] drm/tilcdc: Atomic modeset support
Date: Tue, 10 May 2016 16:04:45 +0200	[thread overview]
Message-ID: <120916d3-69d2-dc7a-98ba-9ccd5bff7880@tronnes.org> (raw)
In-Reply-To: <5731A68B.5010405@ti.com>

Den 10.05.2016 11:14, skrev Jyri Sarha:
> On 05/10/16 09:34, Daniel Vetter wrote:
>>>> There's a drm_simple_display_pipe floating around which seems perfectly
>>>>>> suited to tilcdc. It's meant for the case where you have 1 plane, 1 crtc
>>>>>> and 1 encoder maybe linking to different connectors. And it takes care of
>>>>>> all the small bits for you, with a grand total of 5 callbacks, all of them
>>>>>> optional.
>>>>>>
>>>>>> Might indeed be useful to rebase tilcdc on top of that, should be possible
>>>>>> to nuke piles of code.
>>>>
>>>> Looks interesting. Does it look like it is getting ready to be merged soon?
>> Should be landind soon, yes. Probably not for 4.7, that's closed now, but
>> I can still pick it up into drm-misc right away when it's ready. Open
>> review comments are all just small things, you could pick the latest
>> version to start prototyping a conversion and there shouldn't be any
>> surprises when you rebase onto the merged version.
> Hmmm, too bad it wants to own its encoder. LCDC on Beaglebone-Black
> needs the componentized external tda998x driver. So at least in its
> current form the drm_simple_display_pipe wont work for tilcdc.
>
> It may not be too big a job to add an external encoder support, but
> would it complicate currently so nice and simple driver structure too much?

How about we add an argument for encoder and if it is NULL, then the no-op
encoder is used:

int drm_simple_display_pipe_init(struct drm_device *dev,
                  struct drm_simple_display_pipe *pipe,
                  struct drm_simple_display_pipe_funcs *funcs,
                  const uint32_t *formats,
                  unsigned int format_count,
                  struct drm_encoder *encoder,
                  struct drm_connector *connector)
{
     struct drm_plane *plane = &pipe->plane;
     struct drm_crtc *crtc = &pipe->crtc;
     int ret;

     pipe->funcs = funcs;

     drm_plane_helper_add(plane, &drm_simple_kms_plane_helper_funcs);
     ret = drm_universal_plane_init(dev, plane, 0,
                        &drm_simple_kms_plane_funcs,
                        formats, format_count,
                        DRM_PLANE_TYPE_PRIMARY, NULL);
     if (ret)
         return ret;

     drm_crtc_helper_add(crtc, &drm_simple_kms_crtc_helper_funcs);
     ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
                     &drm_simple_kms_crtc_funcs, NULL);
     if (ret)
         return ret;

     if (!encoder) {
         encoder = kzalloc(sizeof(*encoder), GFP_KERNEL);
         if (!encoder)
             return -ENOMEM;

         ret = drm_encoder_init(dev, encoder,
                        &drm_simple_kms_encoder_funcs,
                        DRM_MODE_ENCODER_NONE, NULL);
         if (ret)
             return ret;
     }

     encoder->possible_crtcs = 1 << drm_crtc_index(crtc);
     ret = drm_mode_connector_attach_encoder(connector, encoder);
     if (ret)
         return ret;

     return drm_connector_register(connector);
}

static void drm_simple_kms_encoder_cleanup(struct drm_encoder *encoder)
{
     drm_encoder_cleanup(encoder);
     kfree(encoder);
}

static const struct drm_encoder_funcs drm_simple_kms_encoder_funcs = {
     .destroy = drm_simple_kms_encoder_cleanup,
};


Noralf.

> 	Jyri

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-05-10 14:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11 16:46 [PATCH RFC 00/11] drm/tilcdc: Atomic modeset support Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 01/11] drm/tilcdc: Make tilcdc_crtc_page_flip() public Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 02/11] drm/tilcdc: Add dummy primary plane implementation Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 03/11] drm/tilcdc: Initialize dummy primary plane from crtc init Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 04/11] drm/tilcdc: Add tilcdc_crtc_mode_set_nofb() Jyri Sarha
2016-04-12 16:13   ` Daniel Vetter
2016-04-11 16:46 ` [PATCH RFC 05/11] drm/tilcdc: Add tilcdc_crtc_atomic_check() Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 06/11] drm/tilcdc: Add atomic mode config funcs Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 07/11] drm/tilcdc: Add drm_mode_config_reset() call to tilcdc_load() Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 08/11] drm/tilcdc: Call drm_crtc_vblank_off() in tilcdc_crtc_destroy() Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 09/11] drm/tilcdc: Set DRIVER_ATOMIC and use atomic crtc helpers Jyri Sarha
2016-04-12  7:41   ` Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 10/11] drm/tilcdc: Remove obsolete crtc helper functions Jyri Sarha
2016-04-11 16:46 ` [PATCH RFC 11/11] drm/tilcdc: Remove tilcdc_verify_fb() Jyri Sarha
2016-05-09 14:10 ` [PATCH RFC 00/11] drm/tilcdc: Atomic modeset support Tomi Valkeinen
2016-05-09 14:42   ` Daniel Vetter
2016-05-09 21:29     ` Jyri Sarha
2016-05-10  6:34       ` Daniel Vetter
2016-05-10  9:14         ` Jyri Sarha
2016-05-10 14:04           ` Noralf Trønnes [this message]
2016-05-10 14:18             ` Daniel Vetter
2016-05-10 15:11               ` Laurent Pinchart
2016-05-10 16:08                 ` Daniel Vetter
2016-05-10 17:30               ` Noralf Trønnes
2016-05-10 22:31                 ` Daniel Vetter
2016-05-10  6:36       ` Daniel Vetter
2016-05-09 21:16   ` Jyri Sarha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=120916d3-69d2-dc7a-98ba-9ccd5bff7880@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.