tests/monitor-test-utils: Add way to make the GAMMA_LUT zero sized
This will be used to test devices that has no gamma capabilities. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2611>
This commit is contained in:
parent
b29604c3f8
commit
c724cb3720
@ -488,7 +488,9 @@ meta_output_test_class_init (MetaOutputTestClass *klass)
|
||||
static size_t
|
||||
meta_crtc_test_get_gamma_lut_size (MetaCrtc *crtc)
|
||||
{
|
||||
return GAMMA_SIZE;
|
||||
MetaCrtcTest *crtc_test = META_CRTC_TEST (crtc);
|
||||
|
||||
return crtc_test->gamma.size;
|
||||
}
|
||||
|
||||
static MetaGammaLut *
|
||||
@ -497,6 +499,8 @@ meta_crtc_test_get_gamma_lut (MetaCrtc *crtc)
|
||||
MetaCrtcTest *crtc_test = META_CRTC_TEST (crtc);
|
||||
MetaGammaLut *lut;
|
||||
|
||||
g_assert_cmpint (crtc_test->gamma.size, >, 0);
|
||||
|
||||
lut = g_new0 (MetaGammaLut, 1);
|
||||
lut->size = crtc_test->gamma.size;
|
||||
lut->red = g_memdup2 (crtc_test->gamma.red,
|
||||
@ -573,3 +577,12 @@ meta_crtc_test_init (MetaCrtcTest *crtc_test)
|
||||
crtc_test->gamma.blue[i] = gamma;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_crtc_test_disable_gamma_lut (MetaCrtcTest *crtc_test)
|
||||
{
|
||||
crtc_test->gamma.size = 0;
|
||||
g_clear_pointer (&crtc_test->gamma.red, g_free);
|
||||
g_clear_pointer (&crtc_test->gamma.green, g_free);
|
||||
g_clear_pointer (&crtc_test->gamma.blue, g_free);
|
||||
}
|
||||
|
@ -87,4 +87,7 @@ void meta_monitor_manager_test_set_handles_transforms (MetaMonitorManagerTest *m
|
||||
META_EXPORT
|
||||
int meta_monitor_manager_test_get_tiled_monitor_count (MetaMonitorManagerTest *manager_test);
|
||||
|
||||
META_EXPORT
|
||||
void meta_crtc_test_disable_gamma_lut (MetaCrtcTest *crtc_test);
|
||||
|
||||
#endif /* META_MONITOR_MANAGER_TEST_H */
|
||||
|
@ -666,6 +666,8 @@ meta_create_monitor_test_setup (MetaBackend *backend,
|
||||
"id", (uint64_t) i + 1,
|
||||
"gpu", meta_test_get_gpu (backend),
|
||||
NULL);
|
||||
if (setup->crtcs[i].disable_gamma_lut)
|
||||
meta_crtc_test_disable_gamma_lut (META_CRTC_TEST (crtc));
|
||||
|
||||
test_setup->crtcs = g_list_append (test_setup->crtcs, crtc);
|
||||
}
|
||||
|
@ -119,6 +119,7 @@ typedef struct _MonitorTestCaseOutput
|
||||
typedef struct _MonitorTestCaseCrtc
|
||||
{
|
||||
int current_mode;
|
||||
gboolean disable_gamma_lut;
|
||||
} MonitorTestCaseCrtc;
|
||||
|
||||
typedef struct _MonitorTestCaseSetup
|
||||
|
Loading…
Reference in New Issue
Block a user