New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD support for freescale i.MX6 #5202

Merged
merged 2 commits into from Sep 2, 2014

Conversation

Projects
None yet
@wolfgar
Contributor

wolfgar commented Aug 12, 2014

Hi

Here is a PR (split as 2 commits to ease reviewing) which adds support for the Freescale i.MX6 SystemOnChip.
I initiated this work a little more than one year ago in this thread. Then, to ease collaboration, this porting effort moved to github repo when Chris contributed the rendering through vivante extensions.

This result is a collaborative work and I would like to thank especially @koying, @smallint and @warped-rudi who helped a lot with this development. Also maintainers of Geexbox, archlinux arm and openelec helped a lot.

This code is known to work on all i.MX6 variants and has been run successfully on a large number of boards/devices.

Sorry if everything is not ready for inclusion : I am fully available to take into account all your remarks or to provide explanations to enable this merge.

Stéphan

@koying

This comment has been minimized.

Show comment
Hide comment
@koying

koying Aug 12, 2014

Contributor

/cc @davilla @sraue @elupus

The codec is enabled with "imxvpu" in --enable-codec. The code is inactive otherwise.
Linux only for now.

Contributor

koying commented Aug 12, 2014

/cc @davilla @sraue @elupus

The codec is enabled with "imxvpu" in --enable-codec. The code is inactive otherwise.
Linux only for now.

@sraue

This comment has been minimized.

Show comment
Hide comment
@sraue

sraue Aug 12, 2014

Member

+1 for including helix (and improve step by step over the time, like its done with RPi)
will make a build later today for testing (the version from some days ago is working so far)

Member

sraue commented Aug 12, 2014

+1 for including helix (and improve step by step over the time, like its done with RPi)
will make a build later today for testing (the version from some days ago is working so far)

@MartijnKaijser MartijnKaijser added this to the Pending for inclusion milestone Aug 13, 2014

@avjui

This comment has been minimized.

Show comment
Hide comment
@avjui

avjui Aug 18, 2014

+1 for including

avjui commented Aug 18, 2014

+1 for including

Show outdated Hide outdated xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -2607,6 +2840,15 @@ bool CLinuxRendererGLES::Supports(EINTERLACEMETHOD method)
if(method == VS_INTERLACEMETHOD_AUTO)
return true;
if(m_renderMethod & RENDER_IMXMAP)
{
if(method == VS_INTERLACEMETHOD_DEINTERLACE

This comment has been minimized.

@FernetMenta

FernetMenta Aug 18, 2014

Member

you should not abuse those existing methods. VS_INTERLACEMETHOD_DEINTERLACE activates yadif.

@FernetMenta

FernetMenta Aug 18, 2014

Member

you should not abuse those existing methods. VS_INTERLACEMETHOD_DEINTERLACE activates yadif.

This comment has been minimized.

@smallint

smallint Aug 24, 2014

Member

What is your recommendation? Should we add new IMX6 specific enumerations? We actually need four of them (Low Motion, High Motion, Low Motion Double Rate, High Motion Double Rate). If adding new ones is advisable what is the correct way to also add corresponding string representations?

@smallint

smallint Aug 24, 2014

Member

What is your recommendation? Should we add new IMX6 specific enumerations? We actually need four of them (Low Motion, High Motion, Low Motion Double Rate, High Motion Double Rate). If adding new ones is advisable what is the correct way to also add corresponding string representations?

@piotrasd

This comment has been minimized.

Show comment
Hide comment
@piotrasd

piotrasd Aug 18, 2014

+1 for including

+1 for including

Show outdated Hide outdated xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -103,6 +114,7 @@ CLinuxRendererGLES::YUVBUFFER::YUVBUFFER()
#if defined(TARGET_ANDROID)
mediacodec = NULL;
#endif
codecinfo = NULL;

This comment has been minimized.

@FernetMenta

FernetMenta Aug 18, 2014

Member

should be split into its own commit if not directly related to MX6

@FernetMenta

FernetMenta Aug 18, 2014

Member

should be split into its own commit if not directly related to MX6

Show outdated Hide outdated xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
}
#endif
}

This comment has been minimized.

@FernetMenta

FernetMenta Aug 18, 2014

Member

please add an new line between those blocks

@FernetMenta

FernetMenta Aug 18, 2014

Member

please add an new line between those blocks

Show outdated Hide outdated xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -2739,5 +2984,16 @@ void CLinuxRendererGLES::AddProcessor(CDVDMediaCodecInfo *mediacodec, int index)
}
#endif
void CLinuxRendererGLES::AddProcessor(CDVDVideoCodecBuffer *codecinfo, int index)

This comment has been minimized.

@FernetMenta

FernetMenta Aug 18, 2014

Member

no entry in ReleaseBuffer required ?

@FernetMenta

FernetMenta Aug 18, 2014

Member

no entry in ReleaseBuffer required ?

@MartijnKaijser

This comment has been minimized.

Show comment
Hide comment
@MartijnKaijser

MartijnKaijser Aug 18, 2014

Member

Guys. It's asked to some specific devs. Stop doing +1 or it will be rejected

Member

MartijnKaijser commented Aug 18, 2014

Guys. It's asked to some specific devs. Stop doing +1 or it will be rejected

Show outdated Hide outdated xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h
@@ -25,6 +25,7 @@
#include <vector>
#include <string>
#include "cores/VideoRenderers/RenderFormats.h"
#include "DVDVideoCodecInfo.h"

This comment has been minimized.

This comment has been minimized.

@FernetMenta

FernetMenta Aug 18, 2014

Member

btw: codecinfo is IMO not a good name for this class.

@FernetMenta

FernetMenta Aug 18, 2014

Member

btw: codecinfo is IMO not a good name for this class.

Show outdated Hide outdated xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecInfo.h
*
*/
#ifndef DVDVIDEOCODECINFO_H

This comment has been minimized.

@FernetMenta

FernetMenta Aug 18, 2014

Member

we use pragma once

@FernetMenta

FernetMenta Aug 18, 2014

Member

we use pragma once

Show outdated Hide outdated xbmc/windowing/egl/EGLWrapper.cpp
(nativeGuess = CreateEGLNativeType<CEGLNativeTypeRaspberryPI>(implementation)))
(nativeGuess = CreateEGLNativeType<CEGLNativeTypeRaspberryPI>(implementation))
#ifdef HAS_IMXFB
|| (nativeGuess = CreateEGLNativeType<CEGLNativeTypeIMX>(implementation))

This comment has been minimized.

@FernetMenta

FernetMenta Aug 18, 2014

Member

why do you change the coding style?

@FernetMenta

FernetMenta Aug 18, 2014

Member

why do you change the coding style?

@wolfgar

This comment has been minimized.

Show comment
Hide comment
@wolfgar

wolfgar Aug 18, 2014

Contributor

@FernetMenta
Thanks a lot for reviewing : I am taking into account your remarks and will push correction on the branch quickly...

edit 20/08 : I have locally taken into account all your remarks : I still have to run non regression testing. As soon as I have run them, I update the PR...

Contributor

wolfgar commented Aug 18, 2014

@FernetMenta
Thanks a lot for reviewing : I am taking into account your remarks and will push correction on the branch quickly...

edit 20/08 : I have locally taken into account all your remarks : I still have to run non regression testing. As soon as I have run them, I update the PR...

@wolfgar

This comment has been minimized.

Show comment
Hide comment
@wolfgar

wolfgar Aug 21, 2014

Contributor

I have just pushed changes that should take remarks into account
As stated in the comment, I will submit the imx deinterlacing stuff with proper dedicated methods in a PR following this one
Do not hesitate to tell if additional changes are required or if I have misunderstood something...
Also maybe you would prefer that I squash the last commit in the previous ones ?

Contributor

wolfgar commented Aug 21, 2014

I have just pushed changes that should take remarks into account
As stated in the comment, I will submit the imx deinterlacing stuff with proper dedicated methods in a PR following this one
Do not hesitate to tell if additional changes are required or if I have misunderstood something...
Also maybe you would prefer that I squash the last commit in the previous ones ?

@AdamWill

This comment has been minimized.

Show comment
Hide comment
@AdamWill

AdamWill Aug 21, 2014

I'm curious as to why the ProbeResolutions function in the egl native type throws out all resolutions that don't start with "S":

if(!StringUtils::StartsWith(probe_str[i], "S:"))
    continue;
if(ModeToResolution(probe_str[i], &res))
    resolutions.push_back(res);

I can't find the meaning of the possible letters there (my Cubox has modes prefixed with "D", "S", "U" and "V") documented anywhere, so I'm not sure where to ask other than here why the ones other than "S" are getting thrown out. This prevents XBMC using the correct resolution on my Cubox when using an HDMI->DVI cable (as both 1920x1080 and 1280x720 modes show up as "D", not "S").

I'm curious as to why the ProbeResolutions function in the egl native type throws out all resolutions that don't start with "S":

if(!StringUtils::StartsWith(probe_str[i], "S:"))
    continue;
if(ModeToResolution(probe_str[i], &res))
    resolutions.push_back(res);

I can't find the meaning of the possible letters there (my Cubox has modes prefixed with "D", "S", "U" and "V") documented anywhere, so I'm not sure where to ask other than here why the ones other than "S" are getting thrown out. This prevents XBMC using the correct resolution on my Cubox when using an HDMI->DVI cable (as both 1920x1080 and 1280x720 modes show up as "D", not "S").

@FernetMenta

This comment has been minimized.

Show comment
Hide comment
@FernetMenta

FernetMenta Aug 21, 2014

Member

@wolfgar yes, please squash the last commit. I cannot say much about the codec implementation itself but the interface to the application looks ok now.

Member

FernetMenta commented Aug 21, 2014

@wolfgar yes, please squash the last commit. I cannot say much about the codec implementation itself but the interface to the application looks ok now.

@wolfgar

This comment has been minimized.

Show comment
Hide comment
@wolfgar

wolfgar Aug 22, 2014

Contributor

@FernetMenta : Thanks again, I have just updated the branch with the updated commits.

As a reminder here are the changes I pushed following reviewing :

  • Remove imx deinterlacing support : It will be reworked and submitted later as a new PR with dedicated methods for imx deinterlacing
  • class CDVDVideoCodecBuffer removed and specific CDVDVideoCodecIMXBuffer used
  • Renaming of codecinfo to IMXBuffer
  • Useless includes removed
  • Remove the IMXFB define as linux/mxcfb.h is no longer used
  • A few cosmetics changes (remove trailing blanks, insert missing newlines...)
Contributor

wolfgar commented Aug 22, 2014

@FernetMenta : Thanks again, I have just updated the branch with the updated commits.

As a reminder here are the changes I pushed following reviewing :

  • Remove imx deinterlacing support : It will be reworked and submitted later as a new PR with dedicated methods for imx deinterlacing
  • class CDVDVideoCodecBuffer removed and specific CDVDVideoCodecIMXBuffer used
  • Renaming of codecinfo to IMXBuffer
  • Useless includes removed
  • Remove the IMXFB define as linux/mxcfb.h is no longer used
  • A few cosmetics changes (remove trailing blanks, insert missing newlines...)

@wolfgar wolfgar referenced this pull request Aug 22, 2014

Open

Resolution filtering #91

@wolfgar

This comment has been minimized.

Show comment
Hide comment
@wolfgar

wolfgar Aug 22, 2014

Contributor

@AdamWill :
To answer your question regarding letter prefixes for modes, the answer is in the kernel file drivers/video/fbsysfs.c

static int mode_string(char *buf, unsigned int offset,
               const struct fb_videomode *mode)
{
    char m = 'U';
    char v = 'p';

    if (mode->flag & FB_MODE_IS_DETAILED)
        m = 'D';
    if (mode->flag & FB_MODE_IS_VESA)
        m = 'V';
    if (mode->flag & FB_MODE_IS_STANDARD)
        m = 'S';

So now the remaining question is when is the flag FB_MODE_IS_DETAILED applied ?
Answer is : when it is a CEA detailed timing out of edid...
So you are right these values should not be evinced I guess
I file an issue to track it...

Contributor

wolfgar commented Aug 22, 2014

@AdamWill :
To answer your question regarding letter prefixes for modes, the answer is in the kernel file drivers/video/fbsysfs.c

static int mode_string(char *buf, unsigned int offset,
               const struct fb_videomode *mode)
{
    char m = 'U';
    char v = 'p';

    if (mode->flag & FB_MODE_IS_DETAILED)
        m = 'D';
    if (mode->flag & FB_MODE_IS_VESA)
        m = 'V';
    if (mode->flag & FB_MODE_IS_STANDARD)
        m = 'S';

So now the remaining question is when is the flag FB_MODE_IS_DETAILED applied ?
Answer is : when it is a CEA detailed timing out of edid...
So you are right these values should not be evinced I guess
I file an issue to track it...

@topfs2

This comment has been minimized.

Show comment
Hide comment
@topfs2

topfs2 Aug 25, 2014

Member

CreateIMXPTexture isn't define guarded. Is this intentional?
Otherwise it seems very safe to pull

Member

topfs2 commented Aug 25, 2014

CreateIMXPTexture isn't define guarded. Is this intentional?
Otherwise it seems very safe to pull

@topfs2

This comment has been minimized.

Show comment
Hide comment
@topfs2

topfs2 Aug 25, 2014

Member

It looks like it's implemented as the other ones so should be OK. So I will pull in next window unless someone voice against

Member

topfs2 commented Aug 25, 2014

It looks like it's implemented as the other ones so should be OK. So I will pull in next window unless someone voice against

@topfs2

This comment has been minimized.

Show comment
Hide comment
@topfs2

topfs2 Aug 25, 2014

Member

Jenkins build this please

Member

topfs2 commented Aug 25, 2014

Jenkins build this please

@topfs2 topfs2 self-assigned this Aug 25, 2014

@topfs2 topfs2 added the Helix label Aug 25, 2014

@Memphiz

This comment has been minimized.

Show comment
Hide comment
@Memphiz

Memphiz Aug 25, 2014

Member

sorry @topfs2 its still case sensitive - i can't change it :) jenkins build this please

Member

Memphiz commented Aug 25, 2014

sorry @topfs2 its still case sensitive - i can't change it :) jenkins build this please

@topfs2

This comment has been minimized.

Show comment
Hide comment
@topfs2

topfs2 Aug 25, 2014

Member

@Memphiz I can't make heads or tails of the log? Seems to be something jenkins related no?

Member

topfs2 commented Aug 25, 2014

@Memphiz I can't make heads or tails of the log? Seems to be something jenkins related no?

@MartijnKaijser

This comment has been minimized.

Show comment
Hide comment
@MartijnKaijser

MartijnKaijser Aug 25, 2014

Member

jenkins build this please

Member

MartijnKaijser commented Aug 25, 2014

jenkins build this please

@wolfgar

This comment has been minimized.

Show comment
Hide comment
@wolfgar

wolfgar Aug 25, 2014

Contributor

@topfs2 Regarding CreateIMXMAPTexture : it should be buildable without additional guard...
I have just seen the Rpi build has failed but I don't think it is related.
If any additional change is required, do not hesitate to ask for them...

Contributor

wolfgar commented Aug 25, 2014

@topfs2 Regarding CreateIMXMAPTexture : it should be buildable without additional guard...
I have just seen the Rpi build has failed but I don't think it is related.
If any additional change is required, do not hesitate to ask for them...

@topfs2 topfs2 added the Approved label Aug 28, 2014

@topfs2

This comment has been minimized.

Show comment
Hide comment
@topfs2

topfs2 Sep 1, 2014

Member

jenkins build this please

Member

topfs2 commented Sep 1, 2014

jenkins build this please

topfs2 added a commit that referenced this pull request Sep 2, 2014

Merge pull request #5202 from xbmc-imx6/pr-imx
ADD support for freescale i.MX6

@topfs2 topfs2 merged commit 8b1ac02 into xbmc:master Sep 2, 2014

1 check passed

default Merged build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment