03 Jan, 2012

5 commits

  • Functions fsl_diu_alloc() and fsl_diu_free() were only being called by
    map_video_memory() and unmap_video_memory(), respectively.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • The DIU driver requires some platform-specific functions to be defined,
    but two them can be optional because most platforms implement them the
    same way. Functions set_gamma_table() and get_pixel_format() are only
    needed because of quirks in the Freescale MPC8610 HPCD reference board.
    For other boards, a generic implementation works, so we shouldn't
    require the platform code to define them.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • The functions enable_lcdc() and disable_lcdc() used the variable fb_enable
    to keep a reference count of when the display is enabled, but the code is
    broken. The display is always disabled when disable_lcdc(), and it is
    always enabled when enable_lcdc() is called, regardless of the value of
    fb_enable. Obviously, we don't need to keep a reference count, so just
    remove the variable.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • The DIU uses system RAM for the framebuffer, so FBINFO_VIRTFB should be set.

    Since the framebuffer is in system RAM, it can be read from more quickly
    than written to, so FBINFO_READS_FAST should be set.

    We can also set FBINFO_PARTIAL_PAN_OK for the same reasons.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • Function init_fbinfo() is called only from install_fb(), and it's only a few
    lines long. Plus, it ignores the return code from fb_alloc_cmap(). Merge
    its contents into install_fb() and handle errors properly.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     

20 Dec, 2011

2 commits

  • "machine_data" is too long and clunky, and the "machine" part doesn't make
    much sense, anyway.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • The Freescale DIU driver allocates multiple blocks of memory, including
    multiple DMA buffers. Merge all of these blocks into one data structure.

    Specifically:

    1) struct fsl_diu_data now contains everything that needs to be allocated,
    except for the framebuffers themselves. DMA'able objects are aligned correctly
    within the structure.

    2) struct diu_addr is no longer needed, because we don't have to manage
    multiple blocks of DMA memory.

    3) Since there's no diu_addr any more, macro DMA_ADDR is used to calculate
    the DMA address of any field in fsl_diu_data.

    4) Functions allocate_buf() and free_buf() are no longer needed, because we
    now assume that dma_alloc_coherent() will allocate a page-aligned block,
    and everything is properly aligned with fsl_diu_data already, so we no longer
    need to align any memory blocks ourselves.

    5) The "dummy" area descriptor is now defined separately from the other
    five ADs, so NUM_AOIS (previously called FSL_AOI_NUM) is now set to five
    instead of six. Previously, all six were combined together to avoid a
    separate call to allocate_buf() just for the dummy AD.

    6) framebuffer_alloc() and framebuffer_release() are no longer used. The
    framebuffer is initialized manually.

    7) Error handling is simplified since there's only one memory buffer
    allocated.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     

05 Oct, 2011

9 commits

  • The diu_pool structure contains diu_addr objects for various objects
    allocated in DMA space that are used by the DIU, but the only instance
    of this structure is a global variable, 'pool'. Eliminate 'pool' by
    merging its fields into the fsl_diu_data structure, which is instantiated
    on the heap for each DIU controller found.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • The diu_hw structure contains two fields used to access the DIU registers,
    but the only instance of this structure is a global variable, 'dr'.
    Eliminate 'dr' by merging its fields into the fsl_diu_data structure,
    which is instantiated on the heap for each DIU controller found.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • The Freescale DIU video controller supports five video "modes", but only
    the first two are used by the driver. The other three are special modes
    that don't make sense for a framebuffer driver. Therefore, there's no
    point in keeping a global variable that indicates which mode we're
    supposed to use.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • The MFB_TYPE_xxx macros indicate different "operating modes" of each AOI,
    but this feature is not actually used in the driver. The mfb_index.type
    field is always set to MFB_TYPE_OUTPUT, so just delete it and any code
    that references it.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • Each of the five AOIs created by the DIU driver has a special purpose, and
    they're not treated equally. It makes sense to identify them with an enum
    instead of a hard-coded number.

    Since the 'index' is now an enum, it can only contain allowed values, so
    there's no need to check for an invalid value. This simplifies some other
    code, such as fsl_diu_disable_panel(), which no longer needs to return an
    error code.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • Add the following new video modes to the Freescale DIU framebuffer driver:

    640x480x60
    640x480x72
    640x480x75
    640x480x90
    640x480x100
    800x480x60
    800x600x60
    854x480x60
    1280x480x60
    1280x720x60
    1920x1080x60

    Also add margin data to the 320x240 video mode. This mode was originally
    intended only for the AOIs (overlays) used on planes two and three, but with
    real margin data, it can now be used as an actual video mode.
    Video mode data is from earlier work done by Jerry Huang
    .

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • The function which is supposed to provide screen blanking support doesn't
    actually do anything, so the framebuffer layer thinks the screen has
    been blanked when it really isn't. Remove the code completely for now.

    A side-effect of this change is that the framebuffer console blanking now
    works correctly. Presumably this is because the console now receives -EINVAL
    instead of '0' when it asks the driver to blank the screen, so the console
    does it manually now.

    A signficant refactoring of the driver is planned, and proper hardware
    blanking support will added afterwards.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • Move several macros and structures from the Freescale DIU driver's header
    file into the source file, because they're only used by that file. Also
    delete a few unused macros.

    The diu and diu_ad structures cannot be moved because they're being used
    by the MPC5121 platform file. A future patch eliminate the need for
    the platform file to access these structs, so they'll be moved also.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     
  • Use the _IOx macros to define the ioctl commands, instead of hard-coded
    numbers. Unfortunately, the original definitions of MFB_SET_PIXFMT and
    MFB_GET_PIXFMT used the wrong value for the size, so these macros have
    new values now. To avoid breaking binary compatibility with older
    applications, we retain support for the original values, but the driver
    displays a warning message if they're used.

    Also remove the FBIOGET_GWINFO and FBIOPUT_GWINFO ioctls. FBIOPUT_GWINFO
    was never implemented, and FBIOGET_GWINFO was never used by any
    application.

    Signed-off-by: Timur Tabi
    Signed-off-by: Florian Tobias Schandinat

    Timur Tabi
     

19 Sep, 2011

11 commits


13 Jul, 2011

1 commit

  • Instead of using ill-defined numbers (0, 1, and 2) for the monitor port, allow
    the user to specify the port by name ("dvi", "lvds", or "dlvds"). This works
    on the kernel command line, the module command-line, and the sysfs "monitor"
    device.

    Note that changing the monitor port does not currently work on the P1022DS,
    because the code that talks to the PIXIS FPGA is broken.

    Signed-off-by: Timur Tabi
    Acked-by: Anatolij Gustschin
    Signed-off-by: Paul Mundt

    Timur Tabi
     

24 Jun, 2011

1 commit

  • The Freescale DIU framebuffer driver defines two constants, MIN_PIX_CLK and
    MAX_PIX_CLK, that are supposed to represent the lower and upper limits of
    the pixel clock. These values, however, are true only for one platform
    clock rate (533MHz) and only for the MPC8610. So the actual range for
    the pixel clock is chip-specific, which means the current values are almost
    always wrong. The chance of an out-of-range pixel clock being used are also
    remote.

    Rather than try to detect an out-of-range clock in the DIU driver, we depend
    on the board-specific pixel clock function (e.g. p1022ds_set_pixel_clock)
    to clamp the pixel clock to a supported value.

    Signed-off-by: Timur Tabi
    Signed-off-by: Paul Mundt

    Timur Tabi
     

31 Mar, 2011

1 commit


01 Mar, 2011

1 commit


06 Aug, 2010

1 commit

  • of_device is just an alias for platform_device, so remove it entirely. Also
    replace to_of_device() with to_platform_device() and update comment blocks.

    This patch was initially generated from the following semantic patch, and then
    edited by hand to pick up the bits that coccinelle didn't catch.

    @@
    @@
    -struct of_device
    +struct platform_device

    Signed-off-by: Grant Likely
    Reviewed-by: David S. Miller

    Grant Likely
     

02 Aug, 2010

4 commits

  • Adds support for encoding display mode information
    in the device tree using verbatim EDID block.

    If the EDID entry in the DIU node is present, the
    driver will build mode database using EDID data
    and allow setting the display modes from this database.
    Otherwise display mode will be set using mode
    entries from driver's internal database as usual.

    This patch also updates device tree bindings.

    Signed-off-by: Anatolij Gustschin
    Acked-by: Timur Tabi
    Signed-off-by: Grant Likely

    Anatolij Gustschin
     
  • MPC5121 DIU configuration/setup as initialized by the boot
    loader currently will get lost while booting Linux. As a
    result displaying the boot splash is not possible through
    the boot process.

    To prevent this we reserve configured DIU frame buffer
    address range while booting and preserve AOI descriptor
    and gamma table so that DIU continues displaying through
    the whole boot process. On first open from user space
    DIU frame buffer driver releases the reserved frame
    buffer area and continues to operate as usual.

    Signed-off-by: John Rigby
    Signed-off-by: Anatolij Gustschin
    Acked-by: Timur Tabi
    Signed-off-by: Grant Likely

    Anatolij Gustschin
     
  • Some DIU structures will be used in platform code in
    subsequent MPC5121 DIU patch, so we move this header
    to be able to include it elsewhere.

    Signed-off-by: Anatolij Gustschin
    Acked-by: Timur Tabi
    Signed-off-by: Grant Likely

    Anatolij Gustschin
     
  • On MPC5121e Rev 2.0 re-configuring the DIU area descriptor
    by writing new descriptor address doesn't always work.
    As a result, DIU continues to display using old area descriptor
    even if the new one has been written to the descriptor register of
    the plane.

    Add the code from Freescale MPC5121EADS BSP for writing descriptor
    addresses properly. This fixes the problem for Rev 2.0 silicon.

    Signed-off-by: Anatolij Gustschin
    Signed-off-by: Grant Likely

    Anatolij Gustschin
     

22 May, 2010

1 commit

  • .name, .match_table and .owner are duplicated in both of_platform_driver
    and device_driver. This patch is a removes the extra copies from struct
    of_platform_driver and converts all users to the device_driver members.

    This patch is a pretty mechanical change. The usage model doesn't change
    and if any drivers have been missed, or if anything has been fixed up
    incorrectly, then it will fail with a compile time error, and the fixup
    will be trivial. This patch looks big and scary because it touches so
    many files, but it should be pretty safe.

    Signed-off-by: Grant Likely
    Acked-by: Sean MacLennan

    Grant Likely
     

19 May, 2010

1 commit


07 Apr, 2010

1 commit

  • Made necessary by 6992f5334995af474c2b58d010d08bc597f0f2fe ("sysfs: Use
    one lockdep class per sysfs attribute").

    Prevents further "key xxx not in .data" bug-reports. Although some
    attributes could probably be converted to static ones, this is left for
    people having hardware to test.

    Found by this semantic patch:

    @ init @
    type T;
    identifier A;
    @@

    T {
    ...
    struct device_attribute A;
    ...
    };

    @ main extends init @
    expression E;
    statement S;
    identifier err;
    T *name;
    @@

    ... when != sysfs_attr_init(&name->A.attr);
    (
    + sysfs_attr_init(&name->A.attr);
    if (device_create_file(E, &name->A))
    S
    |
    + sysfs_attr_init(&name->A.attr);
    err = device_create_file(E, &name->A);
    )

    While reviewing, I put the initialization to apropriate places.

    Signed-off-by: Wolfram Sang
    Cc: Eric W. Biederman
    Cc: Greg KH
    Cc: Benjamin Herrenschmidt
    Cc: Grant Likely
    Cc: Mike Isely
    Cc: Mauro Carvalho Chehab
    Cc: Sujith Thomas
    Cc: Matthew Garrett
    Cc: Len Brown
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     

17 Feb, 2010

1 commit