There isn’t much you can do short of covering the window. He will keep up until he kills himself. Had one do the same thing to the outside mirror on my truck. He mangled his beak so badly he could no longer eat.
This Cardinal is only his way to killing himself. He doesn’t keep at it for as long and he doesn’t hit it as hard as he did.