dri: Reference the global driver vtable once at screen init..
[mesa.git] / src / mesa / drivers / dri / common / dri_util.c
1 /*
2 * (C) Copyright IBM Corporation 2002, 2004
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 * USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 /**
26 * \file dri_util.c
27 * DRI utility functions.
28 *
29 * This module acts as glue between GLX and the actual hardware driver. A DRI
30 * driver doesn't really \e have to use any of this - it's optional. But, some
31 * useful stuff is done here that otherwise would have to be duplicated in most
32 * drivers.
33 *
34 * Basically, these utility functions take care of some of the dirty details of
35 * screen initialization, context creation, context binding, DRM setup, etc.
36 *
37 * These functions are compiled into each DRI driver so libGL.so knows nothing
38 * about them.
39 */
40
41
42 #include <stdbool.h>
43 #ifndef __NOT_HAVE_DRM_H
44 #include <xf86drm.h>
45 #endif
46 #include "dri_util.h"
47 #include "utils.h"
48 #include "xmlpool.h"
49 #include "../glsl/glsl_parser_extras.h"
50 #include "main/version.h"
51 #include "main/macros.h"
52
53 PUBLIC const char __dri2ConfigOptions[] =
54 DRI_CONF_BEGIN
55 DRI_CONF_SECTION_PERFORMANCE
56 DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_1)
57 DRI_CONF_SECTION_END
58 DRI_CONF_END;
59
60 /*****************************************************************/
61 /** \name Screen handling functions */
62 /*****************************************************************/
63 /*@{*/
64
65 static void
66 setupLoaderExtensions(__DRIscreen *psp,
67 const __DRIextension **extensions)
68 {
69 int i;
70
71 for (i = 0; extensions[i]; i++) {
72 if (strcmp(extensions[i]->name, __DRI_DRI2_LOADER) == 0)
73 psp->dri2.loader = (__DRIdri2LoaderExtension *) extensions[i];
74 if (strcmp(extensions[i]->name, __DRI_IMAGE_LOOKUP) == 0)
75 psp->dri2.image = (__DRIimageLookupExtension *) extensions[i];
76 if (strcmp(extensions[i]->name, __DRI_USE_INVALIDATE) == 0)
77 psp->dri2.useInvalidate = (__DRIuseInvalidateExtension *) extensions[i];
78 if (strcmp(extensions[i]->name, __DRI_SWRAST_LOADER) == 0)
79 psp->swrast_loader = (__DRIswrastLoaderExtension *) extensions[i];
80 }
81 }
82
83 /**
84 * This is the first entrypoint in the driver called by the DRI driver loader
85 * after dlopen()ing it.
86 *
87 * It's used to create global state for the driver across contexts on the same
88 * Display.
89 */
90 static __DRIscreen *
91 dri2CreateNewScreen(int scrn, int fd,
92 const __DRIextension **extensions,
93 const __DRIconfig ***driver_configs, void *data)
94 {
95 static const __DRIextension *emptyExtensionList[] = { NULL };
96 __DRIscreen *psp;
97
98 psp = calloc(1, sizeof(*psp));
99 if (!psp)
100 return NULL;
101
102 psp->driver = &driDriverAPI;
103
104 setupLoaderExtensions(psp, extensions);
105
106 #ifndef __NOT_HAVE_DRM_H
107 if (fd != -1) {
108 drmVersionPtr version = drmGetVersion(fd);
109 if (version) {
110 psp->drm_version.major = version->version_major;
111 psp->drm_version.minor = version->version_minor;
112 psp->drm_version.patch = version->version_patchlevel;
113 drmFreeVersion(version);
114 }
115 }
116 #endif
117
118 psp->loaderPrivate = data;
119
120 psp->extensions = emptyExtensionList;
121 psp->fd = fd;
122 psp->myNum = scrn;
123
124 *driver_configs = psp->driver->InitScreen(psp);
125 if (*driver_configs == NULL) {
126 free(psp);
127 return NULL;
128 }
129
130 int gl_version_override = _mesa_get_gl_version_override();
131 if (gl_version_override >= 31) {
132 psp->max_gl_core_version = MAX2(psp->max_gl_core_version,
133 gl_version_override);
134 } else {
135 psp->max_gl_compat_version = MAX2(psp->max_gl_compat_version,
136 gl_version_override);
137 }
138
139 psp->api_mask = (1 << __DRI_API_OPENGL);
140 if (psp->max_gl_core_version > 0)
141 psp->api_mask |= (1 << __DRI_API_OPENGL_CORE);
142 if (psp->max_gl_es1_version > 0)
143 psp->api_mask |= (1 << __DRI_API_GLES);
144 if (psp->max_gl_es2_version > 0)
145 psp->api_mask |= (1 << __DRI_API_GLES2);
146 if (psp->max_gl_es2_version >= 30)
147 psp->api_mask |= (1 << __DRI_API_GLES3);
148
149 driParseOptionInfo(&psp->optionInfo, __dri2ConfigOptions);
150 driParseConfigFiles(&psp->optionCache, &psp->optionInfo, psp->myNum, "dri2");
151
152
153 return psp;
154 }
155
156 /** swrast driver createNewScreen entrypoint. */
157 static __DRIscreen *
158 driCreateNewScreen(int scrn, const __DRIextension **extensions,
159 const __DRIconfig ***driver_configs, void *data)
160 {
161 return dri2CreateNewScreen(scrn, -1, extensions, driver_configs, data);
162 }
163
164 /**
165 * Destroy the per-screen private information.
166 *
167 * \internal
168 * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls
169 * drmClose(), and finally frees \p screenPrivate.
170 */
171 static void driDestroyScreen(__DRIscreen *psp)
172 {
173 if (psp) {
174 /* No interaction with the X-server is possible at this point. This
175 * routine is called after XCloseDisplay, so there is no protocol
176 * stream open to the X-server anymore.
177 */
178
179 _mesa_destroy_shader_compiler();
180
181 psp->driver->DestroyScreen(psp);
182
183 driDestroyOptionCache(&psp->optionCache);
184 driDestroyOptionInfo(&psp->optionInfo);
185
186 free(psp);
187 }
188 }
189
190 static const __DRIextension **driGetExtensions(__DRIscreen *psp)
191 {
192 return psp->extensions;
193 }
194
195 /*@}*/
196
197
198 static bool
199 validate_context_version(__DRIscreen *screen,
200 int mesa_api,
201 unsigned major_version,
202 unsigned minor_version,
203 unsigned *dri_ctx_error)
204 {
205 unsigned req_version = 10 * major_version + minor_version;
206 unsigned max_version = 0;
207
208 switch (mesa_api) {
209 case API_OPENGL_COMPAT:
210 max_version = screen->max_gl_compat_version;
211 break;
212 case API_OPENGL_CORE:
213 max_version = screen->max_gl_core_version;
214 break;
215 case API_OPENGLES:
216 max_version = screen->max_gl_es1_version;
217 break;
218 case API_OPENGLES2:
219 max_version = screen->max_gl_es2_version;
220 break;
221 default:
222 max_version = 0;
223 break;
224 }
225
226 if (max_version == 0) {
227 *dri_ctx_error = __DRI_CTX_ERROR_BAD_API;
228 return false;
229 } else if (req_version > max_version) {
230 *dri_ctx_error = __DRI_CTX_ERROR_BAD_VERSION;
231 return false;
232 }
233
234 return true;
235 }
236
237 /*****************************************************************/
238 /** \name Context handling functions */
239 /*****************************************************************/
240 /*@{*/
241
242 static __DRIcontext *
243 dri2CreateContextAttribs(__DRIscreen *screen, int api,
244 const __DRIconfig *config,
245 __DRIcontext *shared,
246 unsigned num_attribs,
247 const uint32_t *attribs,
248 unsigned *error,
249 void *data)
250 {
251 __DRIcontext *context;
252 const struct gl_config *modes = (config != NULL) ? &config->modes : NULL;
253 void *shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
254 gl_api mesa_api;
255 unsigned major_version = 1;
256 unsigned minor_version = 0;
257 uint32_t flags = 0;
258
259 assert((num_attribs == 0) || (attribs != NULL));
260
261 if (!(screen->api_mask & (1 << api))) {
262 *error = __DRI_CTX_ERROR_BAD_API;
263 return NULL;
264 }
265
266 switch (api) {
267 case __DRI_API_OPENGL:
268 mesa_api = API_OPENGL_COMPAT;
269 break;
270 case __DRI_API_GLES:
271 mesa_api = API_OPENGLES;
272 break;
273 case __DRI_API_GLES2:
274 case __DRI_API_GLES3:
275 mesa_api = API_OPENGLES2;
276 break;
277 case __DRI_API_OPENGL_CORE:
278 mesa_api = API_OPENGL_CORE;
279 break;
280 default:
281 *error = __DRI_CTX_ERROR_BAD_API;
282 return NULL;
283 }
284
285 for (unsigned i = 0; i < num_attribs; i++) {
286 switch (attribs[i * 2]) {
287 case __DRI_CTX_ATTRIB_MAJOR_VERSION:
288 major_version = attribs[i * 2 + 1];
289 break;
290 case __DRI_CTX_ATTRIB_MINOR_VERSION:
291 minor_version = attribs[i * 2 + 1];
292 break;
293 case __DRI_CTX_ATTRIB_FLAGS:
294 flags = attribs[i * 2 + 1];
295 break;
296 default:
297 /* We can't create a context that satisfies the requirements of an
298 * attribute that we don't understand. Return failure.
299 */
300 assert(!"Should not get here.");
301 *error = __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE;
302 return NULL;
303 }
304 }
305
306 /* Mesa does not support the GL_ARB_compatibilty extension or the
307 * compatibility profile. This means that we treat a API_OPENGL_COMPAT 3.1 as
308 * API_OPENGL_CORE and reject API_OPENGL_COMPAT 3.2+.
309 */
310 if (mesa_api == API_OPENGL_COMPAT && major_version == 3 && minor_version == 1)
311 mesa_api = API_OPENGL_CORE;
312
313 if (mesa_api == API_OPENGL_COMPAT
314 && ((major_version > 3)
315 || (major_version == 3 && minor_version >= 2))) {
316 *error = __DRI_CTX_ERROR_BAD_API;
317 return NULL;
318 }
319
320 /* The EGL_KHR_create_context spec says:
321 *
322 * "Flags are only defined for OpenGL context creation, and specifying
323 * a flags value other than zero for other types of contexts,
324 * including OpenGL ES contexts, will generate an error."
325 *
326 * The GLX_EXT_create_context_es2_profile specification doesn't say
327 * anything specific about this case. However, none of the known flags
328 * have any meaning in an ES context, so this seems safe.
329 */
330 if (mesa_api != API_OPENGL_COMPAT
331 && mesa_api != API_OPENGL_CORE
332 && flags != 0) {
333 *error = __DRI_CTX_ERROR_BAD_FLAG;
334 return NULL;
335 }
336
337 /* There are no forward-compatible contexts before OpenGL 3.0. The
338 * GLX_ARB_create_context spec says:
339 *
340 * "Forward-compatible contexts are defined only for OpenGL versions
341 * 3.0 and later."
342 *
343 * Forward-looking contexts are supported by silently converting the
344 * requested API to API_OPENGL_CORE.
345 *
346 * In Mesa, a debug context is the same as a regular context.
347 */
348 if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0) {
349 mesa_api = API_OPENGL_CORE;
350 }
351
352 if ((flags & ~(__DRI_CTX_FLAG_DEBUG | __DRI_CTX_FLAG_FORWARD_COMPATIBLE))
353 != 0) {
354 *error = __DRI_CTX_ERROR_UNKNOWN_FLAG;
355 return NULL;
356 }
357
358 if (!validate_context_version(screen, mesa_api,
359 major_version, minor_version, error))
360 return NULL;
361
362 context = calloc(1, sizeof *context);
363 if (!context) {
364 *error = __DRI_CTX_ERROR_NO_MEMORY;
365 return NULL;
366 }
367
368 context->loaderPrivate = data;
369
370 context->driScreenPriv = screen;
371 context->driDrawablePriv = NULL;
372 context->driReadablePriv = NULL;
373
374 if (!screen->driver->CreateContext(mesa_api, modes, context,
375 major_version, minor_version,
376 flags, error, shareCtx) ) {
377 free(context);
378 return NULL;
379 }
380
381 *error = __DRI_CTX_ERROR_SUCCESS;
382 return context;
383 }
384
385 static __DRIcontext *
386 dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
387 const __DRIconfig *config,
388 __DRIcontext *shared, void *data)
389 {
390 unsigned error;
391
392 return dri2CreateContextAttribs(screen, api, config, shared, 0, NULL,
393 &error, data);
394 }
395
396 static __DRIcontext *
397 dri2CreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
398 __DRIcontext *shared, void *data)
399 {
400 return dri2CreateNewContextForAPI(screen, __DRI_API_OPENGL,
401 config, shared, data);
402 }
403
404 /**
405 * Destroy the per-context private information.
406 *
407 * \internal
408 * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls
409 * drmDestroyContext(), and finally frees \p contextPrivate.
410 */
411 static void
412 driDestroyContext(__DRIcontext *pcp)
413 {
414 if (pcp) {
415 pcp->driScreenPriv->driver->DestroyContext(pcp);
416 free(pcp);
417 }
418 }
419
420 static int
421 driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask)
422 {
423 (void) dest;
424 (void) src;
425 (void) mask;
426 return GL_FALSE;
427 }
428
429 /*@}*/
430
431
432 /*****************************************************************/
433 /** \name Context (un)binding functions */
434 /*****************************************************************/
435 /*@{*/
436
437 static void dri_get_drawable(__DRIdrawable *pdp);
438 static void dri_put_drawable(__DRIdrawable *pdp);
439
440 /**
441 * This function takes both a read buffer and a draw buffer. This is needed
442 * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
443 * function.
444 */
445 static int driBindContext(__DRIcontext *pcp,
446 __DRIdrawable *pdp,
447 __DRIdrawable *prp)
448 {
449 /*
450 ** Assume error checking is done properly in glXMakeCurrent before
451 ** calling driUnbindContext.
452 */
453
454 if (!pcp)
455 return GL_FALSE;
456
457 /* Bind the drawable to the context */
458 pcp->driDrawablePriv = pdp;
459 pcp->driReadablePriv = prp;
460 if (pdp) {
461 pdp->driContextPriv = pcp;
462 dri_get_drawable(pdp);
463 }
464 if (prp && pdp != prp) {
465 dri_get_drawable(prp);
466 }
467
468 return pcp->driScreenPriv->driver->MakeCurrent(pcp, pdp, prp);
469 }
470
471 /**
472 * Unbind context.
473 *
474 * \param scrn the screen.
475 * \param gc context.
476 *
477 * \return \c GL_TRUE on success, or \c GL_FALSE on failure.
478 *
479 * \internal
480 * This function calls __DriverAPIRec::UnbindContext, and then decrements
481 * __DRIdrawableRec::refcount which must be non-zero for a successful
482 * return.
483 *
484 * While casting the opaque private pointers associated with the parameters
485 * into their respective real types it also assures they are not \c NULL.
486 */
487 static int driUnbindContext(__DRIcontext *pcp)
488 {
489 __DRIdrawable *pdp;
490 __DRIdrawable *prp;
491
492 /*
493 ** Assume error checking is done properly in glXMakeCurrent before
494 ** calling driUnbindContext.
495 */
496
497 if (pcp == NULL)
498 return GL_FALSE;
499
500 pdp = pcp->driDrawablePriv;
501 prp = pcp->driReadablePriv;
502
503 /* already unbound */
504 if (!pdp && !prp)
505 return GL_TRUE;
506
507 pcp->driScreenPriv->driver->UnbindContext(pcp);
508
509 assert(pdp);
510 if (pdp->refcount == 0) {
511 /* ERROR!!! */
512 return GL_FALSE;
513 }
514
515 dri_put_drawable(pdp);
516
517 if (prp != pdp) {
518 if (prp->refcount == 0) {
519 /* ERROR!!! */
520 return GL_FALSE;
521 }
522
523 dri_put_drawable(prp);
524 }
525
526 pcp->driDrawablePriv = NULL;
527 pcp->driReadablePriv = NULL;
528
529 return GL_TRUE;
530 }
531
532 /*@}*/
533
534
535 static void dri_get_drawable(__DRIdrawable *pdp)
536 {
537 pdp->refcount++;
538 }
539
540 static void dri_put_drawable(__DRIdrawable *pdp)
541 {
542 if (pdp) {
543 pdp->refcount--;
544 if (pdp->refcount)
545 return;
546
547 pdp->driScreenPriv->driver->DestroyBuffer(pdp);
548 free(pdp);
549 }
550 }
551
552 static __DRIdrawable *
553 dri2CreateNewDrawable(__DRIscreen *screen,
554 const __DRIconfig *config,
555 void *data)
556 {
557 __DRIdrawable *pdraw;
558
559 pdraw = malloc(sizeof *pdraw);
560 if (!pdraw)
561 return NULL;
562
563 pdraw->loaderPrivate = data;
564
565 pdraw->driScreenPriv = screen;
566 pdraw->driContextPriv = NULL;
567 pdraw->refcount = 0;
568 pdraw->lastStamp = 0;
569 pdraw->w = 0;
570 pdraw->h = 0;
571
572 dri_get_drawable(pdraw);
573
574 if (!screen->driver->CreateBuffer(screen, pdraw, &config->modes,
575 GL_FALSE)) {
576 free(pdraw);
577 return NULL;
578 }
579
580 pdraw->dri2.stamp = pdraw->lastStamp + 1;
581
582 return pdraw;
583 }
584
585 static void
586 driDestroyDrawable(__DRIdrawable *pdp)
587 {
588 dri_put_drawable(pdp);
589 }
590
591 static __DRIbuffer *
592 dri2AllocateBuffer(__DRIscreen *screen,
593 unsigned int attachment, unsigned int format,
594 int width, int height)
595 {
596 return screen->driver->AllocateBuffer(screen, attachment, format,
597 width, height);
598 }
599
600 static void
601 dri2ReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
602 {
603 screen->driver->ReleaseBuffer(screen, buffer);
604 }
605
606
607 static int
608 dri2ConfigQueryb(__DRIscreen *screen, const char *var, GLboolean *val)
609 {
610 if (!driCheckOption(&screen->optionCache, var, DRI_BOOL))
611 return -1;
612
613 *val = driQueryOptionb(&screen->optionCache, var);
614
615 return 0;
616 }
617
618 static int
619 dri2ConfigQueryi(__DRIscreen *screen, const char *var, GLint *val)
620 {
621 if (!driCheckOption(&screen->optionCache, var, DRI_INT) &&
622 !driCheckOption(&screen->optionCache, var, DRI_ENUM))
623 return -1;
624
625 *val = driQueryOptioni(&screen->optionCache, var);
626
627 return 0;
628 }
629
630 static int
631 dri2ConfigQueryf(__DRIscreen *screen, const char *var, GLfloat *val)
632 {
633 if (!driCheckOption(&screen->optionCache, var, DRI_FLOAT))
634 return -1;
635
636 *val = driQueryOptionf(&screen->optionCache, var);
637
638 return 0;
639 }
640
641 static unsigned int
642 dri2GetAPIMask(__DRIscreen *screen)
643 {
644 return screen->api_mask;
645 }
646
647 /**
648 * swrast swapbuffers entrypoint.
649 *
650 * DRI2 implements this inside the loader with only flushes handled by the
651 * driver.
652 */
653 static void
654 driSwapBuffers(__DRIdrawable *pdp)
655 {
656 assert(pdp->driScreenPriv->swrast_loader);
657
658 pdp->driScreenPriv->driver->SwapBuffers(pdp);
659 }
660
661 /** Core interface */
662 const __DRIcoreExtension driCoreExtension = {
663 .base = { __DRI_CORE, __DRI_CORE_VERSION },
664
665 .createNewScreen = NULL,
666 .destroyScreen = driDestroyScreen,
667 .getExtensions = driGetExtensions,
668 .getConfigAttrib = driGetConfigAttrib,
669 .indexConfigAttrib = driIndexConfigAttrib,
670 .createNewDrawable = NULL,
671 .destroyDrawable = driDestroyDrawable,
672 .swapBuffers = driSwapBuffers, /* swrast */
673 .createNewContext = dri2CreateNewContext, /* swrast */
674 .copyContext = driCopyContext,
675 .destroyContext = driDestroyContext,
676 .bindContext = driBindContext,
677 .unbindContext = driUnbindContext
678 };
679
680 /** DRI2 interface */
681 const __DRIdri2Extension driDRI2Extension = {
682 .base = { __DRI_DRI2, 3 },
683
684 .createNewScreen = dri2CreateNewScreen,
685 .createNewDrawable = dri2CreateNewDrawable,
686 .createNewContext = dri2CreateNewContext,
687 .getAPIMask = dri2GetAPIMask,
688 .createNewContextForAPI = dri2CreateNewContextForAPI,
689 .allocateBuffer = dri2AllocateBuffer,
690 .releaseBuffer = dri2ReleaseBuffer,
691 .createContextAttribs = dri2CreateContextAttribs
692 };
693
694 const __DRIswrastExtension driSWRastExtension = {
695 { __DRI_SWRAST, __DRI_SWRAST_VERSION },
696 driCreateNewScreen,
697 dri2CreateNewDrawable,
698 dri2CreateNewContextForAPI,
699 dri2CreateContextAttribs
700 };
701
702 const __DRI2configQueryExtension dri2ConfigQueryExtension = {
703 .base = { __DRI2_CONFIG_QUERY, __DRI2_CONFIG_QUERY_VERSION },
704
705 .configQueryb = dri2ConfigQueryb,
706 .configQueryi = dri2ConfigQueryi,
707 .configQueryf = dri2ConfigQueryf,
708 };
709
710 void
711 dri2InvalidateDrawable(__DRIdrawable *drawable)
712 {
713 drawable->dri2.stamp++;
714 }
715
716 /**
717 * Check that the gl_framebuffer associated with dPriv is the right size.
718 * Resize the gl_framebuffer if needed.
719 * It's expected that the dPriv->driverPrivate member points to a
720 * gl_framebuffer object.
721 */
722 void
723 driUpdateFramebufferSize(struct gl_context *ctx, const __DRIdrawable *dPriv)
724 {
725 struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate;
726 if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) {
727 ctx->Driver.ResizeBuffers(ctx, fb, dPriv->w, dPriv->h);
728 /* if the driver needs the hw lock for ResizeBuffers, the drawable
729 might have changed again by now */
730 assert(fb->Width == dPriv->w);
731 assert(fb->Height == dPriv->h);
732 }
733 }