This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to enable "bare metal" GPU / DSS image rotation

Part Number: AM5728

Hello,

I'm trying to rotate an image on the screen 180 degrees (no mirroring) using hardware. The AM572x Technical Reference Manual says this is supported, but there is not enough information to actually enable image rotation.

Section 11.2.4.7 DISPC Rotation and Mirroring shows a 90 degree rotation but not the initialization steps. It includes a description of a 33 bit PBA rotation value but not where or how to set that value.

Tables 11-93, 11-94, & 11-95 list rotation values and supported formats but not how to use that information.

My graphics currently uses xRGB24-8888. The code I'm using is based on pdk_am57xx_1_0_15/packages/ti/drv//vps/examples/dss/displayDssBareMetal. It's bare code - the only code running, so nothing else is changing GPU settings. (No driver, kernel, etc) I need to know what to add / change to enable rotation.

I've tried the obvious of setting the ROTATION flag in the DISPC_*_ATTRIBUTES registers. I've searched the entire TRM for all occurrences of the word TILED, TILER, and also ROTAT. I've also searched for examples in the code supplied in the PDK but can't find anything.

The TRM has a lot of little pieces of information but doesn't have the overall description / initialization sequence. Is it available in an updated TRM or in another document?

Thanks,

Scott

  • Hi Scott,

    Rotation is not supported using DSS in SW.

    Regards,

    Brijesh

  • Hello Brijesh,

    Ok, if rotation isn't supported using DSS, what about direct register manipulation, especially in "bare metal" mode when there is no other code running?

    The manuals advertise rotation is a feature - how do I enable it?

    Thanks,

    Scott

  • Scott, 

    Well, DSS in itself does not support rotation, it uses tiler memory which support rotation. DSS supports reading this special memory.

    Regards,

    Brijesh

  • Hello Brijesh,

    Ok, I understand DSS doesn't support rotation.

    What is the raw register initialization sequence to enable rotation? Not using DSS - just raw register reads & writes.

    Thanks,

    Scott

  • Hello,

    There has to be documentation and/or example code to enable rotation, since it's an advertised feature of the AM5728.

    The TRM has hints how to use it but I can't find anything that actually show it working.

    Thanks,

    Scott

  • Hi Scott,

    Could you please check TRM of the device and see if it support Tiler memory (view)? 

    If this is supported, DSS can be used to rotate the image.

    Regards,

    Brijesh

  • Hello Brijesh,

    As I stated in the original post, the AM572x Technical Reference Manual claims rotation is supported. Yes, the TRM has sections about the tiler.

    However, there's not enough information to determine the register initialization sequence.

    So far, none of the manual commands (using devmem2) have rotated the image. This is why I've asked for documentation or example code.

    Thanks,

    Scott

  • Hi Scott,

    We have some examples in VPE driver/example, in the file X:\vision_sdk\ti_components\drivers\pdk_01_10_02_07\packages\ti\drv\vps\examples\vpe\m2mVpeScale\src\M2mVpeScale_utils.c, which demonstrates tiler memory usage. Please refer to this example and use similar method for DSS input frame memory.

    Regards,

    Brijesh

  • Hi Brijesh,

    I don't see any mention of rotation in that code. Am I missing something?

    If rotation isn't enabled adjusting the input frame memory will have no effect.

    Thanks,

    Scott

  • Hi Scott,

    I said, this examples shows how to use tiler.

    Tiler memory has different views and one of the view provides rotated image view. We need to use the address from the rotated image view. 

    Regards,

    Brijesh

  • Hi Brijesh,

    I understand the basics of the tiler, but there is not enough information to actually use it.

    I reviewed the code in pdk_01_10_02_07\packages\ti\drv\vps\examples\vpe\m2mVpeScale\src\M2mVpeScale_utils.c, but I don't see any reference to the tiler registers. There's also basically no comments, so it's difficult to reverse engineer the logic.

    I've looked for DMM_PAT_* or DMM_TILER_* in the latest sdk available, ti-processor-sdk-rtos-am57xx-evm-06.01.00.08. The #defines exist in pdk_am57xx_1_0_16/packages/ti/csl/cslr_dmm.h but are not used.

    In PROCESSOR_SDK_VISION_03_08_00_00 with pdk_01_10_04_05, those #defines don't exist. I've tried searching for the register addresses but found statements like "*(int *)(0x4E000504) = 0x3FFF20E0" in both the h264vdec and jpegvenc directories.

    Besides the overview in the AM572x Technical Reference Manual, is there documentation available to initialize the tiler?

    Thanks,

    Scott

  • Hi Scott,

    I've been looking through the Vision SDK files, and I did find a BSP function which gets the address to tiler memory after applying a rotation:

    /**
     *  \brief Get tiler address after applying the orientation.
     *
     *  \param tilerAddr    [IN] 0 degree tiler address returned during
     *                           BspUtils_tilerAlloc().
     *  \param cntMode      [IN] Container mode.
     *  \param oriFlag      [IN] Orientation flag representing S, Y', X' bits
     *  \param width        [IN] 0 degree buffer width.
     *  \param height       [IN] 0 degree buffer height.
     *
     *  \return Tiler address after applying the necessary orientation.
     */
    UInt32 BspUtils_tilerGetOriAddr(UInt32 tilerAddr,
                                    UInt32 cntMode,
                                    UInt32 oriFlag,
                                    UInt32 width,
                                    UInt32 height);

    It gets called in App_m2mVpeUpdateProcList() in M2mVpeScale_test.c.

    The function definition can be found here:

    /.../PROCESSOR_SDK_VISION_03_08_00_00/ti_components/drivers/pdk_01_10_04_05/packages/ti/drv/vps/examples/utility/src/bsputils_tiler.c

    Let me know if this helps!

    Regards,

    Munan

  • Hi Munan,

    I was already studying the code in bsputils_tiler.c and the code that calls those routines (M2mVpeScale_main.c & M2mVpeScale_test.c) There's not enough information to reverse engineer the tiler rotation functionality. The TRM has an overview but not enough details to initialize and use the tiler rotation.

    Thanks,

    Scott

  • Hi Scott,

    I would suggest first to use this DSS example only and see DSS can display rotated image. 

    Once this is done, the code can be reused in the SDK.

    Rgds,

    Brijesh