tbm_surface: added checking num and num_planes