mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Thierry Reding <treding@nvidia.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 4/4] drm/panel: Add helper for simple panel connector
Date: Sat, 7 May 2016 14:46:48 +0200	[thread overview]
Message-ID: <4c42bed9-e987-2b0d-2578-ae096939e5e0@tronnes.org> (raw)
In-Reply-To: <CAKMK7uGUW7Uzx5dYG9JxTTqQ4eg3SHirJKq0TLOcG3nnqbY9Bw@mail.gmail.com>


Den 07.05.2016 11:59, skrev Daniel Vetter:
> On Fri, May 6, 2016 at 9:45 PM, Noralf Trønnes <noralf@tronnes.org> wrote:
>> In the discussion following the "no more fbdev drivers" call, someone
>> pointed me to drm_panel. It had function hooks that I needed, so I built
>> tinydrm around it. If this is misusing drm_panel, it shouldn't be too
>> difficult to drop it.
>>
>> Actually I could just do this:
>>
>> struct tinydrm_funcs {
>>          int (*prepare)(struct tinydrm_device *tdev);
>>          int (*unprepare)(struct tinydrm_device *tdev);
>>          int (*enable)(struct tinydrm_device *tdev);
>>          int (*disable)(struct tinydrm_device *tdev);
>>          int (*dirty)(struct drm_framebuffer *fb, void *vmem, unsigned flags,
>>                       unsigned color, struct drm_clip_rect *clips,
>>                       unsigned num_clips);
>> };
>>
>>
>> When it comes to the simple connector, one solution could be to extend
>> drm_simple_display_pipe to embed a connector with (optional) modes:
>>
>>   struct drm_simple_display_pipe {
>> -        struct drm_connector *connector;
>> +        struct drm_connector connector;
>> +        const struct drm_display_mode *modes;
>> +        unsigned int num_modes;
>>   };
>>
>> And maybe optional detect and get_modes hooks:
>>
>>   struct drm_simple_display_pipe_funcs {
>> +        enum drm_connector_status detect(struct drm_connector *connector,
>> +                                         bool force);
>> +        int (*get_modes)(struct drm_connector *connector);
>>   };
>>
>>   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_connector *connector);
>> +                                 int connector_type);
> Tbh I really like that simple_display_pipe is split after the encoder.
> This allows us to easily splice in a drm_bridge (which will register
> the drm_connector itself) with very little work. And even if there's
> not a full-blown bridge you might have different connectors and
> things.
>
>> Another solution is to create a simple connector with modes:
>>
>> struct drm_simple_connector {
>>          struct drm_connector connector;
>>          const struct drm_display_mode *modes;
>>          unsigned int num_modes;
>> };
>>
>> struct drm_connector *drm_simple_connector_create(struct drm_device *dev,
>>          const struct drm_display_mode *modes, unsigned int num_modes,
>>          int connector_type);
> Yeah, this makes more sense to me, but then we're kinda reinventing
> something like simple-panel.c with this. Otoh right now with
> smple_display_pipe it's not possible to wire up the panel callbacks
> easily, so maybe it should be a drm_bridge. Or we just leave this code
> in tinydrm and extract it when someone else has a need for it?

Yes, since there's no obvious use for such a simple controller I'll just 
put it in tinydrm.

Noralf.

      reply	other threads:[~2016-05-07 12:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 13:24 [PATCH 0/4] drm: Add various helpers for simple drivers Noralf Trønnes
2016-05-05 13:24 ` [PATCH 1/4] drm/fb-cma-helper: Add function drm_fb_cma_create_with_funcs() Noralf Trønnes
2016-05-05 16:27   ` Daniel Vetter
2016-05-06 13:01     ` Noralf Trønnes
2016-05-06 13:13       ` Daniel Vetter
2016-05-05 13:24 ` [PATCH 2/4] drm: Make drm_encoder_helper_funcs optional Noralf Trønnes
2016-05-05 16:23   ` Daniel Vetter
2016-05-09 19:19     ` Noralf Trønnes
2016-05-10  6:53       ` Daniel Vetter
2016-05-05 13:24 ` [PATCH 3/4] drm: Add helper for simple display pipeline Noralf Trønnes
2016-05-05 16:45   ` Daniel Vetter
2016-05-09 14:46   ` Daniel Vetter
2016-05-09 18:37     ` Noralf Trønnes
2016-05-10  6:59       ` Daniel Vetter
2016-05-10 22:36         ` Daniel Vetter
2016-05-05 13:24 ` [PATCH 4/4] drm/panel: Add helper for simple panel connector Noralf Trønnes
2016-05-05 17:03   ` Daniel Vetter
2016-05-06 13:39     ` Noralf Trønnes
2016-05-06 14:01       ` Thierry Reding
2016-05-06 14:07         ` Daniel Vetter
2016-05-06 14:03   ` Thierry Reding
2016-05-06 14:08     ` Daniel Vetter
2016-05-06 14:15       ` Thierry Reding
2016-05-06 14:34         ` Noralf Trønnes
2016-05-06 14:41           ` Daniel Vetter
2016-05-06 14:43           ` Thierry Reding
2016-05-06 19:45             ` Noralf Trønnes
2016-05-07  9:59               ` Daniel Vetter
2016-05-07 12:46                 ` Noralf Trønnes [this message]

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=4c42bed9-e987-2b0d-2578-ae096939e5e0@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=treding@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®