fresnel-fourier iter5b-β Phase 6 commit C: β refactor — OUTPUT lifecycle to CreateContext + CRIT-1 + CRIT-2
Strip OUTPUT-side V4L2 device-format lifecycle out of
RequestCreateSurfaces2 entirely. Move S_FMT(OUTPUT), CAPTURE-format
probe, cap_pool_init, per-surface destination_* fill into
RequestCreateContext where config_id (and therefore the bound
VAProfile) is known via config_object->pixelformat (wired by
commit B). The α' multi-CreateSurfaces2-mid-stream failure mode
disappears because β has no in-CreateSurfaces2 teardown branch;
each context cycle does its own setup, DestroyContext handles
teardown.
Phase 5 v2 review amendments:
- CRIT-1: removed video_format==NULL early-return at context.c:64-66
(would have rejected every first β CreateContext).
- CRIT-2: added request_pool_destroy() to DestroyContext before
REQBUFS(0). Pre-β only surface.c's resolution-change branch
called request_pool_destroy; β strips that, so DestroyContext
becomes the sole per-session teardown site.
- IMP-1: probe CAPTURE format first to derive output_type from
video_format->v4l2_mplane (eliminates the hardcoded mplane=true
hack from the Phase 4 v2 plan).
- IMP-2: surface_reset_format_cache() deleted (function + declaration
in surface.h + call in DestroyContext + last_output_{width,height}
fields in request.h). All dead under β.
CreateSurfaces2 now ~50 LOC (was ~250). Pure surface ID allocation
+ per-surface lifecycle bookkeeping; no V4L2 device state touched.
Signed-off-by: claude-noether <claude-noether@reauktion.de>
This commit is contained in:
@@ -165,24 +165,6 @@ VAStatus RequestExportSurfaceHandle(VADriverContextP context,
|
||||
VASurfaceID surface_id, uint32_t mem_type,
|
||||
uint32_t flags, void *descriptor);
|
||||
|
||||
/*
|
||||
* Iteration 2 Fix 1: invalidate the LAST_OUTPUT_WIDTH/HEIGHT cache used
|
||||
* by RequestCreateSurfaces2 to skip redundant v4l2_set_format calls.
|
||||
*
|
||||
* Must be called when the kernel's CAPTURE format state is no longer
|
||||
* guaranteed to match what we last set on OUTPUT — at minimum, on
|
||||
* RequestDestroyContext after REQBUFS(0). Without this, Firefox
|
||||
* playing a multi-video page (mozilla.org with 864-wide intro
|
||||
* videos at varying resolutions) corrupts the next session's CAPTURE
|
||||
* format query: the cache says "already 1920x1088" while the kernel
|
||||
* has reset to defaults, our subsequent G_FMT returns 48x48, and the
|
||||
* exported descriptor encodes wrong pitch/offset.
|
||||
*
|
||||
* Iter5 Track E: cache lives per-driver_data (request_data.last_output_*),
|
||||
* resolving the Sonnet review 7.3 / 9.6 multi-context race.
|
||||
*/
|
||||
void surface_reset_format_cache(struct request_data *driver_data);
|
||||
|
||||
/*
|
||||
* Iter2 Fix 3: bind / unbind a CAPTURE-pool slot to an object_surface.
|
||||
* Called from picture.c::RequestBeginPicture (acquire+bind) and
|
||||
|
||||
Reference in New Issue
Block a user