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.

AM57x Display Rotation

Other Parts Discussed in Thread: AM5728

Hi Sir

We would like to  do display rotation in AM57xx EVM.

Does TI have any document or SOP how to implement it and thanks for reply.

BR

Yimin

  • Hi,

    What software are you using?
  • TI Latest Linux SDK.

    BR
    Yimin
  • Thanks. I have asked the software team to comment. They will respond directly here.
  • There is no document or example on display rotation available.

    It is supposed to be supported by DSS driver, not tested though. The requirement is that the buffer in question has to be a TILER 2D buffer. OMAP_BO_TILED_32 is the flag to use when allocating the omap bo when using 32bit ARGB. (dumb buffer won't work).

     Each driver has to understand TILER 2D buffers before they can consume those buffers. DSS does, VIP doesn't. CPU access to a TILER 2D buffer is quite slow. 

  • Hi manisha,
    I am using 18bit pixel,How do we rotate with omap dss?

    Thanks,
    PRRADDHEP REDDE
  • Hi,

    where we can set OMAP_BO_TILED flag for omapdss or omapdrm?

    Thanks,

    PRRADDHEP REDDE

  • Hi

    Please Any body can help me ?

  • Sorry

    no one can help you.

    please create another topic to ask again.

    BR

    Yimin

  • Pradeep,

    I have tested rotation with DSS and is working properly for ARGB32 only. You need to allocate display buffers in Tiled 2D .

    You can clone git:/git.ti.com/glsdk/omapdrmtest.git  and refer utils/display-kms.c on how to allocate buffers in TILED region.

  • Hi Ramprasad,
    Thanks for your information.

    I am using 18bits for pixel .My LCD is in 18bit parallel connection.Can we rotate with your information.
    I am using the ti sdk for AM5728, can't we change in kernel source it self to get rotation?

    Thanks,
    PRRADDHEP REDDE
  • Panel being 18bpp has no connection to tiler as there is no 18bpp framebuffer format. There are 16 bit and 24bpp formats. When using 18bpp panel, the 16bpp or 24bpp framebuffer is converted to 18bpp output by the DISPC

    XRGB8888 and ARGB8888 are known to work. RGB565 might work. Remember rotation feature is not officially supported yet.

  • Hi Ramprasad,

    Can u suggest me how compile the omapdrm test .I downloaded from ur link.

    Thanks,

    PRRADDHEP REDDE

  • Response from Ramprasad:

    Follow these settings, you should be able to build

    export GLSDK = <Path to the extracted filesystem>
    export PATH=<Path to cross-compile toolchain>:$PATH
    export PKG_CONFIG_PATH=$GLSDK/usr/lib/pkgconfig
    export INSTALL_PATH = <Install location>
    export DRM_CFLAGS="-I$GLSDK/usr/include -I$GLSDK/usr/include/libdrm/ -I$GLSDK/usr/include/omap -I$GLSDK/usr/include/libkms"
    export DRM_LIBS="-L$GLSDK/usr/lib -ldrm -ldrm_omap"
    export GBM_CFLAGS=-I$GLSDK/usr/include/gbm
    export GBM_LIBS="-L$GLSDK/usr/lib -lgbm"
    export LIBUDEV_CFLAGS=-I$GLSDK/usr/include
    export LIBUDEV_LIBS="-L$GLSDK/usr/lib -ludev"
    export DCE_CFLAGS="-I$GLSDK/usr/include/dce"
    export DCE_LIBS="-L$GLSDK/usr/lib -ldce -lavutil -lavformat"
    cd $GLSDK/usr/lib
    cp libudev.so libudev.so.0
    cp libz.so libz.so.1

    cd omapdrmtest

    ./autogen.sh --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf --prefix=$INSTALL_PATH --with-sysroot=$GLSDK
    make

  • Hi Kemal R. Shakir ,Thanks for your reply.

    I have followed your instructions.But i got the following error.

    ERROR:

    $ make
    make  all-recursive
    make[1]: Entering directory `~/MARS/ti-processor-sdk-linux-am57xx-evm-02.00.01.07/test-omapdrm-pradeep/omapdrmtest'
    Making all in util
    make[2]: Entering directory `~/MARS/ti-processor-sdk-linux-am57xx-evm-02.00.01.07/test-omapdrm-pradeep/omapdrmtest/util'
      CC       libutil_la-display-kms.lo
    libtool: Version mismatch error.  This is libtool 2.4.6, but the
    libtool: definition of this LT_INIT comes from libtool 2.4.2.
    libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6
    libtool: and run autoconf again.
    make[2]: *** [libutil_la-display-kms.lo] Error 63

    My analysis is :

    My Host Ubuntu14.04 is using libtool version 2.4.2 (i am unable to update to 2.4.6).

    and my TI SDK uses 2.4.6 version of libtool.

    How u suggest me hw can we resolve?

    Thanks,

    PRRADDHEP REDDE

  • Hi Kemal R. Shakir,

    I have solved the error. Thanks for your support.

    Rotation has not happen in my case while running fliptest example.

    $ ./fliptest --fps 20 --no-post -w 240x320 In this case rotation has not done.

    How do we use fliptest for rotation?

    After my booting ,I got matrix browser with application.

    If i use fliptest like below it is giving syntax error

    $ ./fliptest --fps 20 --no-post -w 240x320 -t 32

    What is the mode while using "-s" option In  filptest --help ?

    KMS Display Options:
            -1              force single-plane buffers
            -t <tiled-mode> 8, 16, 32, or auto
            -s <connector_id>:<mode>        set a mode
            -s <connector_id>@<crtc_id>:<mode>      set a mode

    Thanks,

    PRRADDHEP REDDE

  • manisha said:
    CPU access to a TILER 2D buffer is quite slow. 

    Actually it isn't, the problems are that :

    1a. a design limitation of TILER (no support for WRAP bursts) interacts badly with the Cortex-A15, which results in bus errors when attempting to read from tiled memory if it is mapped as normal uncacheable (writes are not affected);
    1b. in response the driver was modified to map the memory as strongly-ordered, even though this makes all access to it painfully slow and mapping it as device memory (which is much faster) would have sufficed as workaround.
    2. the driver maps only two pages into userspace at any given time (which is only one line for 32-bit framebuffers wider than 1024 pixels), resulting in hundreds of page faults for every single frame.

    For experimental patches addressing these driver issues see the four commits on this patch branch. The first two commits fix problem 1 and may be of upstreamable quality but can use some review, the remaining two commits are a very hacky quickfix for issue 2 and definitely in need of a cleaner solution.

  • Pradeep,

    omapdrmtest examples don't support rotation by default. -t option tells how you can allocate a buffer in TILER2D region.

    On your board, do /etc/init.d/weston stop   to stop the matrix-Gui and then try examples of omapdrmtest.

  • Hi Ramprasad,
    Thanks for your reply.
    Then How we can get rotation feature in AM5728 processor?
    Is it possible or not?
    If possible where we have to change the code in kernel?
    Can you give me suggestion?

    Thanks,
    PRRADDHEP REDDE
  • Pradeep,
    I have tested this on DRA platform but should work on AM5x also.
    Apply the attached patch on omapdrmtest and integrate the RGBdisplay.c to omapdrmtest by modifying Makefile.am
    RGBdisplay applciation reads one frame of YUV/RGB and posts to display.

    On your board first try modetest to know the connector-id for the LCD. My case it is 32.

    Usage: RGBdisplay -s 32:1280x800 input_RGB.yuv -wt width -ht height -c abgr32 -t auto -r 90
    Here -r is the option to specify rotation angles and supported values are 0, 90, 180 and 270.

    4380.RGBdisplay.txt
    /*
     * Copyright (C) 2012 Texas Instruments
     * Author: Ramprasad <x0038811@ti.com>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License version 2 as published by
     * the Free Software Foundation.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along with
     * this program.  If not, see <http://www.gnu.org/licenses/>.
     */
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <libdce.h>
    #include <xf86drm.h>
    #include <omap_drm.h>
    #include <omap_drmif.h>
    #include <string.h>
    #include "util.h"
    
    #define MAX_IO_BUFS 8
    /* Used for mpeg4 esds data copy */
    
    /* omap drm device handle */
    struct omap_device *dev = NULL;
    enum colorFormat {
    	NV12 = 0,
    	YUYV = 1,
    	RGB24 = 2,
    	BGR24 = 3,
    	ARGB32 = 4,
    	ABGR32 = 5
    };
    
    int tiled = 0;
    struct decoder {
    	struct display *disp;
    	int width;
    	int height;
    	float bpp;
    	int num_outBuf;
    	int cFormat;
       	FILE *inFile;
    
    };
    
    static void
    usage(char *name)
    {
    	MSG("Usage: %s -s <connector_id>:<mode> INFILE -wt width -ht height -c colorformat ", name);
    	MSG("example: %s -s 4:800x480 file.yuv -wt 176 -ht 144 -c nv12 ", name);
    	MSG("Test of YUVdisplay");
    	MSG("");
    	MSG("YUVdisplay options:");
    	MSG("\t --help: Print this help and exit.");
    	MSG("");
    	disp_usage();
    }
    
    static void
    decoder_close(struct decoder *decoder)
    {
        if(!decoder) goto bailout;
    	/* free output buffers allocated by display */
    	disp_free_buffers(decoder->disp,decoder->num_outBuf);
    
    	if (decoder->disp)           disp_close(decoder->disp);
    	free(decoder);
    bailout:
    	if (dev)		             dce_deinit(dev);
    
    }
    
    static struct decoder *
    decoder_open(int argc, char** argv)
    {
    	struct decoder *decoder;
    	char *infile = NULL;
    	int i;
    	int width , height;
    	XDAS_Int32 err;
    	char format[10], drm_fourcc[10];
    	struct buffer *fb;
    
    	decoder = calloc(1, sizeof(*decoder));
    	if (!decoder)
    		return NULL;
    
    	MSG("%p: Opening Display..", decoder);
    	decoder->disp = disp_open(argc, argv);
    	if (!decoder->disp)
    		goto usage;
    
    	/* loop thru args, find input file.. */
    	for (i = 1; i < argc; i++) {
               int fd;
    	   if (!argv[i]) {
    	 	continue;
    	    }
    	    fd = open(argv[i], 0);
    	    if (fd > 0) {
    	       infile = argv[i];
    	       argv[i] = NULL;
    	       close(fd);
    	       break;
    	    }
    	       break;
    	}
            for(i = 1; i < argc; i++){
                if(!argv[i])
                   continue;
    
                if(!strcmp(argv[i],"-wt")){
                    argv[i] = NULL;
                    width = atoi(argv[i+1]);
                    argv[i+1] = NULL;
                    continue;
                }
                if(!strcmp(argv[i], "-ht")){
                    argv[i] = NULL;
                    height = atoi(argv[i+1]);
                    argv[i+1] = NULL;
    				continue;
                }
                if(!strcmp(argv[i], "-c")){
                    argv[i] = NULL;
    		strcpy(format,argv[i+1]);
                    argv[i+1] = NULL;
                }
            }
    
         MSG("width = %d, height = %d format = %s\n", width, height, format);
    
    
    	if(!strcmp(format, "nv12")){
    		strcpy(drm_fourcc, "NV12");
    		decoder->bpp = 1.5;
    		decoder->cFormat = NV12;
    	}
    	else if(!strcmp(format, "yuyv")){
    		strcpy(drm_fourcc, "YUYV");
    		decoder->bpp = 2;
    		decoder->cFormat = YUYV;
    	}
    	else if(!strcmp(format, "rgb24")){
    		strcpy(drm_fourcc, "RG24");
    		decoder->bpp = 3;
    		decoder->cFormat = RGB24;
    	}
    	else if(!strcmp(format, "bgr24")){
    		strcpy(drm_fourcc, "RG24");
    		decoder->bpp = 3;
    		decoder->cFormat = BGR24;
    	}
    	else if(!strcmp(format, "argb32")){
    		strcpy(drm_fourcc, "AR24");
    		decoder->bpp = 4;
    		decoder->cFormat = ARGB32;
    	}
    	else if(!strcmp(format, "abgr32")){
    		strcpy(drm_fourcc, "AR24");
    		decoder->bpp = 4;
    		decoder->cFormat = ABGR32;
    	}
    	else{
    			MSG("Not a valid format\n");
    	}
    	MSG("DRM FORUCC is %s\n", drm_fourcc);
    	if (check_args(argc, argv) || !infile)
    		goto usage;
    
    	/* calculate output buffer parameters: */
    	 width  = ALIGN2 (width, 4);        /* round up to macroblocks */
             height = ALIGN2 (height, 4);       /* round up to macroblocks */
    
            decoder->num_outBuf   = 2;
            decoder->width = width;
            decoder->height = height;
    
            decoder->inFile  = fopen(infile, "rb");
            if(decoder->inFile == NULL){
                ERROR("%p: could not open input file", decoder);
                goto fail;
           }
    
    
          if (! disp_get_vid_buffers(decoder->disp, decoder->num_outBuf,
    			FOURCC_STR(drm_fourcc), width, height)) {
    		ERROR("%p: could not allocate buffers", decoder);
    		goto fail;
    	}
    
           fb = disp_get_fb(decoder->disp);
           dce_set_fd(decoder->disp->fd);
           dev = dce_init();
           if(dev == NULL) {
               ERROR("%p: dce init failed", dev);
    	   goto fail;
           }
    
          return decoder;
    
    usage:
       usage(argv[0]);
    fail:
      if (decoder)
       decoder_close(decoder);
       return NULL;
      }
    
    static int
    decoder_process(struct decoder *decoder)
    {
    	struct buffer *buf;
        XDAS_Int32 bufSize = decoder->width * decoder->height * decoder->bpp;
        char *dst;
        XDAS_Int32 bytes, j;
    
        while(1){
    	    buf = disp_get_vid_buffer(decoder->disp);
    	    if (!buf) {
    		    ERROR("%p: fail: out of buffers", decoder);
    		    return -1;
    	    }
    	    dst = (char*)omap_bo_map(buf->bo[0]);
    	    if(!tiled)
    		    bytes = fread(dst, bufSize, sizeof(char), decoder->inFile);
    	    else{
    		switch(decoder->cFormat){
    		case NV12:
    		    /* NV12 in TILER always expected to be multiplanar */ 
    		    for(j = 0; j < decoder->height; j++){
    			    bytes = fread(dst, decoder->width, sizeof(char), decoder->inFile);
    			    dst += PAGE_SIZE;
    		    }	
    
    	    	    dst = (char*)omap_bo_map(buf->bo[1]);
    		    for(j = 0; j < decoder->height/2 ; j++){
    			    bytes = fread(dst, decoder->width, sizeof(char), decoder->inFile);
    			    dst += PAGE_SIZE;
    		    }	
    
    		break;
    		case YUYV:
    
    		    for(j = 0; j < decoder->height ; j++){
    			    bytes = fread(dst, decoder->width*decoder->bpp, sizeof(char), decoder->inFile);
    			    dst += PAGE_SIZE;
    		    }	
    		break;
    
    		case BGR24:
    		case RGB24:
    		    /* For 24 bit RGB, TILED mode is not supported */
    		    for(j = 0; j < decoder->height ; j++){
    			    bytes = fread(dst, decoder->width*decoder->bpp, sizeof(char), decoder->inFile);
    			    dst += decoder->width * 3;
    		    }	
    		break;
    		case ABGR32:
    		case ARGB32:
    
    		    for(j = 0; j < decoder->height ; j++){
    			    bytes = fread(dst, decoder->width * decoder->bpp, sizeof(char), decoder->inFile);
    			    if(decoder->width * decoder->bpp < PAGE_SIZE)
    			    	dst += PAGE_SIZE;
    			    else
    			    	dst += PAGE_SIZE * 2;
    		    }	
    		break;
    	}
    	    }
    	    if(bytes == 0 )
    		    break;
    
    	    disp_post_vid_buffer(decoder->disp, buf, 0,0, decoder->width,decoder->height);
    	   // c = getchar();
    
    	    disp_put_vid_buffer(decoder->disp, buf);
        }
    
    
    	return 0;
    }
    
    int
    main(int argc, char **argv)
    {
        struct decoder *decoder = NULL;
        int i;
        for (i = 1; i < argc; i++){
    	if ( !strcmp(argv[i], "--help")) {
                usage(argv[0]);
    	    exit(0);
        }
        if(!strcmp(argv[i], "-t")) {
    	tiled = 1;
        }
    }
        decoder = decoder_open(argc,argv);
    
        if(decoder)
    	   decoder_process(decoder);
    
        if(decoder)
           decoder_close(decoder);
    
        decoder = NULL;
    
       return 0;
    }
    
    0001-Add-rotation-support.txt
    From 0c20a24bb733ee2148bf9be9ac7911bb63ec9086 Mon Sep 17 00:00:00 2001
    From: Ramprasad N <x0038811@ti.com>
    Date: Fri, 30 Sep 2016 14:05:05 +0530
    Subject: [PATCH] Add rotation support
    
    Signed-off-by: Ramprasad N <x0038811@ti.com>
    ---
     util/display-kms.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++----
     1 file changed, 62 insertions(+), 4 deletions(-)
    
    diff --git a/util/display-kms.c b/util/display-kms.c
    index 7a5a4d1..3383622 100644
    --- a/util/display-kms.c
    +++ b/util/display-kms.c
    @@ -20,7 +20,6 @@
     #endif
     
     #include "util.h"
    -
     #include <xf86drmMode.h>
     
     
    @@ -57,6 +56,7 @@ struct display_kms {
     	struct buffer *current;
     	bool no_master;
     	int mastership;
    +	uint32_t rotation;
     };
     
     #define to_buffer_kms(x) container_of(x, struct buffer_kms, base)
    @@ -68,7 +68,8 @@ struct buffer_kms {
     static int global_fd = 0;
     static uint32_t used_planes = 0;
     static int ndisplays = 0;
    -
    +static uint32_t get_prop_id(struct display *disp,
    +			drmModeObjectPropertiesPtr props, const char *name);
     static struct omap_bo *
     alloc_bo(struct display *disp, uint32_t bpp, uint32_t width, uint32_t height,
     		uint32_t *bo_handle, uint32_t *pitch)
    @@ -359,6 +360,22 @@ get_overlay_plane(struct display *disp, struct buffer *buf)
     	return 0;
     }
     
    +static uint32_t get_prop_id(struct display *disp,
    +			drmModeObjectPropertiesPtr props, const char *name)
    +{
    +	drmModePropertyPtr p;
    +	uint32_t i, prop_id = 0; /* Property ID should always be > 0 */
    +	for (i = 0; !prop_id && i < props->count_props; i++) {
    +		p = drmModeGetProperty(disp->fd, props->props[i]);
    +		if (!strcmp(p->name, name))
    +			prop_id = p->prop_id;
    +		drmModeFreeProperty(p);
    +	}
    +	if (!prop_id)
    +		printf("Could not find %s property\n", name);
    +	return prop_id;
    +}
    +
     static int
     post_vid_buffer(struct display *disp, struct buffer *buf,
     		uint32_t x, uint32_t y, uint32_t w, uint32_t h)
    @@ -366,7 +383,8 @@ post_vid_buffer(struct display *disp, struct buffer *buf,
     	struct display_kms *disp_kms = to_display_kms(disp);
     	struct buffer_kms *buf_kms = to_buffer_kms(buf);
     	int ret = 0;
    -	uint32_t i, j;
    +	uint32_t i, j,k;
    +	uint32_t rotation_pid = 0, rotationMask = disp_kms->rotation ;
     
     	/* ensure we have the overlay setup: */
     	for (i = 0; i < disp_kms->connectors_count; i++) {
    @@ -385,7 +403,28 @@ post_vid_buffer(struct display *disp, struct buffer *buf,
     				}
     				drmModePlane *ovr = drmModeGetPlane(disp->fd,
     						disp_kms->plane_resources->planes[j]);
    -				if (ovr->possible_crtcs & (1 << connector->pipe)) {
    +			if((disp_kms->bo_flags & OMAP_BO_TILED) && rotationMask)
    +			{
    +					drmModeObjectPropertiesPtr props;
    +					props = drmModeObjectGetProperties(disp->fd, ovr->plane_id, DRM_MODE_OBJECT_PLANE);
    +					if (props) {
    +
    +						rotation_pid = get_prop_id(disp, props, "rotation");
    +						if(!rotation_pid)
    +							MSG("Rotation not supported\n");
    +
    +						drmModeFreeObjectProperties(props);
    +				}
    +				if(rotation_pid) {
    +					ret = drmModeObjectSetProperty(disp->fd, ovr->plane_id, DRM_MODE_OBJECT_PLANE, rotation_pid, rotationMask);
    +					if (ret < 0) {
    +						printf("set rotation property failed\n");
    +						exit(0);
    +					}
    +				}
    +		}
    +
    +			if (ovr->possible_crtcs & (1 << connector->pipe)) {
     					disp_kms->ovr[i] = ovr;
     					used_planes |= (1 << j);
     					break;
    @@ -618,6 +657,25 @@ disp_kms_open(int argc, char **argv)
     				ERROR("invalid arg: %s", argv[i]);
     				goto fail;
     			}
    +		} else if (!strcmp("-r", argv[i])) {
    +			int n;
    +			argv[i++] = NULL;
    +			if(sscanf(argv[i], "%d", &n) != 1) {
    +				ERROR("invalid arg: %s", argv[i]);
    +				goto fail;
    +			}
    +			if(n != 0 && n != 90 && n != 180 && n != 270) {
    +				ERROR("invalid arg: %s rotation 0, 90, 180, 270 are supported", argv[i]);
    +				goto fail;
    +			}
    +			if(n == 90)
    +				disp_kms->rotation = 0x2;
    +			else if(n == 180)
    +				disp_kms->rotation = 0x4;
    +			else if(n == 270)
    +				disp_kms->rotation = 0x8;
    +			else
    +				disp_kms->rotation = 0x1;
     		} else if (!strcmp("-s", argv[i])) {
     			struct connector *connector =
     					&disp_kms->connector[disp_kms->connectors_count++];
    -- 
    1.9.1
    
    

  • Hi Ramprasad, Thanks for your reply.
    Yes,With inputfile.yuv format it is working.

    But my actual use case is not that.I need Matrix browser needs to be rotated and may be applications in matrix browser.

    Is it possible to rotate matrix browser.

    Thanks,
    PRRADDHEP REDDE
  • Hi Sir

    Does AM5728 support the same feature like AM335x to do below command for display rotation ?

    echo "2" > /sys/class/graphics/fb0/rotate

    e2e.ti.com/.../376463

    BR

    Yimin

  • On AM57xx, display rotation is hardware accelerated and can be achieved by allocating the TILED buf and configuring the drm plane properties for rotation. Check prior messages on this thread.

  • Hi manisha,

    Thanks for your reply.

    How do create TILED buffer in kernel space?


    My observation:

    ------------------------

    In file drivers/gpu/drm/omapdrm/omap_fb.c

    In the function void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, struct omap_drm_window *win, struct omap_overlay_info *info)

      The below condition should execute then only rotation will happen

                  if (omap_gem_flags(plane->bo) & OMAP_BO_TILED) {

    So for this we need to send flag OMAP_BO_TILED or OMAP_BO_TILED_32 in initialization.Where exactly we should pass these flags to enter into above condition.


    Thank,

    PRRADDHEP REDDE

  • Pradeep,
    I had pointed you to refer utils/display-kms.c from omapdrmtest for this.
    With -t option, OMAP_BO_TILED flag is set to indicate tiler buffer.
  • Yes Ramprasad,

    But that is user-space application. I need matrix browser to be rotated.
    So in kernel space itself i am trying to create TILED buffer.
    That is not exactly understand Ramprasad.The Omapdrmtest app is working fine by taking input file but my use case is not that.
    Can you suggest me any answers.

    Thanks,
    PRRADDHEP REDDE
  • PRRADDHEP REDDE said:
    But that is user-space application. I need matrix browser to be rotated.

    Matrix browser is also a userspace application.

    A general outline of supporting display rotation depending on graphics stack used:

    direct DRM: see omapdrmtest
    X11: xorg-video-omap supports xrandr
    wayland: no idea
    legacy fbdev: I have really dirty patches for that

  • Hi  Matthijs van Duin,

    Thanks for your reply.

    But i am using wayland.So i need rotation in wayland.

    Thanks

    PRRADDHEP REDDE

  • Please can any body reply for this issue.

    Thanks

    PRRADDHEP REDDE

  • Hi Prraddhep,

    You can enable rotation through wayland by configuring /etc/weston.ini file. Add below lines to your weston file.. In my example, I used HDMI output named as HDMI-A-1. as below. Check for output name of your display by running modetest and modify the parameter accordingly.

    [output]
    name=HDMI-A-1
    transform=180

    You can rotate to different orientation following below settings -
    transform=normal
    The transformation applied to screen output (string). The
    transform key can be one of the following 8 strings:

    normal Normal output.
    90 90 degrees clockwise.
    180 Upside down.
    270 90 degrees counter clockwise.
    flipped Horizontally flipped
    flipped-90 Flipped and 90 degrees clockwise
    flipped-180 Flipped upside down
    flipped-270 Flipped and 90 degrees counter clockwise

    Please note that the rotation feature through weston is software based.

  • Hi Manisha,

    Thanks for your reply


    I tried in AM572x EVM board with above options with HDMI. But nothing will happen rotation.

    Is there any dependencies needed?

    Thanks,

    PRRADDHEP REDDE

  • Make sure weston is running on your board. You can start weston by running follwoing script with start command -

    #/etc/init.d/weston start

    If you still do not see rotation, share with me your weston.ini file and /var/log/weston.log file. 

  • Hi Manisha,

    I found some errors in log file please find the attached log file.

    weston.txt
    Date: 2016-01-28 UTC
    [21:21:24.430] weston 1.6.0
                   http://wayland.freedesktop.org/
                   Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.6.0
                   Build: 1.5.93-5-g2858cc2 configure.ac: bump version to 1.6.0 (2014-09-19 13:40:14 +0300)
    [21:21:24.430] OS: Linux, 4.1.13-g8dc6617, #1 SMP PREEMPT Thu Jan 28 14:18:18 EST 2016, armv7l
    [21:21:24.440] Using config file '/etc//weston.ini'
    [21:21:24.444] Loading module '/usr/lib/weston/drm-backend.so'
    [21:21:24.526] initializing drm backend
    [21:21:24.572] using /dev/dri/card0
    [21:21:24.574] Loading module '/usr/lib/weston/gl-renderer.so'
    failed to load module: /usr/lib/gbm/gbm_dri.so: cannot open shared object file: No such file or directory
    failed to load module: /usr/lib/gbm/gbm_gallium_drm.so: cannot open shared object file: No such file or directory
    loaded module: gbm_pvr.so
    PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c]
    [21:21:24.712] warning: EGL_EXT_buffer_age not supported. Performance could be affected.
    [21:21:24.714] input device 'palmas_pwron', /dev/input/event2 is a keyboard
    [21:21:24.723] input device 'pixcir_tangoc', /dev/input/event1 is a touch device
    [21:21:24.724] input device 'gpio_keys', /dev/input/event0 is a keyboard
    [21:21:24.724] launching '/usr/lib/weston/weston-keyboard'
    [21:21:24.853] Applying calibration: 0.957024 -0.031620 23.466064 0.035414 1.056099 -47.766022 (normalized 0.036666 -0.099513)
    [21:21:24.873] EGL version: 1.4 build 1.9@2253347
    [21:21:24.873] EGL vendor: Imagination Technologies
    [21:21:24.873] EGL client APIs: OpenGL_ES 
    [21:21:24.873] EGL extensions: EGL_IMG_client_api_ogl EGL_KHR_image
                   EGL_KHR_image_base EGL_KHR_image_pixmap
                   EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image
                   EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image
                   EGL_IMG_cl_image EGL_KHR_fence_sync EGL_IMG_hibernate_process
                   EGL_WL_bind_wayland_display EGL_KHR_surfaceless_gles2
                   EGL_NV_post_sub_buffer
    [21:21:24.873] GL version: OpenGL ES 2.0 build 1.9@2253347
    [21:21:24.873] GLSL version: OpenGL ES GLSL ES 1.00 build 1.9@2253347
    [21:21:24.873] GL vendor: Imagination Technologies
    [21:21:24.873] GL renderer: PowerVR SGX 544MP
    [21:21:24.873] GL extensions: GL_OES_rgb8_rgba8 GL_OES_depth24
                   GL_OES_vertex_half_float GL_OES_texture_float
                   GL_OES_texture_half_float GL_OES_element_index_uint
                   GL_OES_mapbuffer GL_OES_fragment_precision_high
                   GL_OES_compressed_ETC1_RGB8_texture GL_OES_EGL_image
                   GL_OES_EGL_image_external GL_OES_required_internalformat
                   GL_OES_depth_texture GL_OES_get_program_binary
                   GL_OES_packed_depth_stencil GL_OES_standard_derivatives
                   GL_OES_vertex_array_object GL_OES_egl_sync GL_OES_texture_npot
                   GL_EXT_multi_draw_arrays GL_EXT_texture_format_BGRA8888
                   GL_EXT_discard_framebuffer GL_EXT_shader_texture_lod
                   GL_IMG_shader_binary GL_IMG_texture_compression_pvrtc
                   GL_IMG_texture_compression_pvrtc2 GL_IMG_texture_npot
                   GL_IMG_texture_format_BGRA8888 GL_IMG_read_format
                   GL_IMG_program_binary GL_IMG_uniform_buffer_object
                   GL_IMG_multisampled_render_to_texture
                   GL_TI_image_external_raw_video
    [21:21:24.874] GL ES 2 renderer features:
                   read-back format: RGBA
                   wl_shm sub-image to texture: no
                   EGL Wayland extension: yes
    [21:21:24.874] Chosen EGL config details:
                   RGBA bits: 8 8 8 8
                   swap interval range: 1 - 1
    [21:21:24.874] Initialized backlight, device /sys/class/backlight/backlight
    [21:21:24.874] Output HDMI1, (connector 26, crtc 28)
                   mode 1024x768@60.0
                   mode 800x600@60.3
                   mode 800x600@56.2
                   mode 848x480@60.0
                   mode 640x480@59.9, current
                   mode 640x480@60.0
    [21:21:24.884] Chosen EGL config details:
                   RGBA bits: 8 8 8 8
                   swap interval range: 1 - 1
    [21:21:24.884] Failed to initialize backlight
    [21:21:24.884] Output None1, (connector 30, crtc 32)
                   mode 800x480@59.5, preferred, current
    [21:21:24.884] Compositor capabilities:
                   arbitrary surface rotation: yes
                   screen capture uses y-flip: yes
    [21:21:24.913] Loading module '/usr/lib/weston/desktop-shell.so'
    [21:21:25.013] launching '/usr/lib/weston/weston-desktop-shell'
    [21:21:25.014] VBlank is pending for connector = 26, frame = 1
    [21:21:25.268] VBlank is pending for connector = 26, frame = 16
    [21:21:25.282] VBlank is pending for connector = 30, frame = 16
    [21:21:31.527] already in the native mode
    [21:21:31.527] already in the native mode
    [21:21:31.539] already in the native mode
    gbmpvr: ERROR: gbm_pvr_bo_import:126: could not get buffer info
    gbmpvr: ERROR: gbm_pvr_bo_import:126: could not get buffer info
    gbmpvr: ERROR: gbm_pvr_bo_import:126: could not get buffer info
    gbmpvr: ERROR: gbm_pvr_bo_import:126: could not get buffer info
    gbmpvr: ERROR: gbm_pvr_bo_import:126: could not get buffer info
    

  • I noticed that you are with weston 1.6 while the PSDK 3.1 is using weston 1.9. I do not know if that's causing the issue at your end.

    Also, make sure to restart weston after you modify your weston.ini file to reflect the changes.