Skip to content

DISPMANX_MODEINFO_T transform value sometimes correct #348

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

Closed
waveform80 opened this issue Oct 20, 2016 · 7 comments
Closed

DISPMANX_MODEINFO_T transform value sometimes correct #348

waveform80 opened this issue Oct 20, 2016 · 7 comments

Comments

@waveform80
Copy link
Contributor

I've been working on adding screenshot capabilities to picamera and ran across something a little odd in the result of vc_dispmanx_display_get_info. When display_rotate (in /boot/config.txt) is set to 0, 1, or 3 (no rotation, 90 degrees, or 270 degrees), the info returned by vc_dispmanx_display_get_info is as expected: width and height are all correct (swapped in the case of 90 or 270 degree rotation), and the transform field reports the display rotation (0, 1, or 3).

However, when display_rotate is set to 2 (180 degree rotation), width and height are correct (same as unrotated), but transform reads 0 (the display is definitely rotated though). The same happens for 65536 and 131072 (horizontal and vertical flip) too, but I'm not sure if those are documented use-cases.

The following little snippet of C should demonstrate things:

#include <stdio.h>
#include "bcm_host.h"

int main(void) {
    DISPMANX_DISPLAY_HANDLE_T display;
    DISPMANX_MODEINFO_T info;

    bcm_host_init();
    display = vc_dispmanx_display_open(0);
    vc_dispmanx_display_get_info(display, &info);
    printf("Size: %dx%d, Transform: %d\n", info.width, info.height, info.transform);
}
@popcornmix
Copy link
Contributor

Are you happy just getting the value of display_rotate back?
i.e. 0, 1, 2, 3 for standard rotations with 65536 or 131072 added if there are flips?

@waveform80
Copy link
Contributor Author

Yup, that'd be perfect.

I've had a look at raspi2png's source code while I'm at it and it seems to work around the issue by using vc_gencmd to query the display_rotate parameter directly. I haven't translated that header yet, so this getting fixed might save me a bit of work (and from the looks of it, vc_gencmd involves some string parsing under the covers - always nice to avoid stuff like that if possible :).

@popcornmix
Copy link
Contributor

Test firmware you can try: https://www.dropbox.com/s/oo5f4ztfozgeg06/firmware_ip.zip?dl=0

@waveform80
Copy link
Contributor Author

Many thanks - that works nicely!

popcornmix added a commit to raspberrypi/firmware that referenced this issue Oct 25, 2016
kernel: Support for Blokas Labs pisound board
See: raspberrypi/linux#1684

firmware: Video_decode: Check licenced codecs at component create

firmware: dispmanx: Report transform or display as the display_rotate variable
See: raspberrypi/userland#348

firmware: arm_loader: Don't lose force_turbo when initial_turbo completes
See: #667

firmware: mmal: improvements to mmal_queue code

firmware: arm_dt: Silence system-supplied dtparams

firmware: vc_image: Remove obsolete processor support using _VC_VERSION
firmware: vc_image: Include colourspace in RGB to YUV conversions
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Oct 25, 2016
kernel: Support for Blokas Labs pisound board
See: raspberrypi/linux#1684

firmware: Video_decode: Check licenced codecs at component create

firmware: dispmanx: Report transform or display as the display_rotate variable
See: raspberrypi/userland#348

firmware: arm_loader: Don't lose force_turbo when initial_turbo completes
See: raspberrypi/firmware#667

firmware: mmal: improvements to mmal_queue code

firmware: arm_dt: Silence system-supplied dtparams

firmware: vc_image: Remove obsolete processor support using _VC_VERSION
firmware: vc_image: Include colourspace in RGB to YUV conversions
popcornmix added a commit to raspberrypi/firmware that referenced this issue Oct 25, 2016
kernel: Support for Blokas Labs pisound board
See: raspberrypi/linux#1684

firmware: Video_decode: Check licenced codecs at component create

firmware: dispmanx: Report transform or display as the display_rotate variable
See: raspberrypi/userland#348

firmware: arm_loader: Don't lose force_turbo when initial_turbo completes
See: #667

firmware: mmal: improvements to mmal_queue code

firmware: arm_dt: Silence system-supplied dtparams

firmware: vc_image: Remove obsolete processor support using _VC_VERSION
firmware: vc_image: Include colourspace in RGB to YUV conversions
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Oct 25, 2016
kernel: Support for Blokas Labs pisound board
See: raspberrypi/linux#1684

firmware: Video_decode: Check licenced codecs at component create

firmware: dispmanx: Report transform or display as the display_rotate variable
See: raspberrypi/userland#348

firmware: arm_loader: Don't lose force_turbo when initial_turbo completes
See: raspberrypi/firmware#667

firmware: mmal: improvements to mmal_queue code

firmware: arm_dt: Silence system-supplied dtparams

firmware: vc_image: Remove obsolete processor support using _VC_VERSION
firmware: vc_image: Include colourspace in RGB to YUV conversions
mkreisl added a commit to xbianonpi/xbian-package-firmware that referenced this issue Dec 1, 2016
- firmware: isp: Add isp and isp_ilc to standard Pi variant as a cheap resize
- firmware: MMAL: Add parameters to configure source pattern
- firmware: IL Camera: Minor tidy up in RGB output handling
- firmware: Video_render: Support YV12 and NV21 (YVU formats
- firmware: IL Source: Add support for YV12 output (YVU420PackedPlanar)
- firmware: IL ISP: Major updates
- firmware: mmal_ril: Relay buffer alignment from RIL to MMAL

- firmware: ldconfig: Increase line buffer length from 80 to 100

- firmware: h264: Fix skipping of SPSX in header bytes
  See: https://discourse.osmc.tv/t/video-does-not-work-with-hardware-acceleartion/6629/11

- firmware: display: Allow display blanking to affect DPI output
  See: #672

- firmware: Video_decode: Check licenced codecs at component create

- firmware: dispmanx: Report transform or display as the display_rotate variable
  See: raspberrypi/userland#348

- firmware: arm_loader: Don't lose force_turbo when initial_turbo completes
  See: #667

- firmware: mmal: improvements to mmal_queue code

- firmware: arm_dt: Silence system-supplied dtparams

- firmware: vc_image: Remove obsolete processor support using _VC_VERSION
- firmware: vc_image: Include colourspace in RGB to YUV conversions

- firmware: OV5647/IMX219: Shutdown lines in reverse order to opening
  See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=138290#p1052932

- firmware: logging: Fix issue when logging end is at 1G

- firmware: hello_pi: Add hello_mmal_encode example
  See: raspberrypi/userland#349

- firmware: IL ISP: Update to support opaque input
- firmware: IL ISP: Fix for opaque EOS and excessive finalise calls

- firmware: khronos: Use low 256M allocations for bin allocations

- firmware: logging: Fix issue when logging end is at 1G part 2

- firmware: arm_loader: Ensure mbox failure paths return failure

- firmware: arm_loader: Add options for setting shared buffers from kernel driver

- firmware: vcdbg: Use dma driver to access gpu memory

- firmware: dispmanx: Support framebuffer_aspect=-1 for ignore aspect ratio
  See: #638

- firmware: Raspistill: Only fail setting restart int if not 0
- firmware: RaspiVid: -sg option could try opening null file
- firmware: RaspiVid: Segment PTS file too if set
  See: raspberrypi/userland#354

- firmware: RaspiVid: Add raw (YUV420, RGB or grayscale) video output
  See: raspberrypi/userland#342

- firmware: Add support for EGL images allocated by VCSM
  See: raspberrypi/userland#344

- firmware: egl_client: Avoid missing return value warning

- firmware: debug_sym: Use pointer type for user address

- firmware: Video_splitter: store and pass on frame rate information

- firmware: TC358762: Fix broken backlight ratelimiting
neuschaefer pushed a commit to neuschaefer/raspi-binary-firmware that referenced this issue Feb 27, 2017
kernel: Support for Blokas Labs pisound board
See: raspberrypi/linux#1684

firmware: Video_decode: Check licenced codecs at component create

firmware: dispmanx: Report transform or display as the display_rotate variable
See: raspberrypi/userland#348

firmware: arm_loader: Don't lose force_turbo when initial_turbo completes
See: raspberrypi#667

firmware: mmal: improvements to mmal_queue code

firmware: arm_dt: Silence system-supplied dtparams

firmware: vc_image: Remove obsolete processor support using _VC_VERSION
firmware: vc_image: Include colourspace in RGB to YUV conversions
@JamesH65
Copy link
Collaborator

JamesH65 commented Dec 5, 2017

@popcornmix Did this get merged?

@popcornmix
Copy link
Contributor

Yes (you can see the firmware updates that link to this issue above)

@JamesH65
Copy link
Collaborator

JamesH65 commented Dec 5, 2017

Cool, closing.

@JamesH65 JamesH65 closed this as completed Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants