dri3: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new screen close notify hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
a9d35bcdd2
commit
553ea7ebbe
13
dri3/dri3.c
13
dri3/dri3.c
|
@ -19,6 +19,9 @@
|
||||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||||
* OF THIS SOFTWARE.
|
* OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
#include <dix-config.h>
|
||||||
|
|
||||||
|
#include "dix/screen_hooks_priv.h"
|
||||||
|
|
||||||
#include "dri3_priv.h"
|
#include "dri3_priv.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit_priv.h"
|
||||||
|
@ -29,15 +32,11 @@ DevPrivateKeyRec dri3_screen_private_key;
|
||||||
|
|
||||||
static int dri3_screen_generation;
|
static int dri3_screen_generation;
|
||||||
|
|
||||||
static Bool
|
static void dri3_screen_close(CallbackListPtr *pcbl, ScreenPtr screen, void *unused)
|
||||||
dri3_close_screen(ScreenPtr screen)
|
|
||||||
{
|
{
|
||||||
dri3_screen_priv_ptr screen_priv = dri3_screen_priv(screen);
|
dri3_screen_priv_ptr screen_priv = dri3_screen_priv(screen);
|
||||||
|
dixScreenUnhookClose(screen, dri3_screen_close);
|
||||||
unwrap(screen_priv, screen, CloseScreen);
|
|
||||||
|
|
||||||
free(screen_priv);
|
free(screen_priv);
|
||||||
return (*screen->CloseScreen) (screen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
|
@ -53,7 +52,7 @@ dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info)
|
||||||
if (!screen_priv)
|
if (!screen_priv)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
wrap(screen_priv, screen, CloseScreen, dri3_close_screen);
|
dixScreenHookClose(screen, dri3_screen_close);
|
||||||
|
|
||||||
screen_priv->info = info;
|
screen_priv->info = info;
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ typedef struct dri3_dmabuf_format {
|
||||||
} dri3_dmabuf_format_rec, *dri3_dmabuf_format_ptr;
|
} dri3_dmabuf_format_rec, *dri3_dmabuf_format_ptr;
|
||||||
|
|
||||||
typedef struct dri3_screen_priv {
|
typedef struct dri3_screen_priv {
|
||||||
CloseScreenProcPtr CloseScreen;
|
|
||||||
ConfigNotifyProcPtr ConfigNotify;
|
ConfigNotifyProcPtr ConfigNotify;
|
||||||
|
|
||||||
Bool formats_cached;
|
Bool formats_cached;
|
||||||
|
|
Loading…
Reference in New Issue