Bug 61603 - Xserver screen number passed uninitialized
Summary: Xserver screen number passed uninitialized
Status: RESOLVED FIXED
Alias: None
Product: libva
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium major
Assignee: haihao
QA Contact: Sean V Kelley
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-28 10:08 UTC by Alexandr
Modified: 2015-11-19 01:45 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
x11_screen driver context member initialization for X11 output (539 bytes, text/plain)
2013-02-28 10:08 UTC, Alexandr
Details

Description Alexandr 2013-02-28 10:08:21 UTC
Created attachment 75679 [details]
x11_screen driver context member initialization for X11 output

We have Xserver configuration with :0.0 connected to DVI and :0.1 connected to HDMI.

Hardware:
01:00.0 VGA compatible controller: nVidia Corporation GT218 [ION] (rev a2)

Video correctly played without acceleration divers on both video outputs. But only :0.0 working correctly when I used acceleration.
Debugging of code revealed problem of not initialized x11_screen mamber in driver context.

Simple initialization fixed problem (va/x11/va_x11.c):
       pDriverContext->native_dpy       = (void *)native_dpy;
+       pDriverContext->x11_screen       = XDefaultScreen(native_dpy);
       pDriverContext->display_type     = VA_DISPLAY_X11;


I do not patched wayland, drm and android. Not sure if there needed screen number. But in any case it should be initialized there. For example, by setting to 0.

Places where x11_screen should be initialized simple to find by command:
~/dev/libva$ grep -r 'pDriverContext->native_dpy *=' .
./va/android/va_android.cpp:            pDriverContext->native_dpy       = (void *)native_dpy;
./va/drm/va_drm.c:    pDriverContext->native_dpy   = NULL;
./va/wayland/va_wayland.c:    pDriverContext->native_dpy          = display;
./va/x11/va_x11.c:        pDriverContext->native_dpy       = (void *)native_dpy;


Patch for x11 in current master branch (9f4dedc4de014cc665c32dfbac1c017f9396b563) attached.
Comment 1 haihao 2015-11-19 01:45:37 UTC
Applied. Thanks for the patch.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.