mbox series

[0/5] Add tda998x (HDMI) support to atmel-hlcdc

Message ID 20180409105918.20792-1-peda@axentia.se
Headers show
Series Add tda998x (HDMI) support to atmel-hlcdc | expand

Message

Peter Rosin April 9, 2018, 10:59 a.m. UTC
Hi!

I naively thought that since there was support for both nxp,tda19988 (in
the tda998x driver) and the atmel-hlcdc, things would be a smooth ride.
But it wasn't, so I started looking around, and found some missing
pieces in the tilcdc driver. A "stole" some things and made it work
for my use case.

During this, I found that the tda998x driver never sets the format in
the connector display_info. Thus, the atmel-hlcdc driver fails to select
output format. Since I had similar problems with ds90c185 lvds encoder
I added patches to override the atmel-hlcdc output format via a DT
property and things start to play together.

Since this series superseeds the bridge series, I have included the
leftover bindings patch for the ti,ds90c185 here. I also noticed that
the driver date for atmel-hlcdc is bonkers, and added a patch for that.

However, I don't know if the tilcdc driver is interfacing with the
tda998x driver in a sane and modern way, and I don't know if I have
missed any subtle point when I "stole" the code and componentized the
atmel-hlcdc driver. I also have not tested how this behaves if I run
with the components as modules (not targeting that).

Anyway, this series solves some real issues for my HW.

Cheers,
Peter

Peter Rosin (5):
  dt-bindings: display: bridge: lvds-transmitter: add ti,ds90c185
  dt-bindings: display: atmel: add optional output-mode property
  drm/atmel-hlcdc: allow overriding the output mode
  drm/atmel-hlcdc: add support for connecting to tda998x HDMI encoder
  drm/atmel-hlcdc: fix broken release date

 .../devicetree/bindings/display/atmel/hlcdc-dc.txt |   4 +
 .../bindings/display/bridge/lvds-transmitter.txt   |   8 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c     |  12 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c       | 104 +++++++++++++++--
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h       |  23 ++++
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c   | 130 +++++++++++++++++++++
 6 files changed, 266 insertions(+), 15 deletions(-)

Comments

Russell King (Oracle) April 9, 2018, 11:17 a.m. UTC | #1
On Mon, Apr 09, 2018 at 12:59:13PM +0200, Peter Rosin wrote:
> During this, I found that the tda998x driver never sets the format in
> the connector display_info. Thus, the atmel-hlcdc driver fails to select
> output format. Since I had similar problems with ds90c185 lvds encoder
> I added patches to override the atmel-hlcdc output format via a DT
> property and things start to play together.

That sounds like a hack.  The tda998x driver doesn't set the format
because it pre-dates the addition of this information in the display
info structure, and none of its current users require that information.

As you're the first to require it, rather than working around the
driver by adding stuff to DT, it would be much better to improve the
driver by adding this information.

Thanks.
Peter Rosin April 9, 2018, 11:44 a.m. UTC | #2
On 2018-04-09 13:17, Russell King - ARM Linux wrote:
> On Mon, Apr 09, 2018 at 12:59:13PM +0200, Peter Rosin wrote:
>> During this, I found that the tda998x driver never sets the format in
>> the connector display_info. Thus, the atmel-hlcdc driver fails to select
>> output format. Since I had similar problems with ds90c185 lvds encoder
>> I added patches to override the atmel-hlcdc output format via a DT
>> property and things start to play together.
> 
> That sounds like a hack.  The tda998x driver doesn't set the format
> because it pre-dates the addition of this information in the display
> info structure, and none of its current users require that information.
> 
> As you're the first to require it, rather than working around the
> driver by adding stuff to DT, it would be much better to improve the
> driver by adding this information.
> 
> Thanks.

Even if I improved the tda998x driver, it would not be correct.

The background is that while the atmel-hlcdc driver supports rgb888,
our PCB is only wired for rgb565. And the tda19988 has rgb888 input
(we have the lsb bits tied to ground on our PCB). So, the tda998x
driver can request rgb888 and the atmel-hlcdc driver can say ok,
but it still would not be correct. So, where exactly do you suggest
that I model the narrowing of the display format?

Cheers,
Peter
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Russell King (Oracle) April 9, 2018, 12:02 p.m. UTC | #3
On Mon, Apr 09, 2018 at 01:44:22PM +0200, Peter Rosin wrote:
> On 2018-04-09 13:17, Russell King - ARM Linux wrote:
> > On Mon, Apr 09, 2018 at 12:59:13PM +0200, Peter Rosin wrote:
> >> During this, I found that the tda998x driver never sets the format in
> >> the connector display_info. Thus, the atmel-hlcdc driver fails to select
> >> output format. Since I had similar problems with ds90c185 lvds encoder
> >> I added patches to override the atmel-hlcdc output format via a DT
> >> property and things start to play together.
> > 
> > That sounds like a hack.  The tda998x driver doesn't set the format
> > because it pre-dates the addition of this information in the display
> > info structure, and none of its current users require that information.
> > 
> > As you're the first to require it, rather than working around the
> > driver by adding stuff to DT, it would be much better to improve the
> > driver by adding this information.
> > 
> > Thanks.
> 
> Even if I improved the tda998x driver, it would not be correct.
> 
> The background is that while the atmel-hlcdc driver supports rgb888,
> our PCB is only wired for rgb565. And the tda19988 has rgb888 input
> (we have the lsb bits tied to ground on our PCB). So, the tda998x
> driver can request rgb888 and the atmel-hlcdc driver can say ok,
> but it still would not be correct. So, where exactly do you suggest
> that I model the narrowing of the display format?

That isn't described in your covering email to the series - instead,
your cover sounds like you're working around a deficiency in the
tda998x driver.

I think you need to make it clear that the reason you need the DT
property is because of the way the hardware is wired, not because of
the missing bus format in the TDA998x driver.  From what you've just
described, the missing bus format is merely incidental to the issue,
and whether TDA998x provided this or not, you'd still need to override
it.

If we were to add the bus format to the tda998x at a later date, I
would hope your driver would ignore it in this situation?
Peter Rosin April 9, 2018, 12:12 p.m. UTC | #4
On 2018-04-09 14:02, Russell King - ARM Linux wrote:
> On Mon, Apr 09, 2018 at 01:44:22PM +0200, Peter Rosin wrote:
>> On 2018-04-09 13:17, Russell King - ARM Linux wrote:
>>> On Mon, Apr 09, 2018 at 12:59:13PM +0200, Peter Rosin wrote:
>>>> During this, I found that the tda998x driver never sets the format in
>>>> the connector display_info. Thus, the atmel-hlcdc driver fails to select
>>>> output format. Since I had similar problems with ds90c185 lvds encoder
>>>> I added patches to override the atmel-hlcdc output format via a DT
>>>> property and things start to play together.
>>>
>>> That sounds like a hack.  The tda998x driver doesn't set the format
>>> because it pre-dates the addition of this information in the display
>>> info structure, and none of its current users require that information.
>>>
>>> As you're the first to require it, rather than working around the
>>> driver by adding stuff to DT, it would be much better to improve the
>>> driver by adding this information.
>>>
>>> Thanks.
>>
>> Even if I improved the tda998x driver, it would not be correct.
>>
>> The background is that while the atmel-hlcdc driver supports rgb888,
>> our PCB is only wired for rgb565. And the tda19988 has rgb888 input
>> (we have the lsb bits tied to ground on our PCB). So, the tda998x
>> driver can request rgb888 and the atmel-hlcdc driver can say ok,
>> but it still would not be correct. So, where exactly do you suggest
>> that I model the narrowing of the display format?
> 
> That isn't described in your covering email to the series - instead,
> your cover sounds like you're working around a deficiency in the
> tda998x driver.

Sorry, my bad, And sorry for the confusion.

> I think you need to make it clear that the reason you need the DT
> property is because of the way the hardware is wired, not because of
> the missing bus format in the TDA998x driver.  From what you've just
> described, the missing bus format is merely incidental to the issue,
> and whether TDA998x provided this or not, you'd still need to override
> it.

I'll reword if/when I send v2.

> If we were to add the bus format to the tda998x at a later date, I
> would hope your driver would ignore it in this situation?

Assuming that by "your driver" you mean the atmel-hlcdc driver (which
isn't mine), then yes, with the override in place anything the tda998x
driver says about the connector format will still result in what the
forced output mode says from the atmel-hlcdc driver.

Cheers,
Peter
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html