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.

S3D: Draw the SGX UI layer in Surface flinger Side-By-Side or Top-Bottom

Other Parts Discussed in Thread: 4460

Hi there,

Below is the brief explanation of what is done and where I'm facing the issue.
We  have a dual display system requires to render S3D channels separately to two displays (4470 ICS). 

I took 4AI.1.7 IceCreamSandwitch  (ICS) release and started on the same. I have added the dual (DSI) display support in kernel and  UI cloning on secondary display, it works, below are the changes done for the same to make it work.

Below modifications done to enable the Dual display on the omap4 blaze board.

1. Added the DSI2 Support
2. Added the taal2 panel driver support
3. HWC added the support to clone the primary overlays to secondary display.

For S3D channel separation:

1. Disabled the color transformation (Red/Cyan) in drawWithOpenGL
2. Also does not do any conversion - both the left/right or top/bottom frame is send to the HWC as it is.
3. Hardware composer, crops the (overlay going to primary display) right side and displays the remaining scaled left image to primary display.
4. Secondary display crops out left and scaled right channel while doing S3D playback.

Now with above all modifications S3D playback works but, Now I have a  issue. When we start the playback, it shows the playback pause button status bar in bottom and file name in top. Since  SGX is used for composition, The net result is Left LCD shows the left half of UI and right LCD shows right half of UI, similar in case of TOP-BOTTOM.

I have a question now what can be done to have the UI (that particular layer, as each layer will have flags to indicate whether it is s3d or not)in Side-By-Side or Top-Bottom format so that it will show up correctly. 


Regards
Anuroop Suresh
Jesu
 
"Imagination is more important than knowledge."
 
"The difference between the impossible and the possible lies in a person's determination."

  • Hi Anuroop,

    I guess you may have to enable virtual display support in SGX libraries so that the the SGX composes based on virtual display dimensions which is equivalent to dimensions of both LCD's together.

    Thanks & Best Regards,

    Venkat

  • Hi Venkat,

    Thanks for reply.

    Let re put the question in pictorial representation.  During normal operation need the UI resolution exactly equal to LCD1/2 resolution so that I can clone the LCD1's content on exactly as it is on LCD2. LCD1 and LCD both have  resolution 1280x720.

    So Now while doing S3D playback, for example Side-By-Side.

    - SGX is used during the composition, and original code ( 4AI.1.7 ICS) compose the UI + left channel (scaled to display resolution with red color transform) + right channel(scaled to display resolution with cyan color transform).

    - What I'm trying to achieve is UI + left channel (without any color transform and scaled to display resolution) to LCD1 and UI + (Right channel scaled to display resolution without color transform) to LCD2.

    I have represented same below.

    1. Original Implementation

    ------------|                |-------------------|--------------------------|                 |-----------------|

    |     UI       |       +     |    Left chanel  |       Right Channel |      =         |                       |

    |------------|              |___________ |______________-|                  |-----------------|

    LCD1/2 res                          LCD 1/2 Res                                           LCD 1

    2.1 What is needed

    ------------|                |-------------------|                 |-----------------|

    |     UI       |       +     |    Left chanel  |      =         |                       |

    |------------|              |___________ |                  |-----------------|

    LCD1 width/2           Scaled to LCD 1 Res                      LCD 1

    (Incase of top bottom height/2)

    2.1 What is needed

    ------------|                |-------------------|                 |-----------------|

    |     UI       |       +     |   Right chanel  |      =       |                       |

    |------------|              |___________ |                  |-----------------|

    LCD2 width/2            Scaled to LCD 2 Res                      LCD 2

    (Incase of top bottom height/2)

    Now If I do what is said above in HWC using the cropping window of overlay, what is happening is along with the left/right channel the remaining portion of the UI is also cropped out so only half portion of UI is appeared on display.

    So as you suggested Virtual display in SGX, I have below questions

    1. How to enable Virtual Display support in SGX, need to recompile SGX? or it can be done at runtime?

    2. Will that be able to allow me to draw the UI layer to the half of width and height of display resolution? So that it will match to one channel? dynamically?

    Regards

    Anuroop

  • Anuroop,

    Is this problem solved ? DO you need any further help on this.

    What is the size of your UI content reaching the dsscomp layer in kernel(look at file omaplfb_displayclass.c). Is it the same as the resolution of each of your LCD, 1280x720.

     

    I am here assuming that each of your LCD is of size 1280x720. So both put together it will be of size 2560x720. For my understanding I am also assuming that your left and right pixels are placed as below.

    L1 R1  L2 R2  L3 R3  ... ............  L1280 R1280  --> First line

    L1 R1  L2 R2  L3 R3  ... ............  L1280 R1280  --> second line

    ..

    ..                                                                            --> 720 line

     

    If my assumptions above are correct then, no scaling needs to be done either using SGX or overlay to the UI layer. The same 1280x720 layer can be send to both L and R LCDs, using 2 different overlays. And you should see a correct display.

     

  • Hi Ranjith,

    No the problem still exists. However I have added a workaround where during S3D playback, during SGX composition all the non-s3d layers are discarded.

    If you can provide some help it will be great.

    Both of the LCD resolution is 1280x720 and same is reaching to dsscomp layer. Yes all above assumptions hold true.

    Issue here is SGX is used for composition instead of two separate overlays in hwc. what can be done to force use two separate overlays instead of SGX for composition during s3D playback? One for s3d layers and one for non s3d layers (with SGX composition if more than one layer).

    Regards

    Anuroop

  • I am not familiar with how S3D is currently working in TI releases. My understanding is as follows. Please correct me if I am wrong

    There are the following input ayer to be composed and displayed

    UI layers 0

    UI layers 1

    3D-Layer0-L

    3D-Layer0-R

     

    I am guessing the following layers are available at DSScomp(output by SGX)

    UI layers_0_1  -- Framebuffer layer size 1280x720 - composed by  SGX

    3D-Layer0-L 

    3D-Layer0-R

     

    THe first layer should go to overlays GFX and VID1. Same data repeated on both overlays.

    The 2nd and 3rd layer should go to VID2 and VID3 respectively.

     

    Is this what is happening today. To verify please put prints in kernel file, omaplfb_displayclass.c(I think its now in graphics code and loaded as a kernel module, so look in the graphics release), in function processflipv2. Or else you can run following command and share the output here

    dumpsys SurfaceFlinger

     

     

    How is gain for red colout and cyan applied today. Does the SGX do it during composition. Or does the SGX do it prior to composition using some opengl command. Or do you use CPU to apply gain. Or do you use some register in DSS to do it during rendering.

     

  • In TI release:

    UI layer 0 ......UI layer N  (1280x720) + S3D layer (1280x720) (L+R in single layer) while drawing using opengl both color transform and cropping and resizing done to create a single layer with L+R overlapped with color transform which is input to SGX for compostion along with the all UI layers and output of SGX is single layer which is input to overlay0 for LCD1.

    With display cloning I'm displaying same with overlay3 for LCD2.

    @ DSScomp(output by SGX) only single layer is available i.e. 1280x720.

    I'll check as suggested omaplfb_displayclass.c. But I have checked the SurfaceFlinger and HWC layers when SGX is used for compistion it generate a single layer.

    As well I'll share output of 'dumpsys SurfaceFlinger'

  • >> and output of SGX is single layer which is input to overlay0 for LCD1.

     

    Are you sure this is the case. Is all the data going to LCD1 only. If yes, how can you get 3D effect. Lets discuss further after you share the dumpsys information.

     

    Where are the colour gains getting applied. If you have this information, please share it.

  • Yes all data goes to LCD1, on blaze board when I connect a 3D HDMI TV it shows the 3D effect during S3D playback. But on blaze LCD1 it shows the L  R channel overlapped with Red(L)-Cyan(R) color transforms.

    In my case I have two displays placed very near two eyes, so need to have L to left side display and R to right display which will coniside while simultaneously whatching two LCDs from two eyes and will have 3D effect. (I have done same with 4460 on GB that was simple as the it was done in the kernel layer with s3d_overlay.c driver)

  • Also if you use 3D glasses Red-Cyan for Blaze LCD you will see the 3D effect.

  • Hi as said earlier in the TI 4AI.1.7 release dual LCD display support is not present and I have added the DSI2 and panel2 drivers in the kernel and all the overlays used for LCD1 are cloned to the LCD2.

    Below is the sysdump with dual display on Blaze board during s3d playback.
    as said it shows two overlays 1 and 3 used where overlay 3 is clone of the 1. Here the color transform is disabled.

    shell@android:/ $ dumpsys SurfaceFlinger                                   
    Visible layers (count = 7)
    + OmapLayer 0x1636880 (com.android.systemui.ImageWallpaper)
          z=    21000, pos=(-243,-192), size=(1349, 864), isOpaque=1, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
          client=0x1635428, identity=4
          format= 2, activeBuffer=[1349x 864:1376,  5], transform-hint=0x00, queued-frames=0
                mBufferCount=3, mSynchronousMode=1, default-size=[1349x864], mPixelFormat=5, mTexName=-867317458
                current: {crop=[0,0,0,0], transform=0x00, current=-1}
                next   : {crop=[0,0,-1,-1], transform=0x00, FIFO(0)={}}
                 [00] state=FREE    , crop=[0,0,0,0], transform=0x00, timestamp=27591430667
                 [01] state=FREE    , crop=[0,0,-1,-1], transform=0x00, timestamp=0
                 [02] state=FREE    , crop=[0,0,-1,-1], transform=0x00, timestamp=0
      Region transparentRegion (this=0x1636a20, count=1)
        [  0,   0,   0,   0]
      Region transparentRegionScreen (this=0x16368b4, count=1)
        [  0,   0,   0,   0]
      Region visibleRegionScreen (this=0x1636890, count=1)
        [  0,   0,   0,   0]
    + OmapLayer 0x1640258 (SurfaceView)
          z=    21020, pos=(5,0), size=(1920,1080), isOpaque=1, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[0.44, 0.00][0.00, 0.44]
          client=0x1640ae0, identity=16
          format= 4, activeBuffer=[2048x1184:4096,100], transform-hint=0x00, queued-frames=0
                mBufferCount=5, mSynchronousMode=0, default-size=[1920x1080], mPixelFormat=256, mTexName=772961407
                current: {crop=[32,24,1952,1104], transform=0x00, current=1}
                next   : {crop=[32,24,1952,1104], transform=0x00, FIFO(0)={}}
                 [00] state=FREE    , crop=[32,24,1952,1104], transform=0x00, timestamp=21354666000, 0x1638860 [2048x1184:4096,100]
                >[01] state=QUEUED  , crop=[32,24,1952,1104], transform=0x00, timestamp=21388033000, 0x163bcc8 [2048x1184:4096,100]
                 [02] state=DEQUEUED, crop=[32,24,1952,1104], transform=0x00, timestamp=21254566000, 0x16314d8 [2048x1184:4096,100]
                 [03] state=DEQUEUED, crop=[32,24,1952,1104], transform=0x00, timestamp=21287933000, 0x1638690 [2048x1184:4096,100]
                 [04] state=DEQUEUED, crop=[32,24,1952,1104], transform=0x00, timestamp=21321300000, 0x16416d8 [2048x1184:4096,100]
      Region transparentRegion (this=0x16403f8, count=1)
        [  0,   0,   0,   0]
      Region transparentRegionScreen (this=0x164028c, count=1)
        [  0,   0,   0,   0]
      Region visibleRegionScreen (this=0x1640268, count=1)
        [  5,   0, 858, 479]
    + OmapLayer 0x163c6e0 (com.android.gallery3d/com.android.gallery3d.app.MovieActivity)
          z=    21025, pos=(0,0), size=( 864, 480), isOpaque=0, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
          client=0x1640ae0, identity=15
          format= 1, activeBuffer=[ 864x 480: 864,  5], transform-hint=0x00, queued-frames=0
                mBufferCount=3, mSynchronousMode=1, default-size=[864x480], mPixelFormat=5, mTexName=1286872464
                current: {crop=[0,0,0,0], transform=0x00, current=0}
                next   : {crop=[0,0,0,0], transform=0x00, FIFO(0)={}}
                >[00] state=QUEUED  , crop=[0,0,0,0], transform=0x00, timestamp=118452941898, 0x163c990 [ 864x 480: 864,  5]
                 [01] state=DEQUEUED, crop=[0,0,0,0], transform=0x00, timestamp=117754547123, 0x1640980 [ 864x 480: 864,  5]
                 [02] state=FREE    , crop=[0,0,0,0], transform=0x00, timestamp=118017700200, 0x1641520 [ 864x 480: 864,  5]
      Region transparentRegion (this=0x163c880, count=4)
        [  0,  60, 864, 170]
        [  0, 170, 259, 310]
        [604, 170, 864, 310]
        [  0, 310, 864, 403]
      Region transparentRegionScreen (this=0x163c714, count=4)
        [  0,  60, 864, 170]
        [  0, 170, 259, 310]
        [604, 170, 864, 310]
        [  0, 310, 864, 403]
      Region visibleRegionScreen (this=0x163c6f0, count=3)
        [  0,   0, 864,  60]
        [259, 170, 604, 310]
        [  0, 403, 864, 480]
    + LayerDim 0x163ba20 (DimAnimator)
          z=    21029, pos=(0,0), size=( 864, 480), isOpaque=0, needsDithering=0, invalidate=0, alpha=0x00, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
          client=0x1633de0, identity=10
      Region transparentRegion (this=0x163bbc0, count=1)
        [  0,   0,   0,   0]
      Region transparentRegionScreen (this=0x163ba54, count=1)
        [  0,   0,   0,   0]
      Region visibleRegionScreen (this=0x163ba30, count=1)
        [  0,   0,   0,   0]
    + OmapLayer 0x1639e98 (StatusBarExpanded)
          z=   131005, pos=(0,-480), size=( 864, 442), isOpaque=0, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000004, tr=[1.00, 0.00][0.00, 1.00]
          client=0x1635428, identity=6
          format= 1, activeBuffer=[ 864x 442: 864,  5], transform-hint=0x00, queued-frames=0
                mBufferCount=3, mSynchronousMode=1, default-size=[864x442], mPixelFormat=5, mTexName=-2028555960
                current: {crop=[0,0,0,0], transform=0x00, current=0}
                next   : {crop=[0,0,0,0], transform=0x00, FIFO(0)={}}
                >[00] state=QUEUED  , crop=[0,0,0,0], transform=0x00, timestamp=89473144535, 0x1639968 [ 864x 442: 864,  5]
                 [01] state=DEQUEUED, crop=[0,0,0,0], transform=0x00, timestamp=39730743412, 0x163e298 [ 864x 442: 864,  5]
                 [02] state=FREE    , crop=[0,0,0,0], transform=0x00, timestamp=39746185307, 0x1636828 [ 864x 442: 864,  5]
      Region transparentRegion (this=0x163a038, count=1)
        [  0,   0,   0,   0]
      Region transparentRegionScreen (this=0x1639ecc, count=1)
        [  0,   0,   0,   0]
      Region visibleRegionScreen (this=0x1639ea8, count=1)
        [  0,   0,   0,   0]
    + OmapLayer 0x16357b8 (StatusBar)
          z=   141000, pos=(0,0), size=( 864,  38), isOpaque=1, needsDithering=0, invalidate=0, alpha=0x00, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
          client=0x1635428, identity=3
          format= 1, activeBuffer=[ 864x  38: 864,  5], transform-hint=0x00, queued-frames=0
                mBufferCount=3, mSynchronousMode=1, default-size=[864x38], mPixelFormat=5, mTexName=-1563003837
                current: {crop=[0,0,0,0], transform=0x00, current=2}
                next   : {crop=[0,0,0,0], transform=0x00, FIFO(0)={}}
                 [00] state=DEQUEUED, crop=[0,0,0,0], transform=0x00, timestamp=118008636479, 0x1636760 [ 864x  38: 864,  5]
                 [01] state=FREE    , crop=[0,0,0,0], transform=0x00, timestamp=118289367679, 0x163ae38 [ 864x  38: 864,  5]
                >[02] state=QUEUED  , crop=[0,0,0,0], transform=0x00, timestamp=118570587162, 0x16313b0 [ 864x  38: 864,  5]
      Region transparentRegion (this=0x1635958, count=1)
        [  0,   0,   0,   0]
      Region transparentRegionScreen (this=0x16357ec, count=1)
        [  0,   0,   0,   0]
      Region visibleRegionScreen (this=0x16357c8, count=1)
        [  0,   0,   0,   0]
    + OmapLayer 0x1633ed8 (StrictModeFlash)
          z=  1010000, pos=(0,0), size=( 864, 480), isOpaque=0, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
          client=0x1633de0, identity=2
          format= 1, activeBuffer=[ 864x 480: 864,  1], transform-hint=0x00, queued-frames=0
                mBufferCount=3, mSynchronousMode=1, default-size=[864x480], mPixelFormat=1, mTexName=1505553220
                current: {crop=[0,0,-1,-1], transform=0x00, current=1}
                next   : {crop=[0,0,-1,-1], transform=0x00, FIFO(0)={}}
                 [00] state=FREE    , crop=[0,0,-1,-1], transform=0x00, timestamp=23574615482, 0x1633ea0 [   1x   1:  32,  1]
                >[01] state=QUEUED  , crop=[0,0,-1,-1], transform=0x00, timestamp=27094543461, 0x1630560 [ 864x 480: 864,  1]
                 [02] state=FREE    , crop=[0,0,-1,-1], transform=0x00, timestamp=0
      Region transparentRegion (this=0x1634078, count=1)
        [  0,   0,   0,   0]
      Region transparentRegionScreen (this=0x1633f0c, count=1)
        [  0,   0,   0,   0]
      Region visibleRegionScreen (this=0x1633ee8, count=1)
        [  0,   0,   0,   0]
    Purgatory state (0 entries)
    SurfaceFlinger global state:
    GLES: Imagination Technologies, PowerVR SGX 544, OpenGL ES-CM 1.1
    EGL : 1.4 build 1.8@945322
    EXTS: GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_sprite GLt
      Region WormholeRegion (this=0x1618bf4, count=3)
        [  0,   0,   5, 479]
        [858,   0, 864, 479]
        [  0, 479, 864, 480]
      orientation=0, canDraw=1
      last eglSwapBuffers() time: 5432.129000 us
      last transaction time     : 30.518000 us
      refresh-rate              : 68.000000 fps
      x-dpi                     : 261.257141
      y-dpi                     : 259.404266
      h/w composer present and enabled
    Hardware Composer state:
      numHwLayers=2, flags=00000000
       type   |  handle  |   hints  |   flags  | tr | blend |  format  |       source crop         |           frame           name
    ----------+----------+----------+----------+----+-------+----------+---------------------------+--------------------------------
           FB | 0163bcc8 | 00000000 | 00210001 | 00 | 00100 | 00000100 | [   32,   24, 1952, 1104] | [    5,    0,  858,  479] SurfaceView
           FB | 0163c990 | 00000000 | 00200000 | 00 | 00105 | 00000005 | [    0,    0,  864,  480] | [    0,    0,  864,  480] com.android.gallery3d/com.android.gallery3d.y
    omap4_hwc 2:
      idle timeout: 250ms
      layer 0:
         enabled:true buff:0x0 864x480 stride:3456
         src:(0,0) 432x480 dst:(0,0) 864x480 ix:1 zorder:0
      layer 1:
         enabled:true buff:0x1641ea0 864x480 stride:3456
         src:(432,0) 432x480 dst:(0,0) 864x480 ix:3 zorder:1
      bltpolicy: default, bltmode: regionize

    Allocated buffers:
     0x1630560: 1620.00 KiB |  864 ( 864) x  480 |        1 | 0x00000933
     0x16313b0:  128.25 KiB |  864 ( 864) x   38 |        5 | 0x00000b00
     0x16314d8: unknown     | 2048 (4096) x 1184 |      100 | 0x00002b00
     0x1633ea0:    0.12 KiB |    1 (  32) x    1 |        1 | 0x00000933
     0x1636760:  128.25 KiB |  864 ( 864) x   38 |        5 | 0x00000b00
     0x1636828: 1491.75 KiB |  864 ( 864) x  442 |        5 | 0x00000b00
     0x1638690: unknown     | 2048 (4096) x 1184 |      100 | 0x00002b00
     0x1638860: unknown     | 2048 (4096) x 1184 |      100 | 0x00002b00
     0x16389a0: 4644.00 KiB | 1349 (1376) x  864 |        5 | 0x00000b00
     0x1639968: 1491.75 KiB |  864 ( 864) x  442 |        5 | 0x00000b00
     0x163ae38:  128.25 KiB |  864 ( 864) x   38 |        5 | 0x00000b00
     0x163bcc8: unknown     | 2048 (4096) x 1184 |      100 | 0x00002b00
     0x163c990: 1620.00 KiB |  864 ( 864) x  480 |        5 | 0x00000b00
     0x163e298: 1491.75 KiB |  864 ( 864) x  442 |        5 | 0x00000b00
     0x1640980: 1620.00 KiB |  864 ( 864) x  480 |        5 | 0x00000b00
     0x1641520: 1620.00 KiB |  864 ( 864) x  480 |        5 | 0x00000b00
     0x16416d8: unknown     | 2048 (4096) x 1184 |      100 | 0x00002b00
    Total allocated (estimate): 15984.12 KB
    IMG Graphics HAL state:
      Dumping all active sync objects..
        ID=65, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x52/0x52, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef005acc, ROC DevVA=0xef005ad4, ROC2 DevVA=0xef005adc
        ID=64, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x55/0x55, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef005aa4, ROC DevVA=0xef005aac, ROC2 DevVA=0xef005ab4
        ID=63, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x54/0x54, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef005a7c, ROC DevVA=0xef005a84, ROC2 DevVA=0xef005a8c
        ID=62, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x4f/0x4f, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef0054b4, ROC DevVA=0xef0054bc, ROC2 DevVA=0xef0054c4
        ID=61, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x5f/0x5f, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef005a2c, ROC DevVA=0xef005a34, ROC2 DevVA=0xef005a3c
        ID=44, 0xP...FHWR=0x00000b00, WOP/WOC=0x6e/0x6e, ROP/ROC=0x119/0x119, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef004f7c, ROC DevVA=0xef004f84, ROC2 DevVA=0xef004f8c
        ID=40, 0xP...FHWR=0x00000b00, WOP/WOC=0x6e/0x6e, ROP/ROC=0x10a/0x10a, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef005234, ROC DevVA=0xef00523c, ROC2 DevVA=0xef005244
        ID=38, 0xP...FHWR=0x00000b00, WOP/WOC=0x6f/0x6f, ROP/ROC=0xf3/0xf3, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef00516c, ROC DevVA=0xef005174, ROC2 DevVA=0xef00517c
        ID=18, 0xP...FHWR=0x00000b00, WOP/WOC=0x19/0x19, ROP/ROC=0x0/0x0, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef00039c, ROC DevVA=0xef0003a4, ROC2 DevVA=0xef0003ac
        ID=17, 0xP...FHWR=0x00000b00, WOP/WOC=0x6a/0x6a, ROP/ROC=0x40/0x40, ROP2/ROC2=0x3a/0x3a, WOC DevVA=0xef0005cc, ROC DevVA=0xef0005d4, ROC2 DevVA=0xef0005dc
        ID=16, 0xP...FHWR=0x00000b00, WOP/WOC=0x19/0x19, ROP/ROC=0x0/0x0, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef004234, ROC DevVA=0xef00423c, ROC2 DevVA=0xef004244
        ID=15, 0xP...FHWR=0x00000b00, WOP/WOC=0x6a/0x6a, ROP/ROC=0x35/0x35, ROP2/ROC2=0x28/0x28, WOC DevVA=0xef00411c, ROC DevVA=0xef004124, ROC2 DevVA=0xef00412c
        ID=14, 0xP...FHWR=0x00000b00, WOP/WOC=0x1a/0x1a, ROP/ROC=0x0/0x0, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef000c84, ROC DevVA=0xef000c8c, ROC2 DevVA=0xef000c94
        ID=10, 0xP...FHWR=0x00000b00, WOP/WOC=0x1/0x1, ROP/ROC=0x0/0x0, ROP2/ROC2=0x0/0x0, WOC DevVA=0xef000dec, ROC DevVA=0xef000df4, ROC2 DevVA=0xef000dfc
        ID=8, 0xP...FHWR=0x00000b00, WOP/WOC=0x6a/0x6a, ROP/ROC=0x2e/0x2e, ROP2/ROC2=0x27/0x27, WOC DevVA=0xef000914, ROC DevVA=0xef00091c, ROC2 DevVA=0xef000924
        ID=7, 0xP...FHWR=0x00000933, WOP/WOC=0x0/0x0, ROP/ROC=0x1c/0x1c, ROP2/ROC2=0x6/0x6, WOC DevVA=0xef000694, ROC DevVA=0xef00069c, ROC2 DevVA=0xef0006a4
        ID=6, 0xP...FHWR=0x00000933, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0x1/0x1, WOC DevVA=0xef00066c, ROC DevVA=0xef000674, ROC2 DevVA=0xef00067c
        ID=2, 0xP...FHWR=0x00001000, WOP/WOC=0x300/0x300, ROP/ROC=0x0/0x0, ROP2/ROC2=0x300/0x2ff, WOC DevVA=0xef000054, ROC DevVA=0xef00005c, ROC2 DevVA=0xef000064
        ID=1, 0xP...FHWR=0x00001000, WOP/WOC=0x2ff/0x2ff, ROP/ROC=0x0/0x0, ROP2/ROC2=0x2ff/0x2ff, WOC DevVA=0xef00002c, ROC DevVA=0xef000034, ROC2 DevVA=0xef00003c


  • Anuroop,

    Are you using headmounted display ? Which means that only left eye can see left display and right eye can see right display ?

    On HDMI how it works, is every alternate frame be either left OR right frame. Its like L1, R2, L3, R4 .. So on a 60fps monitor, 30fps will be L and 30fps will be R.

    You mentioned that you able to see 3D content display correctly on your device. Is this correct ?

    You also mentioned that you are cloning whatever is going to LCD1(through GFX) is being cloned on LCD2(using VID3). If this is the case, then the same content is being displayed on both screens. In which case I cant comprehend how 3D is working correctly ?

  • Ranjith,

    Yes I have head-mounted displays.  During normal non-s3d HWC clones everything going to LCD1 to LCD2. Yes I could able to test the 3D content with below modification.  I have modified the HWC to handle the S3D content separately so it uses the same layer but required portion of it. 3SD layer is cropped and scaled depending on encoding.

    E.x: if encoding is SBS and left channel is on L then crop window width is set to half of width and start x,y is 0. which means the L channel is displayed to left LCD.Same way for right LCD x is set to width/2 and width is width/2 so R goes to right LCD. which give 3D effect.

    Now my current issue is if I do as mentioned above,  since SGX is used for composition of UI and 3d layers,  result of cropping and scaling is, left half portion of UI goes to left LCD and right half portion of UI goes to right LCD. (For SGX composition UI layer size is 1280x720 and for s3d layer L+R is 1280x720)

    So currently I have disabled the drawing non-s3d layers during 3D playback in LayerBase.cpp in drawWithOpenGL() function.

    Moving forward question is how this should be handled?

  • Anuroop,

    The way its currently happening in your case, SGX is composing all the UI layers, plus the S3D layers into one layer. Once this happens its not possible to do what you want to do.

    Instead in HWC, you must ensure that the S3D layers dont go through SGX. Instead it should directly go to one overlay. In dsscomp(or in file omaplfb_displayclass.c), you should put a hack to ensure that one half of the frame goes to one overlay and the other to another overlay. For this you will need two overlays. You can use any two of the VID overlays(leave the GFX overlays untouched, so that FB can use it).

    The HWC should use the SGX to compose all the UI layers into framebuffer. This framebuffer layer should be cloned on both displays using 2 overlays(GFX and the remaing VID overlays).

    I think your main changes will be in HWC to detect S3D layer and ensure that is not send to SGX.  I think the rest is almost in place for you already.

     

     

  • You need to configure your "display" to be either the "top-bottom" or "side-by-side" - see S3DHardware.cpp

    You can test this at runtime:

    adb root

    adb shell service call SurfaceFlinger 4002 i32 <type> i32 <order> i32 <switcheable>

    This commands forces the display type to the specified parameters:

    type - 0:mono 1: side by side, 2: top-bottom, 3: row interleaved, 4:column interleaved

    order - 0: Left view first, 1: right view first

    switcheable - 0: display is always in S3D mode (it cannot go into 2D mono mode), 1: display can go into S3D mode dynamically

    Regards,

    Alberto

  • Thanks Ranjith,

    I'll try your suggestions to see if that works for me.

  • Thanks Alberto,

    I'll try your suggestions to see if that works for me.

  • Hi Alberto

    When I used the TOP-BOTTOM and used the mentioned call below is the output and both LCD screen is all messed-up.

    shell@android:/ # service call SurfaceFlinger 4002 i32 2 i32 0 i32 1           
    Result: Parcel(NULL)

  • Did you try this without additional modifications? Or on top of what you had already modified?

    What that command will do is split the framebuffer into two halfs and render accordingly. You will have to make modifications to take each corresponding half and show them individually on each display.

  • Sorry, I just forgot that I have done modifications. I tested on top of my modifications may be that is screwing up.

    I'll try without all my modifications. But question is whether L and R channel both will be separate layers? or alternately they are used in composition?

    I'll do some more code browsing so get more insight on what you said to see if that fits my requirement.

  • No they won't be separate layers. The framebuffer will be effectively split in half. Each half will be rendered accordingly:

    1. All 2D layers and All 3D layers left view are composited into the frame buffers left view (whatever half that happens to be depending on the display options selected)

    2. All 2D layers and All 3D layers right view are composited into the frame buffers right view (whatever half that happens to be depending on the display options selected).

  • So effectively that means FB is drawn in either Side-By-Side or Top-Bottom format for both 2D and 3D layers? So need to dynamically switch the FD format same as the 3D media content and split that accordingly and show on separate LCD? Right?

  • You don't necessarily have to match the media content format (but it would probably be best to get the best resolution);

    In any case, yes you will need to change the "s3d display" type dynamically and split it to achieve what you want.

  • Hi Ranjith Alberto,

    I appreciate for the help. Finally I could able to get it  working as required. I hacked into the hwc to handle this special use case when I have 3d + UI layers as suggested used the overlay for s3d and SGX for all other UI layers. So it works

    Regards

    Anuroop